diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json b/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json index ec7cc250ecc3..14c3fa217c06 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json +++ b/sdk/dataprotection/azure-mgmt-dataprotection/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.5", + "autorest": "3.7.2", "use": [ - "@autorest/python@5.8.4", - "@autorest/modelerfour@4.19.2" + "@autorest/python@5.12.0", + "@autorest/modelerfour@4.19.3" ], - "commit": "8d0a1bce1741e7b181746bcce6ad25dad31a3b11", + "commit": "2cbf5888602323474aa60546bf2941cd031639f6", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/dataprotection/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.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "autorest_command": "autorest specification/dataprotection/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/dataprotection/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py index 9dfda54e0346..d84c3d35d4ad 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/__init__.py @@ -12,8 +12,7 @@ __version__ = VERSION __all__ = ['DataProtectionClient'] -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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py index d38b045a587e..7d73d66b0548 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_configuration.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_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,11 +40,11 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None + super(DataProtectionClientConfiguration, 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(DataProtectionClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py index 85019b92c77f..924b47ddbea9 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_data_protection_client.py @@ -6,35 +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 DataProtectionClientConfiguration +from .operations import BackupInstancesOperations, BackupPoliciesOperations, BackupVaultOperationResultsOperations, BackupVaultsOperations, DataProtectionOperations, DataProtectionOperationsOperations, ExportJobsOperationResultOperations, ExportJobsOperations, JobsOperations, OperationResultOperations, OperationStatusOperations, RecoveryPointsOperations, ResourceGuardsOperations, RestorableTimeRangesOperations + 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 DataProtectionClientConfiguration -from .operations import BackupVaultsOperations -from .operations import OperationResultOperations -from .operations import OperationStatusOperations -from .operations import BackupVaultOperationResultsOperations -from .operations import DataProtectionOperations -from .operations import DataProtectionOperationsOperations -from .operations import BackupPoliciesOperations -from .operations import BackupInstancesOperations -from .operations import RecoveryPointsOperations -from .operations import JobsOperations -from .operations import RestorableTimeRangesOperations -from .operations import ExportJobsOperations -from .operations import ExportJobsOperationResultOperations -from .operations import ResourceGuardsOperations -from . import models - + from azure.core.rest import HttpRequest, HttpResponse class DataProtectionClient(object): """Open API 2.0 Specs for Azure Data Protection service. @@ -46,11 +33,13 @@ class DataProtectionClient(object): :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.dataprotection.operations.OperationStatusOperations :ivar backup_vault_operation_results: BackupVaultOperationResultsOperations operations - :vartype backup_vault_operation_results: azure.mgmt.dataprotection.operations.BackupVaultOperationResultsOperations + :vartype backup_vault_operation_results: + azure.mgmt.dataprotection.operations.BackupVaultOperationResultsOperations :ivar data_protection: DataProtectionOperations operations :vartype data_protection: azure.mgmt.dataprotection.operations.DataProtectionOperations :ivar data_protection_operations: DataProtectionOperationsOperations operations - :vartype data_protection_operations: azure.mgmt.dataprotection.operations.DataProtectionOperationsOperations + :vartype data_protection_operations: + azure.mgmt.dataprotection.operations.DataProtectionOperationsOperations :ivar backup_policies: BackupPoliciesOperations operations :vartype backup_policies: azure.mgmt.dataprotection.operations.BackupPoliciesOperations :ivar backup_instances: BackupInstancesOperations operations @@ -60,85 +49,82 @@ class DataProtectionClient(object): :ivar jobs: JobsOperations operations :vartype jobs: azure.mgmt.dataprotection.operations.JobsOperations :ivar restorable_time_ranges: RestorableTimeRangesOperations operations - :vartype restorable_time_ranges: azure.mgmt.dataprotection.operations.RestorableTimeRangesOperations + :vartype restorable_time_ranges: + azure.mgmt.dataprotection.operations.RestorableTimeRangesOperations :ivar export_jobs: ExportJobsOperations operations :vartype export_jobs: azure.mgmt.dataprotection.operations.ExportJobsOperations :ivar export_jobs_operation_result: ExportJobsOperationResultOperations operations - :vartype export_jobs_operation_result: azure.mgmt.dataprotection.operations.ExportJobsOperationResultOperations + :vartype export_jobs_operation_result: + azure.mgmt.dataprotection.operations.ExportJobsOperationResultOperations :ivar resource_guards: ResourceGuardsOperations operations :vartype resource_guards: azure.mgmt.dataprotection.operations.ResourceGuardsOperations :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 = DataProtectionClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataProtectionClientConfiguration(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.backup_vaults = BackupVaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_result = OperationResultOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_status = OperationStatusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_vault_operation_results = BackupVaultOperationResultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.data_protection = DataProtectionOperations( - self._client, self._config, self._serialize, self._deserialize) - self.data_protection_operations = DataProtectionOperationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_policies = BackupPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_instances = BackupInstancesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_points = RecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.restorable_time_ranges = RestorableTimeRangesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.export_jobs = ExportJobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.export_jobs_operation_result = ExportJobsOperationResultOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resource_guards = ResourceGuardsOperations( - 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.backup_vaults = BackupVaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_result = OperationResultOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_vault_operation_results = BackupVaultOperationResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_protection = DataProtectionOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_protection_operations = DataProtectionOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_instances = BackupInstancesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.restorable_time_ranges = RestorableTimeRangesOperations(self._client, self._config, self._serialize, self._deserialize) + self.export_jobs = ExportJobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.export_jobs_operation_result = ExportJobsOperationResultOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_guards = ResourceGuardsOperations(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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_metadata.json b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_metadata.json index 8360a7bf7cd9..1d0a7ea98b1f 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_metadata.json +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_metadata.json @@ -5,13 +5,13 @@ "name": "DataProtectionClient", "filename": "_data_protection_client", "description": "Open API 2.0 Specs for Azure Data Protection service.", - "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\": [\"DataProtectionClientConfiguration\"]}}, \"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\": [\"DataProtectionClientConfiguration\"]}}, \"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\": [\"DataProtectionClientConfiguration\"]}}, \"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\": [\"DataProtectionClientConfiguration\"]}}, \"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": { "backup_vaults": "BackupVaultsOperations", diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_patch.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_vendor.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/_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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/__init__.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/__init__.py index d1235b93a84d..f32d64c4c49a 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/__init__.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/__init__.py @@ -8,3 +8,8 @@ from ._data_protection_client import DataProtectionClient __all__ = ['DataProtectionClient'] + +# `._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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_configuration.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_configuration.py index 9fcfed8d9fab..8ed88b635206 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_configuration.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/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,11 +37,11 @@ def __init__( subscription_id: str, **kwargs: Any ) -> None: + super(DataProtectionClientConfiguration, 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(DataProtectionClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id @@ -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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_data_protection_client.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_data_protection_client.py index f4ae7f1b520c..f27fc0534c10 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_data_protection_client.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_data_protection_client.py @@ -6,35 +6,22 @@ # 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 DataProtectionClientConfiguration +from .operations import BackupInstancesOperations, BackupPoliciesOperations, BackupVaultOperationResultsOperations, BackupVaultsOperations, DataProtectionOperations, DataProtectionOperationsOperations, ExportJobsOperationResultOperations, ExportJobsOperations, JobsOperations, OperationResultOperations, OperationStatusOperations, RecoveryPointsOperations, ResourceGuardsOperations, RestorableTimeRangesOperations + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import DataProtectionClientConfiguration -from .operations import BackupVaultsOperations -from .operations import OperationResultOperations -from .operations import OperationStatusOperations -from .operations import BackupVaultOperationResultsOperations -from .operations import DataProtectionOperations -from .operations import DataProtectionOperationsOperations -from .operations import BackupPoliciesOperations -from .operations import BackupInstancesOperations -from .operations import RecoveryPointsOperations -from .operations import JobsOperations -from .operations import RestorableTimeRangesOperations -from .operations import ExportJobsOperations -from .operations import ExportJobsOperationResultOperations -from .operations import ResourceGuardsOperations -from .. import models - - -class DataProtectionClient(object): +class DataProtectionClient: """Open API 2.0 Specs for Azure Data Protection service. :ivar backup_vaults: BackupVaultsOperations operations @@ -44,11 +31,13 @@ class DataProtectionClient(object): :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.dataprotection.aio.operations.OperationStatusOperations :ivar backup_vault_operation_results: BackupVaultOperationResultsOperations operations - :vartype backup_vault_operation_results: azure.mgmt.dataprotection.aio.operations.BackupVaultOperationResultsOperations + :vartype backup_vault_operation_results: + azure.mgmt.dataprotection.aio.operations.BackupVaultOperationResultsOperations :ivar data_protection: DataProtectionOperations operations :vartype data_protection: azure.mgmt.dataprotection.aio.operations.DataProtectionOperations :ivar data_protection_operations: DataProtectionOperationsOperations operations - :vartype data_protection_operations: azure.mgmt.dataprotection.aio.operations.DataProtectionOperationsOperations + :vartype data_protection_operations: + azure.mgmt.dataprotection.aio.operations.DataProtectionOperationsOperations :ivar backup_policies: BackupPoliciesOperations operations :vartype backup_policies: azure.mgmt.dataprotection.aio.operations.BackupPoliciesOperations :ivar backup_instances: BackupInstancesOperations operations @@ -58,83 +47,80 @@ class DataProtectionClient(object): :ivar jobs: JobsOperations operations :vartype jobs: azure.mgmt.dataprotection.aio.operations.JobsOperations :ivar restorable_time_ranges: RestorableTimeRangesOperations operations - :vartype restorable_time_ranges: azure.mgmt.dataprotection.aio.operations.RestorableTimeRangesOperations + :vartype restorable_time_ranges: + azure.mgmt.dataprotection.aio.operations.RestorableTimeRangesOperations :ivar export_jobs: ExportJobsOperations operations :vartype export_jobs: azure.mgmt.dataprotection.aio.operations.ExportJobsOperations :ivar export_jobs_operation_result: ExportJobsOperationResultOperations operations - :vartype export_jobs_operation_result: azure.mgmt.dataprotection.aio.operations.ExportJobsOperationResultOperations + :vartype export_jobs_operation_result: + azure.mgmt.dataprotection.aio.operations.ExportJobsOperationResultOperations :ivar resource_guards: ResourceGuardsOperations operations :vartype resource_guards: azure.mgmt.dataprotection.aio.operations.ResourceGuardsOperations :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 = DataProtectionClientConfiguration(credential, subscription_id, **kwargs) + self._config = DataProtectionClientConfiguration(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.backup_vaults = BackupVaultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_result = OperationResultOperations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status = OperationStatusOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_vault_operation_results = BackupVaultOperationResultsOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_protection = DataProtectionOperations(self._client, self._config, self._serialize, self._deserialize) + self.data_protection_operations = DataProtectionOperationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_policies = BackupPoliciesOperations(self._client, self._config, self._serialize, self._deserialize) + self.backup_instances = BackupInstancesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.restorable_time_ranges = RestorableTimeRangesOperations(self._client, self._config, self._serialize, self._deserialize) + self.export_jobs = ExportJobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.export_jobs_operation_result = ExportJobsOperationResultOperations(self._client, self._config, self._serialize, self._deserialize) + self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize) + - self.backup_vaults = BackupVaultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_result = OperationResultOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operation_status = OperationStatusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_vault_operation_results = BackupVaultOperationResultsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.data_protection = DataProtectionOperations( - self._client, self._config, self._serialize, self._deserialize) - self.data_protection_operations = DataProtectionOperationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_policies = BackupPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.backup_instances = BackupInstancesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.recovery_points = RecoveryPointsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.restorable_time_ranges = RestorableTimeRangesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.export_jobs = ExportJobsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.export_jobs_operation_result = ExportJobsOperationResultOperations( - self._client, self._config, self._serialize, self._deserialize) - self.resource_guards = ResourceGuardsOperations( - 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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_patch.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_instances_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_instances_operations.py index ff56d2bc2e8d..1c356a9cc847 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_instances_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_instances_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._backup_instances_operations import build_adhoc_backup_request_initial, build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_request, build_trigger_rehydrate_request_initial, build_trigger_restore_request_initial, build_validate_for_backup_request_initial, build_validate_for_restore_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( self, vault_name: str, @@ -56,8 +62,10 @@ def list( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupInstanceResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupInstanceResourceList] + :return: An iterator like instance of either BackupInstanceResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupInstanceResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupInstanceResourceList"] @@ -65,36 +73,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + 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('BackupInstanceResourceList', pipeline_response) + deserialized = self._deserialize("BackupInstanceResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -112,11 +117,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.DataProtection/backupVaults/{vaultName}/backupInstances'} # type: ignore + @distributed_trace_async async def get( self, vault_name: str, @@ -142,28 +149,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_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 @@ -177,8 +174,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + async def _create_or_update_initial( self, vault_name: str, @@ -192,33 +191,23 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'BackupInstanceResource') + + request = build_create_or_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_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(parameters, 'BackupInstanceResource') - 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 @@ -236,8 +225,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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, vault_name: str, @@ -258,15 +250,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.dataprotection.models.BackupInstanceResource :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. - :return: An instance of AsyncLROPoller that returns either BackupInstanceResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupInstanceResource] - :raises ~azure.core.exceptions.HttpResponseError: + :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 BackupInstanceResource or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupInstanceResource] + :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.BackupInstanceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -279,28 +276,21 @@ async def begin_create_or_update( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('BackupInstanceResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -312,6 +302,7 @@ 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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore async def _delete_initial( @@ -326,28 +317,18 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + template_url=self._delete_initial.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 @@ -360,12 +341,15 @@ async def _delete_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + + @distributed_trace_async async def begin_delete( self, vault_name: str, @@ -383,15 +367,17 @@ async def begin_delete( :type backup_instance_name: str :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 None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -406,22 +392,14 @@ async def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -433,6 +411,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore async def _adhoc_backup_initial( @@ -448,33 +427,23 @@ async def _adhoc_backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._adhoc_backup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'TriggerBackupRequest') - # 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_adhoc_backup_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._adhoc_backup_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(parameters, 'TriggerBackupRequest') - 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 @@ -482,8 +451,8 @@ async def _adhoc_backup_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -491,13 +460,17 @@ async def _adhoc_backup_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _adhoc_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup'} # type: ignore + + @distributed_trace_async async def begin_adhoc_backup( self, vault_name: str, @@ -518,15 +491,20 @@ async def begin_adhoc_backup( :type parameters: ~azure.mgmt.dataprotection.models.TriggerBackupRequest :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. - :return: An instance of AsyncLROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -539,28 +517,21 @@ async def begin_adhoc_backup( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -572,6 +543,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_adhoc_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup'} # type: ignore async def _validate_for_backup_initial( @@ -586,32 +558,22 @@ async def _validate_for_backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._validate_for_backup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + 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(parameters, 'ValidateForBackupRequest') + + request = build_validate_for_backup_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._validate_for_backup_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(parameters, 'ValidateForBackupRequest') - 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 @@ -619,8 +581,8 @@ async def _validate_for_backup_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -628,13 +590,17 @@ async def _validate_for_backup_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _validate_for_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup'} # type: ignore + + @distributed_trace_async async def begin_validate_for_backup( self, vault_name: str, @@ -652,15 +618,20 @@ async def begin_validate_for_backup( :type parameters: ~azure.mgmt.dataprotection.models.ValidateForBackupRequest :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. - :return: An instance of AsyncLROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -672,27 +643,21 @@ async def begin_validate_for_backup( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -704,6 +669,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_for_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup'} # type: ignore async def _trigger_rehydrate_initial( @@ -719,33 +685,23 @@ async def _trigger_rehydrate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._trigger_rehydrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupRehydrationRequest') + + request = build_trigger_rehydrate_request_initial( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + vault_name=vault_name, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._trigger_rehydrate_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(parameters, 'AzureBackupRehydrationRequest') - 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 @@ -758,12 +714,15 @@ async def _trigger_rehydrate_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _trigger_rehydrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate'} # type: ignore + + @distributed_trace_async async def begin_trigger_rehydrate( self, resource_group_name: str, @@ -784,15 +743,18 @@ async def begin_trigger_rehydrate( :type parameters: ~azure.mgmt.dataprotection.models.AzureBackupRehydrationRequest :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 None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :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[None] lro_delay = kwargs.pop( 'polling_interval', @@ -805,25 +767,18 @@ async def begin_trigger_rehydrate( vault_name=vault_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -835,6 +790,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_rehydrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate'} # type: ignore async def _trigger_restore_initial( @@ -850,33 +806,23 @@ async def _trigger_restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._trigger_restore_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupRestoreRequest') + + request = build_trigger_restore_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._trigger_restore_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(parameters, 'AzureBackupRestoreRequest') - 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 @@ -884,8 +830,8 @@ async def _trigger_restore_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -893,13 +839,17 @@ async def _trigger_restore_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _trigger_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore'} # type: ignore + + @distributed_trace_async async def begin_trigger_restore( self, vault_name: str, @@ -920,15 +870,20 @@ async def begin_trigger_restore( :type parameters: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest :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. - :return: An instance of AsyncLROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -941,28 +896,21 @@ async def begin_trigger_restore( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -974,6 +922,7 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore'} # type: ignore async def _validate_for_restore_initial( @@ -989,33 +938,23 @@ async def _validate_for_restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._validate_for_restore_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'ValidateRestoreRequestObject') - # 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_validate_for_restore_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._validate_for_restore_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(parameters, 'ValidateRestoreRequestObject') - 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 @@ -1023,8 +962,8 @@ async def _validate_for_restore_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -1032,13 +971,17 @@ async def _validate_for_restore_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _validate_for_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore'} # type: ignore + + @distributed_trace_async async def begin_validate_for_restore( self, vault_name: str, @@ -1059,15 +1002,20 @@ async def begin_validate_for_restore( :type parameters: ~azure.mgmt.dataprotection.models.ValidateRestoreRequestObject :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. - :return: An instance of AsyncLROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1080,28 +1028,21 @@ async def begin_validate_for_restore( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -1113,4 +1054,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_for_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore'} # type: ignore diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_policies_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_policies_operations.py index 3b220c4d6253..af4bd91353bb 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_policies_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_policies_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._backup_policies_operations import build_create_or_update_request, build_delete_request, 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, vault_name: str, @@ -54,8 +60,10 @@ def list( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BaseBackupPolicyResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BaseBackupPolicyResourceList] + :return: An iterator like instance of either BaseBackupPolicyResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BaseBackupPolicyResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BaseBackupPolicyResourceList"] @@ -63,36 +71,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + 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('BaseBackupPolicyResourceList', pipeline_response) + deserialized = self._deserialize("BaseBackupPolicyResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,11 +115,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.DataProtection/backupVaults/{vaultName}/backupPolicies'} # type: ignore + @distributed_trace_async async def get( self, vault_name: str, @@ -142,28 +149,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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 @@ -177,8 +174,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + + @distributed_trace_async async def create_or_update( self, vault_name: str, @@ -209,33 +209,23 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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(parameters, 'BaseBackupPolicyResource') - # 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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(parameters, 'BaseBackupPolicyResource') - 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 @@ -249,8 +239,11 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + + @distributed_trace_async async def delete( self, vault_name: str, @@ -278,28 +271,18 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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 @@ -311,3 +294,4 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vault_operation_results_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vault_operation_results_operations.py index 22c61b0cc12b..a14170db0006 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vault_operation_results_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vault_operation_results_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._backup_vault_operation_results_operations import build_get_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, vault_name: str, @@ -65,28 +70,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + + request = build_get_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + operation_id=operation_id, + 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 @@ -94,8 +89,8 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('BackupVaultResource', pipeline_response) @@ -103,9 +98,12 @@ async def get( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vaults_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vaults_operations.py index d0bc61275c7b..6780521c34d1 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_vaults_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_backup_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._backup_vaults_operations import build_check_name_availability_request, build_create_or_update_request_initial, build_delete_request, build_get_in_resource_group_request, build_get_in_subscription_request, build_get_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 get_in_subscription( self, **kwargs: Any @@ -50,8 +56,10 @@ def get_in_subscription( """Returns resource collection belonging to a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupVaultResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] + :return: An iterator like instance of either BackupVaultResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupVaultResourceList"] @@ -59,34 +67,29 @@ def get_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_in_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_in_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.get_in_subscription.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_get_in_subscription_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('BackupVaultResourceList', pipeline_response) + deserialized = self._deserialize("BackupVaultResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +107,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults'} # type: ignore + @distributed_trace def get_in_resource_group( self, resource_group_name: str, @@ -119,8 +124,10 @@ def get_in_resource_group( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupVaultResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] + :return: An iterator like instance of either BackupVaultResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupVaultResourceList"] @@ -128,35 +135,31 @@ def get_in_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_in_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_get_in_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.get_in_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_get_in_resource_group_request( + resource_group_name=resource_group_name, + 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('BackupVaultResourceList', pipeline_response) + deserialized = self._deserialize("BackupVaultResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -174,11 +177,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults'} # type: ignore + @distributed_trace_async async def get( self, vault_name: str, @@ -201,27 +206,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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 @@ -235,8 +230,10 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + async def _create_or_update_initial( self, vault_name: str, @@ -249,32 +246,22 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + 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(parameters, 'BackupVaultResource') + + request = build_create_or_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'BackupVaultResource') - 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 @@ -292,8 +279,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.DataProtection/backupVaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_create_or_update( self, vault_name: str, @@ -311,15 +301,20 @@ async def begin_create_or_update( :type parameters: ~azure.mgmt.dataprotection.models.BackupVaultResource :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. - :return: An instance of AsyncLROPoller that returns either BackupVaultResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] - :raises ~azure.core.exceptions.HttpResponseError: + :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 BackupVaultResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] + :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.BackupVaultResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -331,27 +326,21 @@ async def begin_create_or_update( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('BackupVaultResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -363,8 +352,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.DataProtection/backupVaults/{vaultName}'} # type: ignore + @distributed_trace_async async def delete( self, vault_name: str, @@ -387,27 +378,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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 @@ -420,6 +401,7 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + async def _update_initial( self, vault_name: str, @@ -432,32 +414,22 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PatchResourceRequestInput') - # 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_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'PatchResourceRequestInput') - 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 @@ -473,8 +445,11 @@ async def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + + @distributed_trace_async async def begin_update( self, vault_name: str, @@ -493,15 +468,20 @@ async def begin_update( :type parameters: ~azure.mgmt.dataprotection.models.PatchResourceRequestInput :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. - :return: An instance of AsyncLROPoller that returns either BackupVaultResource or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] - :raises ~azure.core.exceptions.HttpResponseError: + :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 BackupVaultResource or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] + :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.BackupVaultResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -513,27 +493,21 @@ async def begin_update( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('BackupVaultResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -545,8 +519,10 @@ 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.DataProtection/backupVaults/{vaultName}'} # type: ignore + @distributed_trace_async async def check_name_availability( self, resource_group_name: str, @@ -574,32 +550,22 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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(parameters, 'CheckNameAvailabilityRequest') - # 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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'CheckNameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -613,4 +579,6 @@ async def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations.py index 4f4c02a41fbf..d03df46b8d04 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_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._data_protection_operations import build_check_feature_support_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_feature_support( self, location: str, @@ -64,31 +69,21 @@ async def check_feature_support( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_feature_support.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - 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(parameters, 'FeatureValidationRequestBase') - # 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_feature_support_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_feature_support.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(parameters, 'FeatureValidationRequestBase') - 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 @@ -102,4 +97,6 @@ async def check_feature_support( return cls(pipeline_response, deserialized, {}) return deserialized + check_feature_support.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations_operations.py index c214a878307e..9ddbf25fddcb 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_operations_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_data_protection_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._data_protection_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.dataprotection.models.ClientDiscoveryResponse] + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.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-07-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/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operation_result_operations.py index 5229fa069641..ce0e9bf3fee3 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operation_result_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operation_result_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._export_jobs_operation_result_operations import build_get_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, @@ -67,28 +72,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - '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_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.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 @@ -104,4 +99,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/operations/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operations.py index 9e54054ad0ea..82528ce4b17c 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_export_jobs_operations.py @@ -5,18 +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, Callable, Dict, Generic, Optional, TypeVar, Union 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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +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._export_jobs_operations import build_trigger_request_initial T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -53,27 +57,17 @@ async def _trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._trigger_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_trigger_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self._trigger_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -85,12 +79,15 @@ async def _trigger_initial( if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs'} # type: ignore + + @distributed_trace_async async def begin_trigger( self, resource_group_name: str, @@ -105,15 +102,17 @@ async def begin_trigger( :type vault_name: str :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 None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -127,21 +126,14 @@ async def begin_trigger( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - 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, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -153,4 +145,5 @@ def get_long_running_output(pipeline_response): ) else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs'} # type: ignore diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_jobs_operations.py index 8cce9e55bcfc..dad10791e267 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_jobs_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_jobs_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._jobs_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, @@ -54,8 +60,10 @@ def list( :param vault_name: The name of the backup 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 AzureBackupJobResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.AzureBackupJobResourceList] + :return: An iterator like instance of either AzureBackupJobResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.AzureBackupJobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBackupJobResourceList"] @@ -63,36 +71,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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('AzureBackupJobResourceList', pipeline_response) + deserialized = self._deserialize("AzureBackupJobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -110,11 +115,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.DataProtection/backupVaults/{vaultName}/backupJobs'} # type: ignore + @distributed_trace_async async def get( self, resource_group_name: str, @@ -141,28 +148,18 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'jobId': self._serialize.url("job_id", job_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_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + job_id=job_id, + 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 @@ -176,4 +173,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_result_operations.py index 4793f47b4c57..baf20ef7e0d7 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_result_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_result_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._operation_result_operations import build_get_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, operation_id: str, @@ -64,27 +69,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'operationId': self._serialize.url("operation_id", operation_id, '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') + + request = build_get_request( + subscription_id=self._config.subscription_id, + operation_id=operation_id, + location=location, + 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 @@ -92,8 +87,8 @@ async def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -101,9 +96,12 @@ async def get( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_status_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_status_operations.py index cd20c682149d..945e5e3a0bd2 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_status_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_operation_status_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._operation_status_operations import build_get_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, location: str, @@ -64,27 +69,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'location': self._serialize.url("location", location, '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_request( + subscription_id=self._config.subscription_id, + location=location, + operation_id=operation_id, + 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 @@ -98,4 +93,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_recovery_points_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_recovery_points_operations.py index efb6fbeb9455..d0cc3c3ac633 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_recovery_points_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_recovery_points_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._recovery_points_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, vault_name: str, @@ -63,8 +69,10 @@ def list( :param skip_token: skipToken Filter. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AzureBackupRecoveryPointResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResourceList] + :return: An iterator like instance of either AzureBackupRecoveryPointResourceList or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBackupRecoveryPointResourceList"] @@ -72,41 +80,39 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + filter=filter, + skip_token=skip_token, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + filter=filter, + skip_token=skip_token, + 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('AzureBackupRecoveryPointResourceList', pipeline_response) + deserialized = self._deserialize("AzureBackupRecoveryPointResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -124,11 +130,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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints'} # type: ignore + @distributed_trace_async async def get( self, vault_name: str, @@ -157,29 +165,19 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str'), - 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + recovery_point_id=recovery_point_id, + 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 @@ -193,4 +191,6 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_resource_guards_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_resource_guards_operations.py index 0f9b1f08b6b6..0f4b03da5759 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_resource_guards_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_resource_guards_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._resource_guards_operations import build_delete_request, build_get_backup_security_pin_requests_objects_request, build_get_default_backup_security_pin_requests_object_request, build_get_default_delete_protected_item_requests_object_request, build_get_default_delete_resource_guard_proxy_requests_object_request, build_get_default_disable_soft_delete_requests_object_request, build_get_default_update_protected_item_requests_object_request, build_get_default_update_protection_policy_requests_object_request, build_get_delete_protected_item_requests_objects_request, build_get_delete_resource_guard_proxy_requests_objects_request, build_get_disable_soft_delete_requests_objects_request, build_get_request, build_get_resources_in_resource_group_request, build_get_resources_in_subscription_request, build_get_update_protected_item_requests_objects_request, build_get_update_protection_policy_requests_objects_request, build_patch_request, build_put_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 get_resources_in_subscription( self, **kwargs: Any @@ -50,8 +56,10 @@ def get_resources_in_subscription( Returns ResourceGuards collection belonging to a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceGuardResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] + :return: An iterator like instance of either ResourceGuardResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceGuardResourceList"] @@ -59,34 +67,29 @@ def get_resources_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_resources_in_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_resources_in_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.get_resources_in_subscription.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_get_resources_in_subscription_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('ResourceGuardResourceList', pipeline_response) + deserialized = self._deserialize("ResourceGuardResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -104,11 +107,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_resources_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/resourceGuards'} # type: ignore + @distributed_trace def get_resources_in_resource_group( self, resource_group_name: str, @@ -121,8 +126,10 @@ def get_resources_in_resource_group( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceGuardResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] + :return: An iterator like instance of either ResourceGuardResourceList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceGuardResourceList"] @@ -130,35 +137,31 @@ def get_resources_in_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_resources_in_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_get_resources_in_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.get_resources_in_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_get_resources_in_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('ResourceGuardResourceList', pipeline_response) + deserialized = self._deserialize("ResourceGuardResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -176,11 +179,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_resources_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards'} # type: ignore + @distributed_trace_async async def put( self, resource_group_name: str, @@ -208,32 +213,22 @@ async def put( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.put.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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(parameters, 'ResourceGuardResource') - # 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_put_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + content_type=content_type, + json=_json, + template_url=self.put.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(parameters, 'ResourceGuardResource') - 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 @@ -247,8 +242,11 @@ async def put( return cls(pipeline_response, deserialized, {}) return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace_async async def get( self, resource_group_name: str, @@ -273,27 +271,17 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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 @@ -307,8 +295,11 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace_async async def delete( self, resource_group_name: str, @@ -333,27 +324,17 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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 @@ -366,6 +347,8 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace_async async def patch( self, resource_group_name: str, @@ -373,7 +356,8 @@ async def patch( parameters: "_models.PatchResourceRequestInput", **kwargs: Any ) -> "_models.ResourceGuardResource": - """Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. + """Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for + a resource. Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. @@ -394,32 +378,22 @@ async def patch( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.patch.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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(parameters, 'PatchResourceRequestInput') - # 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_patch_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + content_type=content_type, + json=_json, + template_url=self.patch.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(parameters, 'PatchResourceRequestInput') - 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 @@ -433,15 +407,19 @@ async def patch( return cls(pipeline_response, deserialized, {}) return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace def get_disable_soft_delete_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -452,7 +430,8 @@ def get_disable_soft_delete_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -460,36 +439,33 @@ def get_disable_soft_delete_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_disable_soft_delete_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_disable_soft_delete_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_disable_soft_delete_requests_objects.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_get_disable_soft_delete_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -507,18 +483,21 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_disable_soft_delete_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests'} # type: ignore + @distributed_trace def get_delete_resource_guard_proxy_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -529,7 +508,8 @@ def get_delete_resource_guard_proxy_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -537,36 +517,33 @@ def get_delete_resource_guard_proxy_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_delete_resource_guard_proxy_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_delete_resource_guard_proxy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_delete_resource_guard_proxy_requests_objects.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_get_delete_resource_guard_proxy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -584,18 +561,21 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_delete_resource_guard_proxy_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests'} # type: ignore + @distributed_trace def get_backup_security_pin_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -606,7 +586,8 @@ def get_backup_security_pin_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -614,36 +595,33 @@ def get_backup_security_pin_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_backup_security_pin_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_backup_security_pin_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_backup_security_pin_requests_objects.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_get_backup_security_pin_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -661,18 +639,21 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_backup_security_pin_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests'} # type: ignore + @distributed_trace def get_delete_protected_item_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -683,7 +664,8 @@ def get_delete_protected_item_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -691,36 +673,33 @@ def get_delete_protected_item_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_delete_protected_item_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_delete_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_delete_protected_item_requests_objects.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_get_delete_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -738,18 +717,21 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_delete_protected_item_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests'} # type: ignore + @distributed_trace def get_update_protection_policy_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -760,7 +742,8 @@ def get_update_protection_policy_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -768,36 +751,33 @@ def get_update_protection_policy_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_update_protection_policy_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_update_protection_policy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_update_protection_policy_requests_objects.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_get_update_protection_policy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -815,18 +795,21 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_update_protection_policy_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests'} # type: ignore + @distributed_trace def get_update_protected_item_requests_objects( self, resource_group_name: str, resource_guards_name: str, **kwargs: Any ) -> AsyncIterable["_models.DppBaseResourceList"]: - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -837,7 +820,8 @@ def get_update_protected_item_requests_objects( :type resource_guards_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DppBaseResourceList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dataprotection.models.DppBaseResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DppBaseResourceList"] @@ -845,36 +829,33 @@ def get_update_protected_item_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_update_protected_item_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_update_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_update_protected_item_requests_objects.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_get_update_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -892,11 +873,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged( get_next, extract_data ) get_update_protected_item_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests'} # type: ignore + @distributed_trace_async async def get_default_disable_soft_delete_requests_object( self, resource_group_name: str, @@ -904,7 +887,8 @@ async def get_default_disable_soft_delete_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -925,28 +909,18 @@ async def get_default_disable_soft_delete_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_disable_soft_delete_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_disable_soft_delete_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_disable_soft_delete_requests_object.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 @@ -960,8 +934,11 @@ async def get_default_disable_soft_delete_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_disable_soft_delete_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}'} # type: ignore + + @distributed_trace_async async def get_default_delete_resource_guard_proxy_requests_object( self, resource_group_name: str, @@ -969,7 +946,8 @@ async def get_default_delete_resource_guard_proxy_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -990,28 +968,18 @@ async def get_default_delete_resource_guard_proxy_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_delete_resource_guard_proxy_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_delete_resource_guard_proxy_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_delete_resource_guard_proxy_requests_object.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 @@ -1025,8 +993,11 @@ async def get_default_delete_resource_guard_proxy_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_delete_resource_guard_proxy_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}'} # type: ignore + + @distributed_trace_async async def get_default_backup_security_pin_requests_object( self, resource_group_name: str, @@ -1034,7 +1005,8 @@ async def get_default_backup_security_pin_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1055,28 +1027,18 @@ async def get_default_backup_security_pin_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_backup_security_pin_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_backup_security_pin_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_backup_security_pin_requests_object.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 @@ -1090,8 +1052,11 @@ async def get_default_backup_security_pin_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_backup_security_pin_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}'} # type: ignore + + @distributed_trace_async async def get_default_delete_protected_item_requests_object( self, resource_group_name: str, @@ -1099,7 +1064,8 @@ async def get_default_delete_protected_item_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1120,28 +1086,18 @@ async def get_default_delete_protected_item_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_delete_protected_item_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_delete_protected_item_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_delete_protected_item_requests_object.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 @@ -1155,8 +1111,11 @@ async def get_default_delete_protected_item_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_delete_protected_item_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}'} # type: ignore + + @distributed_trace_async async def get_default_update_protection_policy_requests_object( self, resource_group_name: str, @@ -1164,7 +1123,8 @@ async def get_default_update_protection_policy_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1185,28 +1145,18 @@ async def get_default_update_protection_policy_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_update_protection_policy_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_update_protection_policy_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_update_protection_policy_requests_object.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 @@ -1220,8 +1170,11 @@ async def get_default_update_protection_policy_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_update_protection_policy_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}'} # type: ignore + + @distributed_trace_async async def get_default_update_protected_item_requests_object( self, resource_group_name: str, @@ -1229,7 +1182,8 @@ async def get_default_update_protected_item_requests_object( request_name: str, **kwargs: Any ) -> "_models.DppBaseResource": - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1250,28 +1204,18 @@ async def get_default_update_protected_item_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_update_protected_item_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_update_protected_item_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_update_protected_item_requests_object.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 @@ -1285,4 +1229,6 @@ async def get_default_update_protected_item_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_update_protected_item_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_restorable_time_ranges_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_restorable_time_ranges_operations.py index 73ec6d0bed24..14fc84fd05fa 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_restorable_time_ranges_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/aio/operations/_restorable_time_ranges_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._restorable_time_ranges_operations import build_find_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 find( self, vault_name: str, @@ -68,33 +73,23 @@ async def find( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.find.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupFindRestorableTimeRangesRequest') - # 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_find_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self.find.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(parameters, 'AzureBackupFindRestorableTimeRangesRequest') - 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 @@ -108,4 +103,6 @@ async def find( return cls(pipeline_response, deserialized, {}) return deserialized + find.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py index 926803c67b2c..677f716b8cf2 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_client_enums.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_data_protection_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 AbsoluteMarker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AbsoluteMarker(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ALL_BACKUP = "AllBackup" FIRST_OF_DAY = "FirstOfDay" @@ -34,7 +19,7 @@ class AbsoluteMarker(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FIRST_OF_WEEK = "FirstOfWeek" FIRST_OF_YEAR = "FirstOfYear" -class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The type of identity that created the resource. """ @@ -43,7 +28,7 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" -class CurrentProtectionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CurrentProtectionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the current protection state of the resource """ @@ -60,7 +45,7 @@ class CurrentProtectionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum) SOFT_DELETED = "SoftDeleted" UPDATING_PROTECTION = "UpdatingProtection" -class DataStoreTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DataStoreTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """type of datastore; Operational/Vault/Archive """ @@ -68,7 +53,7 @@ class DataStoreTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): VAULT_STORE = "VaultStore" ARCHIVE_STORE = "ArchiveStore" -class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" MONDAY = "Monday" @@ -78,7 +63,7 @@ class DayOfWeek(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): TUESDAY = "Tuesday" WEDNESDAY = "Wednesday" -class FeatureSupportStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class FeatureSupportStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """feature support status """ @@ -89,14 +74,14 @@ class FeatureSupportStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PUBLIC_PREVIEW = "PublicPreview" GENERALLY_AVAILABLE = "GenerallyAvailable" -class FeatureType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class FeatureType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """backup support feature type. """ INVALID = "Invalid" DATA_SOURCE_TYPE = "DataSourceType" -class Month(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Month(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): APRIL = "April" AUGUST = "August" @@ -111,7 +96,7 @@ class Month(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OCTOBER = "October" SEPTEMBER = "September" -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the BackupVault resource """ @@ -121,13 +106,13 @@ class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UNKNOWN = "Unknown" UPDATING = "Updating" -class RecoveryOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RecoveryOption(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Recovery Option """ FAIL_IF_EXISTS = "FailIfExists" -class RehydrationPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RehydrationPriority(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Priority to be used for rehydration. Values High or Standard """ @@ -135,7 +120,7 @@ class RehydrationPriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): HIGH = "High" STANDARD = "Standard" -class RehydrationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RehydrationStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" COMPLETED = "COMPLETED" @@ -143,7 +128,7 @@ class RehydrationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DELETED = "DELETED" FAILED = "FAILED" -class ResourceMoveState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class ResourceMoveState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Resource move state for backup vault """ @@ -158,7 +143,7 @@ class ResourceMoveState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PARTIAL_SUCCESS = "PartialSuccess" MOVE_SUCCEEDED = "MoveSucceeded" -class RestoreSourceDataStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RestoreSourceDataStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type of the source data store. """ @@ -166,7 +151,7 @@ class RestoreSourceDataStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, E VAULT_STORE = "VaultStore" ARCHIVE_STORE = "ArchiveStore" -class RestoreTargetLocationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class RestoreTargetLocationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Denotes the target location where the data will be restored, string value for the enum {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType} @@ -176,14 +161,14 @@ class RestoreTargetLocationType(with_metaclass(_CaseInsensitiveEnumMeta, str, En AZURE_BLOBS = "AzureBlobs" AZURE_FILES = "AzureFiles" -class SecretStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SecretStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type of secret store """ INVALID = "Invalid" AZURE_KEY_VAULT = "AzureKeyVault" -class SourceDataStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class SourceDataStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type of the source data store. """ @@ -191,7 +176,7 @@ class SourceDataStoreType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SNAPSHOT_STORE = "SnapshotStore" VAULT_STORE = "VaultStore" -class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Status(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Specifies the protection status of the resource """ @@ -202,7 +187,7 @@ class Status(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SOFT_DELETED = "SoftDeleted" SOFT_DELETING = "SoftDeleting" -class StorageSettingStoreTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class StorageSettingStoreTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type of the datastore. """ @@ -210,14 +195,14 @@ class StorageSettingStoreTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enu SNAPSHOT_STORE = "SnapshotStore" VAULT_STORE = "VaultStore" -class StorageSettingTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class StorageSettingTypes(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type. """ GEO_REDUNDANT = "GeoRedundant" LOCALLY_REDUNDANT = "LocallyRedundant" -class WeekNumber(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class WeekNumber(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FIRST = "First" FOURTH = "Fourth" diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py index 459c310a482e..126298e22914 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models.py @@ -17,11 +17,11 @@ class DeleteOption(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param duration: Required. Duration of deletion after given timespan. - :type duration: str - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar duration: Required. Duration of deletion after given timespan. + :vartype duration: str + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -42,6 +42,10 @@ def __init__( self, **kwargs ): + """ + :keyword duration: Required. Duration of deletion after given timespan. + :paramtype duration: str + """ super(DeleteOption, self).__init__(**kwargs) self.duration = kwargs['duration'] self.object_type = None # type: Optional[str] @@ -52,11 +56,11 @@ class AbsoluteDeleteOption(DeleteOption): All required parameters must be populated in order to send to Azure. - :param duration: Required. Duration of deletion after given timespan. - :type duration: str - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar duration: Required. Duration of deletion after given timespan. + :vartype duration: str + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -73,6 +77,10 @@ def __init__( self, **kwargs ): + """ + :keyword duration: Required. Duration of deletion after given timespan. + :paramtype duration: str + """ super(AbsoluteDeleteOption, self).__init__(**kwargs) self.object_type = 'AbsoluteDeleteOption' # type: str @@ -82,10 +90,10 @@ class AdHocBackupRuleOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param rule_name: Required. - :type rule_name: str - :param trigger_option: Required. Adhoc backup trigger option. - :type trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + :ivar rule_name: Required. + :vartype rule_name: str + :ivar trigger_option: Required. Adhoc backup trigger option. + :vartype trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption """ _validation = { @@ -102,6 +110,12 @@ def __init__( self, **kwargs ): + """ + :keyword rule_name: Required. + :paramtype rule_name: str + :keyword trigger_option: Required. Adhoc backup trigger option. + :paramtype trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + """ super(AdHocBackupRuleOptions, self).__init__(**kwargs) self.rule_name = kwargs['rule_name'] self.trigger_option = kwargs['trigger_option'] @@ -110,8 +124,8 @@ def __init__( class AdhocBackupTriggerOption(msrest.serialization.Model): """Adhoc backup trigger option. - :param retention_tag_override: - :type retention_tag_override: str + :ivar retention_tag_override: + :vartype retention_tag_override: str """ _attribute_map = { @@ -122,6 +136,10 @@ def __init__( self, **kwargs ): + """ + :keyword retention_tag_override: + :paramtype retention_tag_override: str + """ super(AdhocBackupTriggerOption, self).__init__(**kwargs) self.retention_tag_override = kwargs.get('retention_tag_override', None) @@ -129,8 +147,8 @@ def __init__( class AdhocBasedTaggingCriteria(msrest.serialization.Model): """Adhoc backup tagging criteria. - :param tag_info: Retention tag information. - :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + :ivar tag_info: Retention tag information. + :vartype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag """ _attribute_map = { @@ -141,6 +159,10 @@ def __init__( self, **kwargs ): + """ + :keyword tag_info: Retention tag information. + :paramtype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ super(AdhocBasedTaggingCriteria, self).__init__(**kwargs) self.tag_info = kwargs.get('tag_info', None) @@ -153,9 +175,9 @@ class TriggerContext(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -174,6 +196,8 @@ def __init__( self, **kwargs ): + """ + """ super(TriggerContext, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -183,11 +207,11 @@ class AdhocBasedTriggerContext(TriggerContext): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc backup. - :type tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + :vartype object_type: str + :ivar tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc backup. + :vartype tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria """ _validation = { @@ -204,6 +228,11 @@ def __init__( self, **kwargs ): + """ + :keyword tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc + backup. + :paramtype tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + """ super(AdhocBasedTriggerContext, self).__init__(**kwargs) self.object_type = 'AdhocBasedTriggerContext' # type: str self.tagging_criteria = kwargs['tagging_criteria'] @@ -217,9 +246,9 @@ class AuthCredentials(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -238,6 +267,8 @@ def __init__( self, **kwargs ): + """ + """ super(AuthCredentials, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -250,8 +281,8 @@ class AzureBackupRecoveryPoint(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -270,6 +301,8 @@ def __init__( self, **kwargs ): + """ + """ super(AzureBackupRecoveryPoint, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -279,27 +312,27 @@ class AzureBackupDiscreteRecoveryPoint(AzureBackupRecoveryPoint): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param friendly_name: - :type friendly_name: str - :param recovery_point_data_stores_details: - :type recovery_point_data_stores_details: + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar friendly_name: + :vartype friendly_name: str + :ivar recovery_point_data_stores_details: + :vartype recovery_point_data_stores_details: list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] - :param recovery_point_time: Required. - :type recovery_point_time: ~datetime.datetime - :param policy_name: - :type policy_name: str - :param policy_version: - :type policy_version: str - :param recovery_point_id: - :type recovery_point_id: str - :param recovery_point_type: - :type recovery_point_type: str - :param retention_tag_name: - :type retention_tag_name: str - :param retention_tag_version: - :type retention_tag_version: str + :ivar recovery_point_time: Required. + :vartype recovery_point_time: ~datetime.datetime + :ivar policy_name: + :vartype policy_name: str + :ivar policy_version: + :vartype policy_version: str + :ivar recovery_point_id: + :vartype recovery_point_id: str + :ivar recovery_point_type: + :vartype recovery_point_type: str + :ivar retention_tag_name: + :vartype retention_tag_name: str + :ivar retention_tag_version: + :vartype retention_tag_version: str """ _validation = { @@ -324,6 +357,27 @@ def __init__( self, **kwargs ): + """ + :keyword friendly_name: + :paramtype friendly_name: str + :keyword recovery_point_data_stores_details: + :paramtype recovery_point_data_stores_details: + list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] + :keyword recovery_point_time: Required. + :paramtype recovery_point_time: ~datetime.datetime + :keyword policy_name: + :paramtype policy_name: str + :keyword policy_version: + :paramtype policy_version: str + :keyword recovery_point_id: + :paramtype recovery_point_id: str + :keyword recovery_point_type: + :paramtype recovery_point_type: str + :keyword retention_tag_name: + :paramtype retention_tag_name: str + :keyword retention_tag_version: + :paramtype retention_tag_version: str + """ super(AzureBackupDiscreteRecoveryPoint, self).__init__(**kwargs) self.object_type = 'AzureBackupDiscreteRecoveryPoint' # type: str self.friendly_name = kwargs.get('friendly_name', None) @@ -342,14 +396,14 @@ class AzureBackupFindRestorableTimeRangesRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type source_data_store_type: str or + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType - :param start_time: Start time for the List Restore Ranges request. ISO 8601 format. - :type start_time: str - :param end_time: End time for the List Restore Ranges request. ISO 8601 format. - :type end_time: str + :ivar start_time: Start time for the List Restore Ranges request. ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the List Restore Ranges request. ISO 8601 format. + :vartype end_time: str """ _validation = { @@ -366,6 +420,16 @@ def __init__( self, **kwargs ): + """ + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype source_data_store_type: str or + ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType + :keyword start_time: Start time for the List Restore Ranges request. ISO 8601 format. + :paramtype start_time: str + :keyword end_time: End time for the List Restore Ranges request. ISO 8601 format. + :paramtype end_time: str + """ super(AzureBackupFindRestorableTimeRangesRequest, self).__init__(**kwargs) self.source_data_store_type = kwargs['source_data_store_type'] self.start_time = kwargs.get('start_time', None) @@ -375,21 +439,21 @@ def __init__( class DppWorkerRequest(msrest.serialization.Model): """DppWorkerRequest. - :param subscription_id: - :type subscription_id: str - :param uri: - :type uri: str - :param headers: Dictionary of + :ivar subscription_id: + :vartype subscription_id: str + :ivar uri: + :vartype uri: str + :ivar headers: Dictionary of . - :type headers: dict[str, list[str]] - :param supported_group_versions: - :type supported_group_versions: list[str] - :param culture_info: - :type culture_info: str - :param parameters: Dictionary of :code:``. - :type parameters: dict[str, str] - :param http_method: - :type http_method: str + :vartype headers: dict[str, list[str]] + :ivar supported_group_versions: + :vartype supported_group_versions: list[str] + :ivar culture_info: + :vartype culture_info: str + :ivar parameters: Dictionary of :code:``. + :vartype parameters: dict[str, str] + :ivar http_method: + :vartype http_method: str """ _attribute_map = { @@ -406,6 +470,23 @@ def __init__( self, **kwargs ): + """ + :keyword subscription_id: + :paramtype subscription_id: str + :keyword uri: + :paramtype uri: str + :keyword headers: Dictionary of + . + :paramtype headers: dict[str, list[str]] + :keyword supported_group_versions: + :paramtype supported_group_versions: list[str] + :keyword culture_info: + :paramtype culture_info: str + :keyword parameters: Dictionary of :code:``. + :paramtype parameters: dict[str, str] + :keyword http_method: + :paramtype http_method: str + """ super(DppWorkerRequest, self).__init__(**kwargs) self.subscription_id = kwargs.get('subscription_id', None) self.uri = kwargs.get('uri', None) @@ -419,23 +500,23 @@ def __init__( class AzureBackupFindRestorableTimeRangesRequestResource(DppWorkerRequest): """List Restore Ranges Request. - :param subscription_id: - :type subscription_id: str - :param uri: - :type uri: str - :param headers: Dictionary of + :ivar subscription_id: + :vartype subscription_id: str + :ivar uri: + :vartype uri: str + :ivar headers: Dictionary of . - :type headers: dict[str, list[str]] - :param supported_group_versions: - :type supported_group_versions: list[str] - :param culture_info: - :type culture_info: str - :param parameters: Dictionary of :code:``. - :type parameters: dict[str, str] - :param http_method: - :type http_method: str - :param content: AzureBackupFindRestorableTimeRangesRequestResource content. - :type content: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + :vartype headers: dict[str, list[str]] + :ivar supported_group_versions: + :vartype supported_group_versions: list[str] + :ivar culture_info: + :vartype culture_info: str + :ivar parameters: Dictionary of :code:``. + :vartype parameters: dict[str, str] + :ivar http_method: + :vartype http_method: str + :ivar content: AzureBackupFindRestorableTimeRangesRequestResource content. + :vartype content: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest """ _attribute_map = { @@ -453,6 +534,26 @@ def __init__( self, **kwargs ): + """ + :keyword subscription_id: + :paramtype subscription_id: str + :keyword uri: + :paramtype uri: str + :keyword headers: Dictionary of + . + :paramtype headers: dict[str, list[str]] + :keyword supported_group_versions: + :paramtype supported_group_versions: list[str] + :keyword culture_info: + :paramtype culture_info: str + :keyword parameters: Dictionary of :code:``. + :paramtype parameters: dict[str, str] + :keyword http_method: + :paramtype http_method: str + :keyword content: AzureBackupFindRestorableTimeRangesRequestResource content. + :paramtype content: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + """ super(AzureBackupFindRestorableTimeRangesRequestResource, self).__init__(**kwargs) self.content = kwargs.get('content', None) @@ -460,10 +561,10 @@ def __init__( class AzureBackupFindRestorableTimeRangesResponse(msrest.serialization.Model): """List Restore Ranges Response. - :param restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. - :type restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] - :param object_type: - :type object_type: str + :ivar restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. + :vartype restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :ivar object_type: + :vartype object_type: str """ _attribute_map = { @@ -475,6 +576,12 @@ def __init__( self, **kwargs ): + """ + :keyword restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. + :paramtype restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :keyword object_type: + :paramtype object_type: str + """ super(AzureBackupFindRestorableTimeRangesResponse, self).__init__(**kwargs) self.restorable_time_ranges = kwargs.get('restorable_time_ranges', None) self.object_type = kwargs.get('object_type', None) @@ -514,6 +621,8 @@ def __init__( self, **kwargs ): + """ + """ super(DppResource, self).__init__(**kwargs) self.id = None self.name = None @@ -535,8 +644,9 @@ class AzureBackupFindRestorableTimeRangesResponseResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupFindRestorableTimeRangesResponseResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + :ivar properties: AzureBackupFindRestorableTimeRangesResponseResource properties. + :vartype properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse """ _validation = { @@ -558,6 +668,11 @@ def __init__( self, **kwargs ): + """ + :keyword properties: AzureBackupFindRestorableTimeRangesResponseResource properties. + :paramtype properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + """ super(AzureBackupFindRestorableTimeRangesResponseResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -569,71 +684,71 @@ class AzureBackupJob(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param activity_id: Required. Job Activity Id. - :type activity_id: str - :param backup_instance_friendly_name: Required. Name of the Backup Instance. - :type backup_instance_friendly_name: str + :ivar activity_id: Required. Job Activity Id. + :vartype activity_id: str + :ivar backup_instance_friendly_name: Required. Name of the Backup Instance. + :vartype backup_instance_friendly_name: str :ivar backup_instance_id: ARM ID of the Backup Instance. :vartype backup_instance_id: str - :param data_source_id: Required. ARM ID of the DataSource. - :type data_source_id: str - :param data_source_location: Required. Location of the DataSource. - :type data_source_location: str - :param data_source_name: Required. User Friendly Name of the DataSource. - :type data_source_name: str - :param data_source_set_name: Data Source Set Name of the DataSource. - :type data_source_set_name: str - :param data_source_type: Required. Type of DataSource. - :type data_source_type: str - :param duration: Total run time of the job. ISO 8601 format. - :type duration: str + :ivar data_source_id: Required. ARM ID of the DataSource. + :vartype data_source_id: str + :ivar data_source_location: Required. Location of the DataSource. + :vartype data_source_location: str + :ivar data_source_name: Required. User Friendly Name of the DataSource. + :vartype data_source_name: str + :ivar data_source_set_name: Data Source Set Name of the DataSource. + :vartype data_source_set_name: str + :ivar data_source_type: Required. Type of DataSource. + :vartype data_source_type: str + :ivar duration: Total run time of the job. ISO 8601 format. + :vartype duration: str :ivar end_time: EndTime of the job(in UTC). :vartype end_time: ~datetime.datetime :ivar error_details: A List, detailing the errors related to the job. :vartype error_details: list[~azure.mgmt.dataprotection.models.UserFacingError] :ivar extended_info: Extended Information about the job. :vartype extended_info: ~azure.mgmt.dataprotection.models.JobExtendedInfo - :param is_user_triggered: Required. Indicated that whether the job is adhoc(true) or + :ivar is_user_triggered: Required. Indicated that whether the job is adhoc(true) or scheduled(false). - :type is_user_triggered: bool - :param operation: Required. It indicates the type of Job i.e. Backup:full/log/diff + :vartype is_user_triggered: bool + :ivar operation: Required. It indicates the type of Job i.e. Backup:full/log/diff ;Restore:ALR/OLR; Tiering:Backup/Archive ; Management:ConfigureProtection/UnConfigure. - :type operation: str - :param operation_category: Required. It indicates the type of Job i.e. + :vartype operation: str + :ivar operation_category: Required. It indicates the type of Job i.e. Backup/Restore/Tiering/Management. - :type operation_category: str + :vartype operation_category: str :ivar policy_id: ARM ID of the policy. :vartype policy_id: str :ivar policy_name: Name of the policy. :vartype policy_name: str - :param progress_enabled: Required. Indicated whether progress is enabled for the job. - :type progress_enabled: bool + :ivar progress_enabled: Required. Indicated whether progress is enabled for the job. + :vartype progress_enabled: bool :ivar progress_url: Url which contains job's progress. :vartype progress_url: str :ivar restore_type: It indicates the sub type of operation i.e. in case of Restore it can be ALR/OLR. :vartype restore_type: str - :param source_resource_group: Required. Resource Group Name of the Datasource. - :type source_resource_group: str - :param source_subscription_id: Required. SubscriptionId corresponding to the DataSource. - :type source_subscription_id: str - :param start_time: Required. StartTime of the job(in UTC). - :type start_time: ~datetime.datetime - :param status: Required. Status of the job like + :ivar source_resource_group: Required. Resource Group Name of the Datasource. + :vartype source_resource_group: str + :ivar source_subscription_id: Required. SubscriptionId corresponding to the DataSource. + :vartype source_subscription_id: str + :ivar start_time: Required. StartTime of the job(in UTC). + :vartype start_time: ~datetime.datetime + :ivar status: Required. Status of the job like InProgress/Success/Failed/Cancelled/SuccessWithWarning. - :type status: str - :param subscription_id: Required. Subscription Id of the corresponding backup vault. - :type subscription_id: str - :param supported_actions: Required. List of supported actions. - :type supported_actions: list[str] - :param vault_name: Required. Name of the vault. - :type vault_name: str - :param etag: - :type etag: str - :param source_data_store_name: - :type source_data_store_name: str - :param destination_data_store_name: - :type destination_data_store_name: str + :vartype status: str + :ivar subscription_id: Required. Subscription Id of the corresponding backup vault. + :vartype subscription_id: str + :ivar supported_actions: Required. List of supported actions. + :vartype supported_actions: list[str] + :ivar vault_name: Required. Name of the vault. + :vartype vault_name: str + :ivar etag: + :vartype etag: str + :ivar source_data_store_name: + :vartype source_data_store_name: str + :ivar destination_data_store_name: + :vartype destination_data_store_name: str """ _validation = { @@ -701,6 +816,56 @@ def __init__( self, **kwargs ): + """ + :keyword activity_id: Required. Job Activity Id. + :paramtype activity_id: str + :keyword backup_instance_friendly_name: Required. Name of the Backup Instance. + :paramtype backup_instance_friendly_name: str + :keyword data_source_id: Required. ARM ID of the DataSource. + :paramtype data_source_id: str + :keyword data_source_location: Required. Location of the DataSource. + :paramtype data_source_location: str + :keyword data_source_name: Required. User Friendly Name of the DataSource. + :paramtype data_source_name: str + :keyword data_source_set_name: Data Source Set Name of the DataSource. + :paramtype data_source_set_name: str + :keyword data_source_type: Required. Type of DataSource. + :paramtype data_source_type: str + :keyword duration: Total run time of the job. ISO 8601 format. + :paramtype duration: str + :keyword is_user_triggered: Required. Indicated that whether the job is adhoc(true) or + scheduled(false). + :paramtype is_user_triggered: bool + :keyword operation: Required. It indicates the type of Job i.e. Backup:full/log/diff + ;Restore:ALR/OLR; Tiering:Backup/Archive ; Management:ConfigureProtection/UnConfigure. + :paramtype operation: str + :keyword operation_category: Required. It indicates the type of Job i.e. + Backup/Restore/Tiering/Management. + :paramtype operation_category: str + :keyword progress_enabled: Required. Indicated whether progress is enabled for the job. + :paramtype progress_enabled: bool + :keyword source_resource_group: Required. Resource Group Name of the Datasource. + :paramtype source_resource_group: str + :keyword source_subscription_id: Required. SubscriptionId corresponding to the DataSource. + :paramtype source_subscription_id: str + :keyword start_time: Required. StartTime of the job(in UTC). + :paramtype start_time: ~datetime.datetime + :keyword status: Required. Status of the job like + InProgress/Success/Failed/Cancelled/SuccessWithWarning. + :paramtype status: str + :keyword subscription_id: Required. Subscription Id of the corresponding backup vault. + :paramtype subscription_id: str + :keyword supported_actions: Required. List of supported actions. + :paramtype supported_actions: list[str] + :keyword vault_name: Required. Name of the vault. + :paramtype vault_name: str + :keyword etag: + :paramtype etag: str + :keyword source_data_store_name: + :paramtype source_data_store_name: str + :keyword destination_data_store_name: + :paramtype destination_data_store_name: str + """ super(AzureBackupJob, self).__init__(**kwargs) self.activity_id = kwargs['activity_id'] self.backup_instance_friendly_name = kwargs['backup_instance_friendly_name'] @@ -748,8 +913,8 @@ class AzureBackupJobResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupJobResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + :ivar properties: AzureBackupJobResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.AzureBackupJob """ _validation = { @@ -771,6 +936,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: AzureBackupJobResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + """ super(AzureBackupJobResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -778,9 +947,9 @@ def __init__( class DppResourceList(msrest.serialization.Model): """ListResource. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -791,6 +960,11 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppResourceList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) @@ -798,11 +972,11 @@ def __init__( class AzureBackupJobResourceList(DppResourceList): """List of AzureBackup Job resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] """ _attribute_map = { @@ -814,6 +988,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] + """ super(AzureBackupJobResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -826,9 +1007,9 @@ class BackupParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -847,6 +1028,8 @@ def __init__( self, **kwargs ): + """ + """ super(BackupParameters, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -856,11 +1039,11 @@ class AzureBackupParams(BackupParameters): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param backup_type: Required. BackupType ; Full/Incremental etc. - :type backup_type: str + :vartype object_type: str + :ivar backup_type: Required. BackupType ; Full/Incremental etc. + :vartype backup_type: str """ _validation = { @@ -877,6 +1060,10 @@ def __init__( self, **kwargs ): + """ + :keyword backup_type: Required. BackupType ; Full/Incremental etc. + :paramtype backup_type: str + """ super(AzureBackupParams, self).__init__(**kwargs) self.object_type = 'AzureBackupParams' # type: str self.backup_type = kwargs['backup_type'] @@ -890,13 +1077,13 @@ class AzureBackupRestoreRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType """ _validation = { @@ -919,6 +1106,13 @@ def __init__( self, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + """ super(AzureBackupRestoreRequest, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.restore_target_info = kwargs['restore_target_info'] @@ -933,15 +1127,15 @@ class AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRestoreRequest): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_id: Required. - :type recovery_point_id: str + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_id: Required. + :vartype recovery_point_id: str """ _validation = { @@ -966,6 +1160,15 @@ def __init__( self, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_id: Required. + :paramtype recovery_point_id: str + """ super(AzureBackupRecoveryPointBasedRestoreRequest, self).__init__(**kwargs) self.object_type = 'AzureBackupRecoveryPointBasedRestoreRequest' # type: str self.recovery_point_id = kwargs['recovery_point_id'] @@ -985,8 +1188,8 @@ class AzureBackupRecoveryPointResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupRecoveryPointResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + :ivar properties: AzureBackupRecoveryPointResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint """ _validation = { @@ -1008,6 +1211,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: AzureBackupRecoveryPointResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + """ super(AzureBackupRecoveryPointResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -1015,11 +1222,11 @@ def __init__( class AzureBackupRecoveryPointResourceList(DppResourceList): """Azure backup recoveryPoint resource list. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] """ _attribute_map = { @@ -1031,6 +1238,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] + """ super(AzureBackupRecoveryPointResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -1040,16 +1254,16 @@ class AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRestoreRequest): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_time: Required. The recovery time in ISO 8601 format example - + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_time: Required. The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. - :type recovery_point_time: str + :vartype recovery_point_time: str """ _validation = { @@ -1070,6 +1284,16 @@ def __init__( self, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_time: Required. The recovery time in ISO 8601 format example - + 2020-08-14T17:30:00.0000000Z. + :paramtype recovery_point_time: str + """ super(AzureBackupRecoveryTimeBasedRestoreRequest, self).__init__(**kwargs) self.object_type = 'AzureBackupRecoveryTimeBasedRestoreRequest' # type: str self.recovery_point_time = kwargs['recovery_point_time'] @@ -1080,14 +1304,14 @@ class AzureBackupRehydrationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param recovery_point_id: Required. Id of the recovery point to be recovered. - :type recovery_point_id: str - :param rehydration_priority: Priority to be used for rehydration. Values High or Standard. + :ivar recovery_point_id: Required. Id of the recovery point to be recovered. + :vartype recovery_point_id: str + :ivar rehydration_priority: Priority to be used for rehydration. Values High or Standard. Possible values include: "Invalid", "High", "Standard". - :type rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority - :param rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D + :vartype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :ivar rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D . - :type rehydration_retention_duration: str + :vartype rehydration_retention_duration: str """ _validation = { @@ -1105,6 +1329,16 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_point_id: Required. Id of the recovery point to be recovered. + :paramtype recovery_point_id: str + :keyword rehydration_priority: Priority to be used for rehydration. Values High or Standard. + Possible values include: "Invalid", "High", "Standard". + :paramtype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :keyword rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e + P10D . + :paramtype rehydration_retention_duration: str + """ super(AzureBackupRehydrationRequest, self).__init__(**kwargs) self.recovery_point_id = kwargs['recovery_point_id'] self.rehydration_priority = kwargs.get('rehydration_priority', None) @@ -1116,21 +1350,21 @@ class AzureBackupRestoreWithRehydrationRequest(AzureBackupRecoveryPointBasedRest All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_id: Required. - :type recovery_point_id: str - :param rehydration_priority: Required. Priority to be used for rehydration. Values High or + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_id: Required. + :vartype recovery_point_id: str + :ivar rehydration_priority: Required. Priority to be used for rehydration. Values High or Standard. Possible values include: "Invalid", "High", "Standard". - :type rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority - :param rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D + :vartype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :ivar rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D . - :type rehydration_retention_duration: str + :vartype rehydration_retention_duration: str """ _validation = { @@ -1155,6 +1389,21 @@ def __init__( self, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_id: Required. + :paramtype recovery_point_id: str + :keyword rehydration_priority: Required. Priority to be used for rehydration. Values High or + Standard. Possible values include: "Invalid", "High", "Standard". + :paramtype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :keyword rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e + P10D . + :paramtype rehydration_retention_duration: str + """ super(AzureBackupRestoreWithRehydrationRequest, self).__init__(**kwargs) self.object_type = 'AzureBackupRestoreWithRehydrationRequest' # type: str self.rehydration_priority = kwargs['rehydration_priority'] @@ -1169,10 +1418,10 @@ class BasePolicyRule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -1193,6 +1442,10 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + """ super(BasePolicyRule, self).__init__(**kwargs) self.name = kwargs['name'] self.object_type = None # type: Optional[str] @@ -1203,16 +1456,16 @@ class AzureBackupRule(BasePolicyRule): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str - :param backup_parameters: BackupParameters base. - :type backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters - :param data_store: Required. DataStoreInfo base. - :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase - :param trigger: Required. Trigger context. - :type trigger: ~azure.mgmt.dataprotection.models.TriggerContext + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar backup_parameters: BackupParameters base. + :vartype backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters + :ivar data_store: Required. DataStoreInfo base. + :vartype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar trigger: Required. Trigger context. + :vartype trigger: ~azure.mgmt.dataprotection.models.TriggerContext """ _validation = { @@ -1234,6 +1487,16 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + :keyword backup_parameters: BackupParameters base. + :paramtype backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters + :keyword data_store: Required. DataStoreInfo base. + :paramtype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :keyword trigger: Required. Trigger context. + :paramtype trigger: ~azure.mgmt.dataprotection.models.TriggerContext + """ super(AzureBackupRule, self).__init__(**kwargs) self.object_type = 'AzureBackupRule' # type: str self.backup_parameters = kwargs.get('backup_parameters', None) @@ -1249,12 +1512,12 @@ class DataStoreParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :vartype object_type: str + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes """ _validation = { @@ -1275,6 +1538,11 @@ def __init__( self, **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + """ super(DataStoreParameters, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.data_store_type = kwargs['data_store_type'] @@ -1285,14 +1553,14 @@ class AzureOperationalStoreParameters(DataStoreParameters): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :vartype object_type: str + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes - :param resource_group_id: Gets or sets the Snapshot Resource Group Uri. - :type resource_group_id: str + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :ivar resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :vartype resource_group_id: str """ _validation = { @@ -1310,6 +1578,13 @@ def __init__( self, **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :keyword resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :paramtype resource_group_id: str + """ super(AzureOperationalStoreParameters, self).__init__(**kwargs) self.object_type = 'AzureOperationalStoreParameters' # type: str self.resource_group_id = kwargs.get('resource_group_id', None) @@ -1320,14 +1595,14 @@ class AzureRetentionRule(BasePolicyRule): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str - :param is_default: - :type is_default: bool - :param lifecycles: Required. - :type lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar is_default: + :vartype is_default: bool + :ivar lifecycles: Required. + :vartype lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] """ _validation = { @@ -1347,6 +1622,14 @@ def __init__( self, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + :keyword is_default: + :paramtype is_default: bool + :keyword lifecycles: Required. + :paramtype lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + """ super(AzureRetentionRule, self).__init__(**kwargs) self.object_type = 'AzureRetentionRule' # type: str self.is_default = kwargs.get('is_default', None) @@ -1361,9 +1644,9 @@ class BackupCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -1382,6 +1665,8 @@ def __init__( self, **kwargs ): + """ + """ super(BackupCriteria, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -1393,14 +1678,14 @@ class BackupInstance(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param friendly_name: Gets or sets the Backup Instance friendly name. - :type friendly_name: str - :param data_source_info: Required. Gets or sets the data source information. - :type data_source_info: ~azure.mgmt.dataprotection.models.Datasource - :param data_source_set_info: Gets or sets the data source set information. - :type data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param policy_info: Required. Gets or sets the policy information. - :type policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :ivar friendly_name: Gets or sets the Backup Instance friendly name. + :vartype friendly_name: str + :ivar data_source_info: Required. Gets or sets the data source information. + :vartype data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar data_source_set_info: Gets or sets the data source set information. + :vartype data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar policy_info: Required. Gets or sets the policy information. + :vartype policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo :ivar protection_status: Specifies the protection status of the resource. :vartype protection_status: ~azure.mgmt.dataprotection.models.ProtectionStatusDetails :ivar current_protection_state: Specifies the current protection state of the resource. @@ -1415,11 +1700,11 @@ class BackupInstance(msrest.serialization.Model): :ivar provisioning_state: Specifies the provisioning state of the resource i.e. provisioning/updating/Succeeded/Failed. :vartype provisioning_state: str - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials - :param object_type: Required. - :type object_type: str + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :ivar object_type: Required. + :vartype object_type: str """ _validation = { @@ -1449,6 +1734,21 @@ def __init__( self, **kwargs ): + """ + :keyword friendly_name: Gets or sets the Backup Instance friendly name. + :paramtype friendly_name: str + :keyword data_source_info: Required. Gets or sets the data source information. + :paramtype data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword data_source_set_info: Gets or sets the data source set information. + :paramtype data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword policy_info: Required. Gets or sets the policy information. + :paramtype policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :keyword object_type: Required. + :paramtype object_type: str + """ super(BackupInstance, self).__init__(**kwargs) self.friendly_name = kwargs.get('friendly_name', None) self.data_source_info = kwargs['data_source_info'] @@ -1476,8 +1776,8 @@ class BackupInstanceResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: BackupInstanceResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BackupInstance + :ivar properties: BackupInstanceResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BackupInstance """ _validation = { @@ -1499,6 +1799,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: BackupInstanceResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BackupInstance + """ super(BackupInstanceResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -1506,11 +1810,11 @@ def __init__( class BackupInstanceResourceList(DppResourceList): """BackupInstance Resource list response. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] """ _attribute_map = { @@ -1522,6 +1826,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] + """ super(BackupInstanceResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -1534,10 +1845,10 @@ class BaseBackupPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_types: Required. Type of datasource for the backup management. - :type datasource_types: list[str] - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar datasource_types: Required. Type of datasource for the backup management. + :vartype datasource_types: list[str] + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -1558,6 +1869,10 @@ def __init__( self, **kwargs ): + """ + :keyword datasource_types: Required. Type of datasource for the backup management. + :paramtype datasource_types: list[str] + """ super(BaseBackupPolicy, self).__init__(**kwargs) self.datasource_types = kwargs['datasource_types'] self.object_type = None # type: Optional[str] @@ -1568,13 +1883,13 @@ class BackupPolicy(BaseBackupPolicy): All required parameters must be populated in order to send to Azure. - :param datasource_types: Required. Type of datasource for the backup management. - :type datasource_types: list[str] - :param object_type: Required. Constant filled by server. - :type object_type: str - :param policy_rules: Required. Policy rule dictionary that contains rules for each backuptype + :ivar datasource_types: Required. Type of datasource for the backup management. + :vartype datasource_types: list[str] + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar policy_rules: Required. Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc. - :type policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + :vartype policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] """ _validation = { @@ -1593,6 +1908,13 @@ def __init__( self, **kwargs ): + """ + :keyword datasource_types: Required. Type of datasource for the backup management. + :paramtype datasource_types: list[str] + :keyword policy_rules: Required. Policy rule dictionary that contains rules for each backuptype + i.e Full/Incremental/Logs etc. + :paramtype policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + """ super(BackupPolicy, self).__init__(**kwargs) self.object_type = 'BackupPolicy' # type: str self.policy_rules = kwargs['policy_rules'] @@ -1603,10 +1925,10 @@ class BackupSchedule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param repeating_time_intervals: Required. ISO 8601 repeating time interval format. - :type repeating_time_intervals: list[str] - :param time_zone: Time zone for a schedule. Example: Pacific Standard Time. - :type time_zone: str + :ivar repeating_time_intervals: Required. ISO 8601 repeating time interval format. + :vartype repeating_time_intervals: list[str] + :ivar time_zone: Time zone for a schedule. Example: Pacific Standard Time. + :vartype time_zone: str """ _validation = { @@ -1622,6 +1944,12 @@ def __init__( self, **kwargs ): + """ + :keyword repeating_time_intervals: Required. ISO 8601 repeating time interval format. + :paramtype repeating_time_intervals: list[str] + :keyword time_zone: Time zone for a schedule. Example: Pacific Standard Time. + :paramtype time_zone: str + """ super(BackupSchedule, self).__init__(**kwargs) self.repeating_time_intervals = kwargs['repeating_time_intervals'] self.time_zone = kwargs.get('time_zone', None) @@ -1643,8 +1971,8 @@ class BackupVault(msrest.serialization.Model): :vartype resource_move_state: str or ~azure.mgmt.dataprotection.models.ResourceMoveState :ivar resource_move_details: Resource move details for backup vault. :vartype resource_move_details: ~azure.mgmt.dataprotection.models.ResourceMoveDetails - :param storage_settings: Required. Storage Settings. - :type storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] + :ivar storage_settings: Required. Storage Settings. + :vartype storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] """ _validation = { @@ -1665,6 +1993,10 @@ def __init__( self, **kwargs ): + """ + :keyword storage_settings: Required. Storage Settings. + :paramtype storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] + """ super(BackupVault, self).__init__(**kwargs) self.provisioning_state = None self.resource_move_state = None @@ -1677,18 +2009,18 @@ class DppTrackedResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str @@ -1718,6 +2050,16 @@ def __init__( self, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(DppTrackedResource, self).__init__(**kwargs) self.e_tag = kwargs.get('e_tag', None) self.id = None @@ -1736,25 +2078,25 @@ class BackupVaultResource(DppTrackedResource): All required parameters must be populated in order to send to Azure. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: Required. BackupVaultResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BackupVault + :ivar properties: Required. BackupVaultResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BackupVault """ _validation = { @@ -1781,6 +2123,18 @@ def __init__( self, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: Required. BackupVaultResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BackupVault + """ super(BackupVaultResource, self).__init__(**kwargs) self.properties = kwargs['properties'] @@ -1788,11 +2142,11 @@ def __init__( class BackupVaultResourceList(DppResourceList): """List of BackupVault resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] """ _attribute_map = { @@ -1804,6 +2158,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] + """ super(BackupVaultResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -1822,8 +2183,8 @@ class BaseBackupPolicyResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: BaseBackupPolicyResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + :ivar properties: BaseBackupPolicyResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy """ _validation = { @@ -1845,6 +2206,10 @@ def __init__( self, **kwargs ): + """ + :keyword properties: BaseBackupPolicyResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + """ super(BaseBackupPolicyResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -1852,11 +2217,11 @@ def __init__( class BaseBackupPolicyResourceList(DppResourceList): """List of BaseBackupPolicy resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] """ _attribute_map = { @@ -1868,6 +2233,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] + """ super(BaseBackupPolicyResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -1875,10 +2247,10 @@ def __init__( class CheckNameAvailabilityRequest(msrest.serialization.Model): """CheckNameAvailability Request. - :param name: Resource name for which availability needs to be checked. - :type name: str - :param type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. - :type type: str + :ivar name: Resource name for which availability needs to be checked. + :vartype name: str + :ivar type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. + :vartype type: str """ _attribute_map = { @@ -1890,6 +2262,12 @@ def __init__( self, **kwargs ): + """ + :keyword name: Resource name for which availability needs to be checked. + :paramtype name: str + :keyword type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. + :paramtype type: str + """ super(CheckNameAvailabilityRequest, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.type = kwargs.get('type', None) @@ -1898,12 +2276,12 @@ def __init__( class CheckNameAvailabilityResult(msrest.serialization.Model): """CheckNameAvailability Result. - :param message: Gets or sets the message. - :type message: str - :param name_available: Gets or sets a value indicating whether [name available]. - :type name_available: bool - :param reason: Gets or sets the reason. - :type reason: str + :ivar message: Gets or sets the message. + :vartype message: str + :ivar name_available: Gets or sets a value indicating whether [name available]. + :vartype name_available: bool + :ivar reason: Gets or sets the reason. + :vartype reason: str """ _attribute_map = { @@ -1916,6 +2294,14 @@ def __init__( self, **kwargs ): + """ + :keyword message: Gets or sets the message. + :paramtype message: str + :keyword name_available: Gets or sets a value indicating whether [name available]. + :paramtype name_available: bool + :keyword reason: Gets or sets the reason. + :paramtype reason: str + """ super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.message = kwargs.get('message', None) self.name_available = kwargs.get('name_available', None) @@ -1925,14 +2311,14 @@ def __init__( class ClientDiscoveryDisplay(msrest.serialization.Model): """Localized display information of an operation. - :param description: Description of the operation having details of what operation is about. - :type description: str - :param operation: Operations Name itself. - :type operation: str - :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 + :ivar description: Description of the operation having details of what operation is about. + :vartype description: str + :ivar operation: Operations Name itself. + :vartype operation: 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 """ _attribute_map = { @@ -1946,6 +2332,16 @@ def __init__( self, **kwargs ): + """ + :keyword description: Description of the operation having details of what operation is about. + :paramtype description: str + :keyword operation: Operations Name itself. + :paramtype operation: str + :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 + """ super(ClientDiscoveryDisplay, self).__init__(**kwargs) self.description = kwargs.get('description', None) self.operation = kwargs.get('operation', None) @@ -1956,12 +2352,12 @@ def __init__( class ClientDiscoveryForLogSpecification(msrest.serialization.Model): """Class to represent shoebox log specification in json client discovery. - :param blob_duration: blob duration of shoebox log specification. - :type blob_duration: str - :param display_name: Localized display name. - :type display_name: str - :param name: Name for shoebox log specification. - :type name: str + :ivar blob_duration: blob duration of shoebox log specification. + :vartype blob_duration: str + :ivar display_name: Localized display name. + :vartype display_name: str + :ivar name: Name for shoebox log specification. + :vartype name: str """ _attribute_map = { @@ -1974,6 +2370,14 @@ def __init__( self, **kwargs ): + """ + :keyword blob_duration: blob duration of shoebox log specification. + :paramtype blob_duration: str + :keyword display_name: Localized display name. + :paramtype display_name: str + :keyword name: Name for shoebox log specification. + :paramtype name: str + """ super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) self.blob_duration = kwargs.get('blob_duration', None) self.display_name = kwargs.get('display_name', None) @@ -1983,8 +2387,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.dataprotection.models.ClientDiscoveryForServiceSpecification """ @@ -1996,6 +2400,11 @@ def __init__( self, **kwargs ): + """ + :keyword service_specification: Operation properties. + :paramtype service_specification: + ~azure.mgmt.dataprotection.models.ClientDiscoveryForServiceSpecification + """ super(ClientDiscoveryForProperties, self).__init__(**kwargs) self.service_specification = kwargs.get('service_specification', None) @@ -2003,8 +2412,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.dataprotection.models.ClientDiscoveryForLogSpecification] """ @@ -2016,6 +2425,11 @@ def __init__( self, **kwargs ): + """ + :keyword log_specifications: List of log specifications of this operation. + :paramtype log_specifications: + list[~azure.mgmt.dataprotection.models.ClientDiscoveryForLogSpecification] + """ super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) self.log_specifications = kwargs.get('log_specifications', None) @@ -2023,10 +2437,10 @@ def __init__( class ClientDiscoveryResponse(msrest.serialization.Model): """Operations List response which contains list of available APIs. - :param next_link: Link to the next chunk of Response. - :type next_link: str - :param value: List of available operations. - :type value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] + :ivar next_link: Link to the next chunk of Response. + :vartype next_link: str + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] """ _attribute_map = { @@ -2038,6 +2452,12 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: Link to the next chunk of Response. + :paramtype next_link: str + :keyword value: List of available operations. + :paramtype value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] + """ super(ClientDiscoveryResponse, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) self.value = kwargs.get('value', None) @@ -2046,17 +2466,17 @@ def __init__( class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): """Available operation details. - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay - :param name: Name of the Operation. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param origin: The intended executor of the operation;governs the display of the operation in + :ivar display: Contains the localized display information for this particular operation. + :vartype display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :ivar name: Name of the Operation. + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :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: Properties for the given operation. - :type properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + :vartype origin: str + :ivar properties: Properties for the given operation. + :vartype properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties """ _attribute_map = { @@ -2071,6 +2491,19 @@ def __init__( self, **kwargs ): + """ + :keyword display: Contains the localized display information for this particular operation. + :paramtype display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :keyword name: Name of the Operation. + :paramtype name: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :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: Properties for the given operation. + :paramtype properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + """ super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) self.display = kwargs.get('display', None) self.name = kwargs.get('name', None) @@ -2087,9 +2520,9 @@ class CopyOption(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2108,6 +2541,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyOption, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2117,9 +2552,9 @@ class CopyOnExpiryOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2134,6 +2569,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyOnExpiryOption, self).__init__(**kwargs) self.object_type = 'CopyOnExpiryOption' # type: str @@ -2143,11 +2580,11 @@ class CustomCopyOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param duration: Data copied after given timespan. - :type duration: str + :vartype object_type: str + :ivar duration: Data copied after given timespan. + :vartype duration: str """ _validation = { @@ -2163,6 +2600,10 @@ def __init__( self, **kwargs ): + """ + :keyword duration: Data copied after given timespan. + :paramtype duration: str + """ super(CustomCopyOption, self).__init__(**kwargs) self.object_type = 'CustomCopyOption' # type: str self.duration = kwargs.get('duration', None) @@ -2173,21 +2614,21 @@ class Datasource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_type: DatasourceType of the resource. - :type datasource_type: str - :param object_type: Type of Datasource object, used to initialize the right inherited type. - :type object_type: str - :param resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. + :ivar datasource_type: DatasourceType of the resource. + :vartype datasource_type: str + :ivar object_type: Type of Datasource object, used to initialize the right inherited type. + :vartype object_type: str + :ivar resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. - :type resource_id: str - :param resource_location: Location of datasource. - :type resource_location: str - :param resource_name: Unique identifier of the resource in the context of parent. - :type resource_name: str - :param resource_type: Resource Type of Datasource. - :type resource_type: str - :param resource_uri: Uri of the resource. - :type resource_uri: str + :vartype resource_id: str + :ivar resource_location: Location of datasource. + :vartype resource_location: str + :ivar resource_name: Unique identifier of the resource in the context of parent. + :vartype resource_name: str + :ivar resource_type: Resource Type of Datasource. + :vartype resource_type: str + :ivar resource_uri: Uri of the resource. + :vartype resource_uri: str """ _validation = { @@ -2208,6 +2649,23 @@ def __init__( self, **kwargs ): + """ + :keyword datasource_type: DatasourceType of the resource. + :paramtype datasource_type: str + :keyword object_type: Type of Datasource object, used to initialize the right inherited type. + :paramtype object_type: str + :keyword resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM + ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. + :paramtype resource_id: str + :keyword resource_location: Location of datasource. + :paramtype resource_location: str + :keyword resource_name: Unique identifier of the resource in the context of parent. + :paramtype resource_name: str + :keyword resource_type: Resource Type of Datasource. + :paramtype resource_type: str + :keyword resource_uri: Uri of the resource. + :paramtype resource_uri: str + """ super(Datasource, self).__init__(**kwargs) self.datasource_type = kwargs.get('datasource_type', None) self.object_type = kwargs.get('object_type', None) @@ -2223,21 +2681,21 @@ class DatasourceSet(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_type: DatasourceType of the resource. - :type datasource_type: str - :param object_type: Type of Datasource object, used to initialize the right inherited type. - :type object_type: str - :param resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. + :ivar datasource_type: DatasourceType of the resource. + :vartype datasource_type: str + :ivar object_type: Type of Datasource object, used to initialize the right inherited type. + :vartype object_type: str + :ivar resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. - :type resource_id: str - :param resource_location: Location of datasource. - :type resource_location: str - :param resource_name: Unique identifier of the resource in the context of parent. - :type resource_name: str - :param resource_type: Resource Type of Datasource. - :type resource_type: str - :param resource_uri: Uri of the resource. - :type resource_uri: str + :vartype resource_id: str + :ivar resource_location: Location of datasource. + :vartype resource_location: str + :ivar resource_name: Unique identifier of the resource in the context of parent. + :vartype resource_name: str + :ivar resource_type: Resource Type of Datasource. + :vartype resource_type: str + :ivar resource_uri: Uri of the resource. + :vartype resource_uri: str """ _validation = { @@ -2258,6 +2716,23 @@ def __init__( self, **kwargs ): + """ + :keyword datasource_type: DatasourceType of the resource. + :paramtype datasource_type: str + :keyword object_type: Type of Datasource object, used to initialize the right inherited type. + :paramtype object_type: str + :keyword resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM + ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. + :paramtype resource_id: str + :keyword resource_location: Location of datasource. + :paramtype resource_location: str + :keyword resource_name: Unique identifier of the resource in the context of parent. + :paramtype resource_name: str + :keyword resource_type: Resource Type of Datasource. + :paramtype resource_type: str + :keyword resource_uri: Uri of the resource. + :paramtype resource_uri: str + """ super(DatasourceSet, self).__init__(**kwargs) self.datasource_type = kwargs.get('datasource_type', None) self.object_type = kwargs.get('object_type', None) @@ -2273,12 +2748,12 @@ class DataStoreInfoBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2295,6 +2770,14 @@ def __init__( self, **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :keyword object_type: Required. Type of Datasource object, used to initialize the right + inherited type. + :paramtype object_type: str + """ super(DataStoreInfoBase, self).__init__(**kwargs) self.data_store_type = kwargs['data_store_type'] self.object_type = kwargs['object_type'] @@ -2303,10 +2786,10 @@ def __init__( class Day(msrest.serialization.Model): """Day of the week. - :param date: Date of the month. - :type date: int - :param is_last: Whether Date is last date of month. - :type is_last: bool + :ivar date: Date of the month. + :vartype date: int + :ivar is_last: Whether Date is last date of month. + :vartype is_last: bool """ _attribute_map = { @@ -2318,6 +2801,12 @@ def __init__( self, **kwargs ): + """ + :keyword date: Date of the month. + :paramtype date: int + :keyword is_last: Whether Date is last date of month. + :paramtype is_last: bool + """ super(Day, self).__init__(**kwargs) self.date = kwargs.get('date', None) self.is_last = kwargs.get('is_last', None) @@ -2353,6 +2842,8 @@ def __init__( self, **kwargs ): + """ + """ super(DppBaseResource, self).__init__(**kwargs) self.id = None self.name = None @@ -2362,11 +2853,11 @@ def __init__( class DppBaseResourceList(msrest.serialization.Model): """Base for all lists of V2 resources. - :param value: List of Dpp resources. - :type value: list[~azure.mgmt.dataprotection.models.DppBaseResource] - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar value: List of Dpp resources. + :vartype value: list[~azure.mgmt.dataprotection.models.DppBaseResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -2378,6 +2869,13 @@ def __init__( self, **kwargs ): + """ + :keyword value: List of Dpp resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.DppBaseResource] + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppBaseResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) @@ -2394,8 +2892,8 @@ class DppIdentityDetails(msrest.serialization.Model): :ivar tenant_id: A Globally Unique Identifier (GUID) that represents the Azure AD tenant where the resource is now a member. :vartype tenant_id: str - :param type: The identityType which can be either SystemAssigned or None. - :type type: str + :ivar type: The identityType which can be either SystemAssigned or None. + :vartype type: str """ _validation = { @@ -2413,6 +2911,10 @@ def __init__( self, **kwargs ): + """ + :keyword type: The identityType which can be either SystemAssigned or None. + :paramtype type: str + """ super(DppIdentityDetails, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2422,9 +2924,9 @@ def __init__( class DppTrackedResourceList(msrest.serialization.Model): """DppTrackedResourceList. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -2435,6 +2937,11 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppTrackedResourceList, self).__init__(**kwargs) self.next_link = kwargs.get('next_link', None) @@ -2476,6 +2983,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.additional_info = None self.code = None @@ -2509,6 +3018,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.info = None self.type = None @@ -2547,6 +3058,8 @@ def __init__( self, **kwargs ): + """ + """ super(ExportJobsResult, self).__init__(**kwargs) self.blob_url = None self.blob_sas_key = None @@ -2562,9 +3075,9 @@ class FeatureValidationRequestBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2583,6 +3096,8 @@ def __init__( self, **kwargs ): + """ + """ super(FeatureValidationRequestBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2592,14 +3107,14 @@ class FeatureValidationRequest(FeatureValidationRequestBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param feature_type: backup support feature type. Possible values include: "Invalid", + :vartype object_type: str + :ivar feature_type: backup support feature type. Possible values include: "Invalid", "DataSourceType". - :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType - :param feature_name: backup support feature name. - :type feature_name: str + :vartype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :ivar feature_name: backup support feature name. + :vartype feature_name: str """ _validation = { @@ -2616,6 +3131,13 @@ def __init__( self, **kwargs ): + """ + :keyword feature_type: backup support feature type. Possible values include: "Invalid", + "DataSourceType". + :paramtype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :keyword feature_name: backup support feature name. + :paramtype feature_name: str + """ super(FeatureValidationRequest, self).__init__(**kwargs) self.object_type = 'FeatureValidationRequest' # type: str self.feature_type = kwargs.get('feature_type', None) @@ -2630,9 +3152,9 @@ class FeatureValidationResponseBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2651,6 +3173,8 @@ def __init__( self, **kwargs ): + """ + """ super(FeatureValidationResponseBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2660,14 +3184,14 @@ class FeatureValidationResponse(FeatureValidationResponseBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param feature_type: backup support feature type. Possible values include: "Invalid", + :vartype object_type: str + :ivar feature_type: backup support feature type. Possible values include: "Invalid", "DataSourceType". - :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType - :param features: Response features. - :type features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + :vartype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :ivar features: Response features. + :vartype features: list[~azure.mgmt.dataprotection.models.SupportedFeature] """ _validation = { @@ -2684,6 +3208,13 @@ def __init__( self, **kwargs ): + """ + :keyword feature_type: backup support feature type. Possible values include: "Invalid", + "DataSourceType". + :paramtype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :keyword features: Response features. + :paramtype features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + """ super(FeatureValidationResponse, self).__init__(**kwargs) self.object_type = 'FeatureValidationResponse' # type: str self.feature_type = kwargs.get('feature_type', None) @@ -2695,9 +3226,9 @@ class ImmediateCopyOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2712,6 +3243,8 @@ def __init__( self, **kwargs ): + """ + """ super(ImmediateCopyOption, self).__init__(**kwargs) self.object_type = 'ImmediateCopyOption' # type: str @@ -2719,13 +3252,13 @@ def __init__( class InnerError(msrest.serialization.Model): """Inner Error. - :param additional_info: Any Key value pairs that can be provided to the client for additional + :ivar additional_info: Any Key value pairs that can be provided to the client for additional verbose information. - :type additional_info: dict[str, str] - :param code: Unique code for this error. - :type code: str - :param embedded_inner_error: Child Inner Error, to allow Nesting. - :type embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + :vartype additional_info: dict[str, str] + :ivar code: Unique code for this error. + :vartype code: str + :ivar embedded_inner_error: Child Inner Error, to allow Nesting. + :vartype embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError """ _attribute_map = { @@ -2738,6 +3271,15 @@ def __init__( self, **kwargs ): + """ + :keyword additional_info: Any Key value pairs that can be provided to the client for additional + verbose information. + :paramtype additional_info: dict[str, str] + :keyword code: Unique code for this error. + :paramtype code: str + :keyword embedded_inner_error: Child Inner Error, to allow Nesting. + :paramtype embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.additional_info = kwargs.get('additional_info', None) self.code = kwargs.get('code', None) @@ -2752,9 +3294,9 @@ class ItemLevelRestoreCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2773,6 +3315,8 @@ def __init__( self, **kwargs ): + """ + """ super(ItemLevelRestoreCriteria, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2785,13 +3329,13 @@ class RestoreTargetInfoBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str """ _validation = { @@ -2813,6 +3357,12 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + """ super(RestoreTargetInfoBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.recovery_option = kwargs['recovery_option'] @@ -2824,22 +3374,22 @@ class ItemLevelRestoreTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param restore_criteria: Required. Restore Criteria. - :type restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] - :param datasource_info: Required. Information of target DS. - :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource - :param datasource_set_info: Information of target DS Set. - :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar restore_criteria: Required. Restore Criteria. + :vartype restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :ivar datasource_info: Required. Information of target DS. + :vartype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar datasource_set_info: Information of target DS Set. + :vartype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials """ _validation = { @@ -2863,6 +3413,21 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword restore_criteria: Required. Restore Criteria. + :paramtype restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :keyword datasource_info: Required. Information of target DS. + :paramtype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword datasource_set_info: Information of target DS Set. + :paramtype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + """ super(ItemLevelRestoreTargetInfo, self).__init__(**kwargs) self.object_type = 'ItemLevelRestoreTargetInfo' # type: str self.restore_criteria = kwargs['restore_criteria'] @@ -2876,8 +3441,8 @@ class JobExtendedInfo(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_details: Job's Additional Details. - :type additional_details: dict[str, str] + :ivar additional_details: Job's Additional Details. + :vartype additional_details: dict[str, str] :ivar backup_instance_state: State of the Backup Instance. :vartype backup_instance_state: str :ivar data_transferred_in_bytes: Number of bytes transferred. @@ -2915,6 +3480,10 @@ def __init__( self, **kwargs ): + """ + :keyword additional_details: Job's Additional Details. + :paramtype additional_details: dict[str, str] + """ super(JobExtendedInfo, self).__init__(**kwargs) self.additional_details = kwargs.get('additional_details', None) self.backup_instance_state = None @@ -2932,16 +3501,16 @@ class JobSubTask(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_details: Additional details of Sub Tasks. - :type additional_details: dict[str, str] - :param task_id: Required. Task Id of the Sub Task. - :type task_id: int - :param task_name: Required. Name of the Sub Task. - :type task_name: str + :ivar additional_details: Additional details of Sub Tasks. + :vartype additional_details: dict[str, str] + :ivar task_id: Required. Task Id of the Sub Task. + :vartype task_id: int + :ivar task_name: Required. Name of the Sub Task. + :vartype task_name: str :ivar task_progress: Progress of the Sub Task. :vartype task_progress: str - :param task_status: Required. Status of the Sub Task. - :type task_status: str + :ivar task_status: Required. Status of the Sub Task. + :vartype task_status: str """ _validation = { @@ -2963,6 +3532,16 @@ def __init__( self, **kwargs ): + """ + :keyword additional_details: Additional details of Sub Tasks. + :paramtype additional_details: dict[str, str] + :keyword task_id: Required. Task Id of the Sub Task. + :paramtype task_id: int + :keyword task_name: Required. Name of the Sub Task. + :paramtype task_name: str + :keyword task_status: Required. Status of the Sub Task. + :paramtype task_status: str + """ super(JobSubTask, self).__init__(**kwargs) self.additional_details = kwargs.get('additional_details', None) self.task_id = kwargs['task_id'] @@ -2979,9 +3558,9 @@ class OperationExtendedInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. This property will be used as the discriminator for deciding the + :ivar object_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 object_type: str + :vartype object_type: str """ _validation = { @@ -3000,6 +3579,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationExtendedInfo, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -3009,11 +3590,11 @@ class OperationJobExtendedInfo(OperationExtendedInfo): All required parameters must be populated in order to send to Azure. - :param object_type: Required. This property will be used as the discriminator for deciding the + :ivar object_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 object_type: str - :param job_id: Arm Id of the job created for this operation. - :type job_id: str + :vartype object_type: str + :ivar job_id: Arm Id of the job created for this operation. + :vartype job_id: str """ _validation = { @@ -3029,6 +3610,10 @@ def __init__( self, **kwargs ): + """ + :keyword job_id: Arm Id of the job created for this operation. + :paramtype job_id: str + """ super(OperationJobExtendedInfo, self).__init__(**kwargs) self.object_type = 'OperationJobExtendedInfo' # type: str self.job_id = kwargs.get('job_id', None) @@ -3037,24 +3622,24 @@ 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. The full set of optional properties (e.g. inner errors / details) can be found in the "Error Response" section. - :type error: ~azure.mgmt.dataprotection.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.dataprotection.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 properties: End time of the operation. - :type properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime - :param status: - :type status: str + :vartype name: str + :ivar properties: End time of the operation. + :vartype properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar status: + :vartype status: str """ _attribute_map = { @@ -3071,6 +3656,26 @@ 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. + The full set of optional properties (e.g. inner errors / details) can be found in the "Error + Response" section. + :paramtype error: ~azure.mgmt.dataprotection.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 properties: End time of the operation. + :paramtype properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :keyword start_time: Start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword status: + :paramtype status: str + """ super(OperationResource, self).__init__(**kwargs) self.end_time = kwargs.get('end_time', None) self.error = kwargs.get('error', None) @@ -3084,10 +3689,10 @@ def __init__( class PatchResourceRequestInput(msrest.serialization.Model): """Patch Request content for Microsoft.DataProtection resources. - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3099,6 +3704,12 @@ def __init__( self, **kwargs ): + """ + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(PatchResourceRequestInput, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.tags = kwargs.get('tags', None) @@ -3111,12 +3722,12 @@ class PolicyInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param policy_id: Required. - :type policy_id: str + :ivar policy_id: Required. + :vartype policy_id: str :ivar policy_version: :vartype policy_version: str - :param policy_parameters: Policy parameters for the backup instance. - :type policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters + :ivar policy_parameters: Policy parameters for the backup instance. + :vartype policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters """ _validation = { @@ -3134,6 +3745,12 @@ def __init__( self, **kwargs ): + """ + :keyword policy_id: Required. + :paramtype policy_id: str + :keyword policy_parameters: Policy parameters for the backup instance. + :paramtype policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters + """ super(PolicyInfo, self).__init__(**kwargs) self.policy_id = kwargs['policy_id'] self.policy_version = None @@ -3143,8 +3760,9 @@ def __init__( class PolicyParameters(msrest.serialization.Model): """Parameters in Policy. - :param data_store_parameters_list: Gets or sets the DataStore Parameters. - :type data_store_parameters_list: list[~azure.mgmt.dataprotection.models.DataStoreParameters] + :ivar data_store_parameters_list: Gets or sets the DataStore Parameters. + :vartype data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] """ _attribute_map = { @@ -3155,6 +3773,11 @@ def __init__( self, **kwargs ): + """ + :keyword data_store_parameters_list: Gets or sets the DataStore Parameters. + :paramtype data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] + """ super(PolicyParameters, self).__init__(**kwargs) self.data_store_parameters_list = kwargs.get('data_store_parameters_list', None) @@ -3162,12 +3785,12 @@ def __init__( class ProtectionStatusDetails(msrest.serialization.Model): """Protection status details. - :param error_details: Specifies the protection status error of the resource. - :type error_details: ~azure.mgmt.dataprotection.models.UserFacingError - :param status: Specifies the protection status of the resource. Possible values include: + :ivar error_details: Specifies the protection status error of the resource. + :vartype error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :ivar status: Specifies the protection status of the resource. Possible values include: "ConfiguringProtection", "ConfiguringProtectionFailed", "ProtectionConfigured", "ProtectionStopped", "SoftDeleted", "SoftDeleting". - :type status: str or ~azure.mgmt.dataprotection.models.Status + :vartype status: str or ~azure.mgmt.dataprotection.models.Status """ _attribute_map = { @@ -3179,6 +3802,14 @@ def __init__( self, **kwargs ): + """ + :keyword error_details: Specifies the protection status error of the resource. + :paramtype error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :keyword status: Specifies the protection status of the resource. Possible values include: + "ConfiguringProtection", "ConfiguringProtectionFailed", "ProtectionConfigured", + "ProtectionStopped", "SoftDeleted", "SoftDeleting". + :paramtype status: str or ~azure.mgmt.dataprotection.models.Status + """ super(ProtectionStatusDetails, self).__init__(**kwargs) self.error_details = kwargs.get('error_details', None) self.status = kwargs.get('status', None) @@ -3189,13 +3820,13 @@ class RangeBasedItemLevelRestoreCriteria(ItemLevelRestoreCriteria): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param min_matching_value: minimum value for range prefix match. - :type min_matching_value: str - :param max_matching_value: maximum value for range prefix match. - :type max_matching_value: str + :vartype object_type: str + :ivar min_matching_value: minimum value for range prefix match. + :vartype min_matching_value: str + :ivar max_matching_value: maximum value for range prefix match. + :vartype max_matching_value: str """ _validation = { @@ -3212,6 +3843,12 @@ def __init__( self, **kwargs ): + """ + :keyword min_matching_value: minimum value for range prefix match. + :paramtype min_matching_value: str + :keyword max_matching_value: maximum value for range prefix match. + :paramtype max_matching_value: str + """ super(RangeBasedItemLevelRestoreCriteria, self).__init__(**kwargs) self.object_type = 'RangeBasedItemLevelRestoreCriteria' # type: str self.min_matching_value = kwargs.get('min_matching_value', None) @@ -3223,23 +3860,23 @@ class RecoveryPointDataStoreDetails(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param creation_time: - :type creation_time: ~datetime.datetime - :param expiry_time: - :type expiry_time: ~datetime.datetime - :param id: - :type id: str - :param meta_data: - :type meta_data: str - :param state: - :type state: str - :param type: - :type type: str - :param visible: - :type visible: bool + :ivar creation_time: + :vartype creation_time: ~datetime.datetime + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar id: + :vartype id: str + :ivar meta_data: + :vartype meta_data: str + :ivar state: + :vartype state: str + :ivar type: + :vartype type: str + :ivar visible: + :vartype visible: bool :ivar rehydration_expiry_time: :vartype rehydration_expiry_time: ~datetime.datetime - :ivar rehydration_status: Possible values include: "CREATE_IN_PROGRESS", "COMPLETED", + :ivar rehydration_status: Possible values include: "CREATE_IN_PROGRESS", "COMPLETED", "DELETE_IN_PROGRESS", "DELETED", "FAILED". :vartype rehydration_status: str or ~azure.mgmt.dataprotection.models.RehydrationStatus """ @@ -3265,6 +3902,22 @@ def __init__( self, **kwargs ): + """ + :keyword creation_time: + :paramtype creation_time: ~datetime.datetime + :keyword expiry_time: + :paramtype expiry_time: ~datetime.datetime + :keyword id: + :paramtype id: str + :keyword meta_data: + :paramtype meta_data: str + :keyword state: + :paramtype state: str + :keyword type: + :paramtype type: str + :keyword visible: + :paramtype visible: bool + """ super(RecoveryPointDataStoreDetails, self).__init__(**kwargs) self.creation_time = kwargs.get('creation_time', None) self.expiry_time = kwargs.get('expiry_time', None) @@ -3280,18 +3933,18 @@ def __init__( class RecoveryPointsFilters(msrest.serialization.Model): """RecoveryPointsFilters. - :param restore_point_data_store_id: - :type restore_point_data_store_id: str - :param is_visible: - :type is_visible: bool - :param start_date: - :type start_date: str - :param end_date: - :type end_date: str - :param extended_info: - :type extended_info: bool - :param restore_point_state: - :type restore_point_state: str + :ivar restore_point_data_store_id: + :vartype restore_point_data_store_id: str + :ivar is_visible: + :vartype is_visible: bool + :ivar start_date: + :vartype start_date: str + :ivar end_date: + :vartype end_date: str + :ivar extended_info: + :vartype extended_info: bool + :ivar restore_point_state: + :vartype restore_point_state: str """ _attribute_map = { @@ -3307,6 +3960,20 @@ def __init__( self, **kwargs ): + """ + :keyword restore_point_data_store_id: + :paramtype restore_point_data_store_id: str + :keyword is_visible: + :paramtype is_visible: bool + :keyword start_date: + :paramtype start_date: str + :keyword end_date: + :paramtype end_date: str + :keyword extended_info: + :paramtype extended_info: bool + :keyword restore_point_state: + :paramtype restore_point_state: str + """ super(RecoveryPointsFilters, self).__init__(**kwargs) self.restore_point_data_store_id = kwargs.get('restore_point_data_store_id', None) self.is_visible = kwargs.get('is_visible', None) @@ -3357,6 +4024,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceGuard, self).__init__(**kwargs) self.provisioning_state = None self.allow_auto_approvals = None @@ -3390,6 +4059,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceGuardOperation, self).__init__(**kwargs) self.vault_critical_operation = None self.request_resource_type = None @@ -3400,25 +4071,25 @@ class ResourceGuardResource(DppTrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: ResourceGuardResource properties. - :type properties: ~azure.mgmt.dataprotection.models.ResourceGuard + :ivar properties: ResourceGuardResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.ResourceGuard """ _validation = { @@ -3444,6 +4115,18 @@ def __init__( self, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: ResourceGuardResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.ResourceGuard + """ super(ResourceGuardResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) @@ -3451,11 +4134,11 @@ def __init__( class ResourceGuardResourceList(DppTrackedResourceList): """List of ResourceGuard resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] """ _attribute_map = { @@ -3467,6 +4150,13 @@ def __init__( self, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] + """ super(ResourceGuardResourceList, self).__init__(**kwargs) self.value = kwargs.get('value', None) @@ -3474,19 +4164,19 @@ def __init__( class ResourceMoveDetails(msrest.serialization.Model): """ResourceMoveDetails will be returned in response to GetResource call from ARM. - :param operation_id: CorrelationId of latest ResourceMove operation attempted. - :type operation_id: str - :param start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 + :ivar operation_id: CorrelationId of latest ResourceMove operation attempted. + :vartype operation_id: str + :ivar start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format. - :type start_time_utc: str - :param completion_time_utc: Completion time in UTC of latest ResourceMove operation attempted. + :vartype start_time_utc: str + :ivar completion_time_utc: Completion time in UTC of latest ResourceMove operation attempted. ISO 8601 format. - :type completion_time_utc: str - :param source_resource_path: ARM resource path of source resource. - :type source_resource_path: str - :param target_resource_path: ARM resource path of target resource used in latest ResourceMove + :vartype completion_time_utc: str + :ivar source_resource_path: ARM resource path of source resource. + :vartype source_resource_path: str + :ivar target_resource_path: ARM resource path of target resource used in latest ResourceMove operation. - :type target_resource_path: str + :vartype target_resource_path: str """ _attribute_map = { @@ -3501,6 +4191,21 @@ def __init__( self, **kwargs ): + """ + :keyword operation_id: CorrelationId of latest ResourceMove operation attempted. + :paramtype operation_id: str + :keyword start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 + format. + :paramtype start_time_utc: str + :keyword completion_time_utc: Completion time in UTC of latest ResourceMove operation + attempted. ISO 8601 format. + :paramtype completion_time_utc: str + :keyword source_resource_path: ARM resource path of source resource. + :paramtype source_resource_path: str + :keyword target_resource_path: ARM resource path of target resource used in latest ResourceMove + operation. + :paramtype target_resource_path: str + """ super(ResourceMoveDetails, self).__init__(**kwargs) self.operation_id = kwargs.get('operation_id', None) self.start_time_utc = kwargs.get('start_time_utc', None) @@ -3514,12 +4219,12 @@ class RestorableTimeRange(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Start time for the available restore range. - :type start_time: str - :param end_time: Required. End time for the available restore range. - :type end_time: str - :param object_type: - :type object_type: str + :ivar start_time: Required. Start time for the available restore range. + :vartype start_time: str + :ivar end_time: Required. End time for the available restore range. + :vartype end_time: str + :ivar object_type: + :vartype object_type: str """ _validation = { @@ -3537,6 +4242,14 @@ def __init__( self, **kwargs ): + """ + :keyword start_time: Required. Start time for the available restore range. + :paramtype start_time: str + :keyword end_time: Required. End time for the available restore range. + :paramtype end_time: str + :keyword object_type: + :paramtype object_type: str + """ super(RestorableTimeRange, self).__init__(**kwargs) self.start_time = kwargs['start_time'] self.end_time = kwargs['end_time'] @@ -3548,16 +4261,16 @@ class RestoreFilesTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param target_details: Required. Destination of RestoreAsFiles operation, when destination is + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar target_details: Required. Destination of RestoreAsFiles operation, when destination is not a datasource. - :type target_details: ~azure.mgmt.dataprotection.models.TargetDetails + :vartype target_details: ~azure.mgmt.dataprotection.models.TargetDetails """ _validation = { @@ -3577,6 +4290,15 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword target_details: Required. Destination of RestoreAsFiles operation, when destination is + not a datasource. + :paramtype target_details: ~azure.mgmt.dataprotection.models.TargetDetails + """ super(RestoreFilesTargetInfo, self).__init__(**kwargs) self.object_type = 'RestoreFilesTargetInfo' # type: str self.target_details = kwargs['target_details'] @@ -3585,10 +4307,10 @@ def __init__( class RestoreJobRecoveryPointDetails(msrest.serialization.Model): """RestoreJobRecoveryPointDetails. - :param recovery_point_id: - :type recovery_point_id: str - :param recovery_point_time: - :type recovery_point_time: ~datetime.datetime + :ivar recovery_point_id: + :vartype recovery_point_id: str + :ivar recovery_point_time: + :vartype recovery_point_time: ~datetime.datetime """ _attribute_map = { @@ -3600,6 +4322,12 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_point_id: + :paramtype recovery_point_id: str + :keyword recovery_point_time: + :paramtype recovery_point_time: ~datetime.datetime + """ super(RestoreJobRecoveryPointDetails, self).__init__(**kwargs) self.recovery_point_id = kwargs.get('recovery_point_id', None) self.recovery_point_time = kwargs.get('recovery_point_time', None) @@ -3610,20 +4338,20 @@ class RestoreTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param datasource_info: Required. Information of target DS. - :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource - :param datasource_set_info: Information of target DS Set. - :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar datasource_info: Required. Information of target DS. + :vartype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar datasource_set_info: Information of target DS Set. + :vartype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials """ _validation = { @@ -3645,6 +4373,19 @@ def __init__( self, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword datasource_info: Required. Information of target DS. + :paramtype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword datasource_set_info: Information of target DS Set. + :paramtype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + """ super(RestoreTargetInfo, self).__init__(**kwargs) self.object_type = 'RestoreTargetInfo' # type: str self.datasource_info = kwargs['datasource_info'] @@ -3663,8 +4404,8 @@ class RetentionTag(msrest.serialization.Model): :vartype e_tag: str :ivar id: Retention Tag version. :vartype id: str - :param tag_name: Required. Retention Tag Name to relate it to retention rule. - :type tag_name: str + :ivar tag_name: Required. Retention Tag Name to relate it to retention rule. + :vartype tag_name: str """ _validation = { @@ -3683,6 +4424,10 @@ def __init__( self, **kwargs ): + """ + :keyword tag_name: Required. Retention Tag Name to relate it to retention rule. + :paramtype tag_name: str + """ super(RetentionTag, self).__init__(**kwargs) self.e_tag = None self.id = None @@ -3694,23 +4439,23 @@ class ScheduleBasedBackupCriteria(BackupCriteria): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / + :vartype object_type: str + :ivar absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" and should be part of AbsoluteMarker enum. - :type absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] - :param days_of_month: This is day of the month from 1 to 28 other wise last of month. - :type days_of_month: list[~azure.mgmt.dataprotection.models.Day] - :param days_of_the_week: It should be Sunday/Monday/T..../Saturday. - :type days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] - :param months_of_year: It should be January/February/....../December. - :type months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] - :param schedule_times: List of schedule times for backup. - :type schedule_times: list[~datetime.datetime] - :param weeks_of_the_month: It should be First/Second/Third/Fourth/Last. - :type weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] + :vartype absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :ivar days_of_month: This is day of the month from 1 to 28 other wise last of month. + :vartype days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :ivar days_of_the_week: It should be Sunday/Monday/T..../Saturday. + :vartype days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] + :ivar months_of_year: It should be January/February/....../December. + :vartype months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :ivar schedule_times: List of schedule times for backup. + :vartype schedule_times: list[~datetime.datetime] + :ivar weeks_of_the_month: It should be First/Second/Third/Fourth/Last. + :vartype weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] """ _validation = { @@ -3731,6 +4476,22 @@ def __init__( self, **kwargs ): + """ + :keyword absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / + "FirstOfWeek" / "FirstOfMonth" + and should be part of AbsoluteMarker enum. + :paramtype absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :keyword days_of_month: This is day of the month from 1 to 28 other wise last of month. + :paramtype days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :keyword days_of_the_week: It should be Sunday/Monday/T..../Saturday. + :paramtype days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] + :keyword months_of_year: It should be January/February/....../December. + :paramtype months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :keyword schedule_times: List of schedule times for backup. + :paramtype schedule_times: list[~datetime.datetime] + :keyword weeks_of_the_month: It should be First/Second/Third/Fourth/Last. + :paramtype weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] + """ super(ScheduleBasedBackupCriteria, self).__init__(**kwargs) self.object_type = 'ScheduleBasedBackupCriteria' # type: str self.absolute_criteria = kwargs.get('absolute_criteria', None) @@ -3746,13 +4507,13 @@ class ScheduleBasedTriggerContext(TriggerContext): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param schedule: Required. Schedule for this backup. - :type schedule: ~azure.mgmt.dataprotection.models.BackupSchedule - :param tagging_criteria: Required. List of tags that can be applicable for given schedule. - :type tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] + :vartype object_type: str + :ivar schedule: Required. Schedule for this backup. + :vartype schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :ivar tagging_criteria: Required. List of tags that can be applicable for given schedule. + :vartype tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] """ _validation = { @@ -3771,6 +4532,12 @@ def __init__( self, **kwargs ): + """ + :keyword schedule: Required. Schedule for this backup. + :paramtype schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :keyword tagging_criteria: Required. List of tags that can be applicable for given schedule. + :paramtype tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] + """ super(ScheduleBasedTriggerContext, self).__init__(**kwargs) self.object_type = 'ScheduleBasedTriggerContext' # type: str self.schedule = kwargs['schedule'] @@ -3782,11 +4549,11 @@ class SecretStoreBasedAuthCredentials(AuthCredentials): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param secret_store_resource: Secret store resource. - :type secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource + :vartype object_type: str + :ivar secret_store_resource: Secret store resource. + :vartype secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource """ _validation = { @@ -3802,6 +4569,10 @@ def __init__( self, **kwargs ): + """ + :keyword secret_store_resource: Secret store resource. + :paramtype secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource + """ super(SecretStoreBasedAuthCredentials, self).__init__(**kwargs) self.object_type = 'SecretStoreBasedAuthCredentials' # type: str self.secret_store_resource = kwargs.get('secret_store_resource', None) @@ -3812,11 +4583,11 @@ class SecretStoreResource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param uri: Uri to get to the resource. - :type uri: str - :param secret_store_type: Required. Gets or sets the type of secret store. Possible values + :ivar uri: Uri to get to the resource. + :vartype uri: str + :ivar secret_store_type: Required. Gets or sets the type of secret store. Possible values include: "Invalid", "AzureKeyVault". - :type secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType + :vartype secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType """ _validation = { @@ -3832,6 +4603,13 @@ def __init__( self, **kwargs ): + """ + :keyword uri: Uri to get to the resource. + :paramtype uri: str + :keyword secret_store_type: Required. Gets or sets the type of secret store. Possible values + include: "Invalid", "AzureKeyVault". + :paramtype secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType + """ super(SecretStoreResource, self).__init__(**kwargs) self.uri = kwargs.get('uri', None) self.secret_store_type = kwargs['secret_store_type'] @@ -3842,12 +4620,12 @@ class SourceLifeCycle(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param delete_after: Required. Delete Option. - :type delete_after: ~azure.mgmt.dataprotection.models.DeleteOption - :param source_data_store: Required. DataStoreInfo base. - :type source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase - :param target_data_store_copy_settings: - :type target_data_store_copy_settings: + :ivar delete_after: Required. Delete Option. + :vartype delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :ivar source_data_store: Required. DataStoreInfo base. + :vartype source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar target_data_store_copy_settings: + :vartype target_data_store_copy_settings: list[~azure.mgmt.dataprotection.models.TargetCopySetting] """ @@ -3866,6 +4644,15 @@ def __init__( self, **kwargs ): + """ + :keyword delete_after: Required. Delete Option. + :paramtype delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :keyword source_data_store: Required. DataStoreInfo base. + :paramtype source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :keyword target_data_store_copy_settings: + :paramtype target_data_store_copy_settings: + list[~azure.mgmt.dataprotection.models.TargetCopySetting] + """ super(SourceLifeCycle, self).__init__(**kwargs) self.delete_after = kwargs['delete_after'] self.source_data_store = kwargs['source_data_store'] @@ -3875,12 +4662,11 @@ def __init__( class StorageSetting(msrest.serialization.Model): """Storage setting. - :param datastore_type: Gets or sets the type of the datastore. Possible values include: + :ivar datastore_type: Gets or sets the type of the datastore. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes - :param type: Gets or sets the type. Possible values include: "GeoRedundant", - "LocallyRedundant". - :type type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + :vartype datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :ivar type: Gets or sets the type. Possible values include: "GeoRedundant", "LocallyRedundant". + :vartype type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes """ _attribute_map = { @@ -3892,6 +4678,14 @@ def __init__( self, **kwargs ): + """ + :keyword datastore_type: Gets or sets the type of the datastore. Possible values include: + "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :keyword type: Gets or sets the type. Possible values include: "GeoRedundant", + "LocallyRedundant". + :paramtype type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + """ super(StorageSetting, self).__init__(**kwargs) self.datastore_type = kwargs.get('datastore_type', None) self.type = kwargs.get('type', None) @@ -3900,13 +4694,13 @@ def __init__( class SupportedFeature(msrest.serialization.Model): """Elements class for feature request. - :param feature_name: support feature type. - :type feature_name: str - :param support_status: feature support status. Possible values include: "Invalid", + :ivar feature_name: support feature type. + :vartype feature_name: str + :ivar support_status: feature support status. Possible values include: "Invalid", "NotSupported", "AlphaPreview", "PrivatePreview", "PublicPreview", "GenerallyAvailable". - :type support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus - :param exposure_controlled_features: support feature type. - :type exposure_controlled_features: list[str] + :vartype support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :ivar exposure_controlled_features: support feature type. + :vartype exposure_controlled_features: list[str] """ _attribute_map = { @@ -3919,6 +4713,15 @@ def __init__( self, **kwargs ): + """ + :keyword feature_name: support feature type. + :paramtype feature_name: str + :keyword support_status: feature support status. Possible values include: "Invalid", + "NotSupported", "AlphaPreview", "PrivatePreview", "PublicPreview", "GenerallyAvailable". + :paramtype support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :keyword exposure_controlled_features: support feature type. + :paramtype exposure_controlled_features: list[str] + """ super(SupportedFeature, self).__init__(**kwargs) self.feature_name = kwargs.get('feature_name', None) self.support_status = kwargs.get('support_status', None) @@ -3928,20 +4731,20 @@ def __init__( 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.dataprotection.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.dataprotection.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.dataprotection.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.dataprotection.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -3957,6 +4760,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.dataprotection.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.dataprotection.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) @@ -3971,14 +4790,14 @@ class TaggingCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param criteria: Criteria which decides whether the tag can be applied to a triggered backup. - :type criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] - :param is_default: Required. Specifies if tag is default. - :type is_default: bool - :param tagging_priority: Required. Retention Tag priority. - :type tagging_priority: long - :param tag_info: Required. Retention tag information. - :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + :ivar criteria: Criteria which decides whether the tag can be applied to a triggered backup. + :vartype criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :ivar is_default: Required. Specifies if tag is default. + :vartype is_default: bool + :ivar tagging_priority: Required. Retention Tag priority. + :vartype tagging_priority: long + :ivar tag_info: Required. Retention tag information. + :vartype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag """ _validation = { @@ -3998,6 +4817,16 @@ def __init__( self, **kwargs ): + """ + :keyword criteria: Criteria which decides whether the tag can be applied to a triggered backup. + :paramtype criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :keyword is_default: Required. Specifies if tag is default. + :paramtype is_default: bool + :keyword tagging_priority: Required. Retention Tag priority. + :paramtype tagging_priority: long + :keyword tag_info: Required. Retention tag information. + :paramtype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ super(TaggingCriteria, self).__init__(**kwargs) self.criteria = kwargs.get('criteria', None) self.is_default = kwargs['is_default'] @@ -4010,10 +4839,10 @@ class TargetCopySetting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. - :type copy_after: ~azure.mgmt.dataprotection.models.CopyOption - :param data_store: Required. Info of target datastore. - :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. + :vartype copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :ivar data_store: Required. Info of target datastore. + :vartype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase """ _validation = { @@ -4030,6 +4859,12 @@ def __init__( self, **kwargs ): + """ + :keyword copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. + :paramtype copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :keyword data_store: Required. Info of target datastore. + :paramtype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + """ super(TargetCopySetting, self).__init__(**kwargs) self.copy_after = kwargs['copy_after'] self.data_store = kwargs['data_store'] @@ -4040,20 +4875,20 @@ class TargetDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param file_prefix: Required. Restore operation may create multiple files inside location + :ivar file_prefix: Required. Restore operation may create multiple files inside location pointed by Url Below will be the common prefix for all of them. - :type file_prefix: str - :param restore_target_location_type: Required. Denotes the target location where the data will + :vartype file_prefix: str + :ivar restore_target_location_type: Required. Denotes the target location where the data will be restored, string value for the enum {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. Possible values include: "Invalid", "AzureBlobs", "AzureFiles". - :type restore_target_location_type: str or + :vartype restore_target_location_type: str or ~azure.mgmt.dataprotection.models.RestoreTargetLocationType - :param url: Required. Url denoting the restore destination. It can point to container / file + :ivar url: Required. Url denoting the restore destination. It can point to container / file share etc. - :type url: str + :vartype url: str """ _validation = { @@ -4072,6 +4907,22 @@ def __init__( self, **kwargs ): + """ + :keyword file_prefix: Required. Restore operation may create multiple files inside location + pointed by Url + Below will be the common prefix for all of them. + :paramtype file_prefix: str + :keyword restore_target_location_type: Required. Denotes the target location where the data + will be restored, + string value for the enum + {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. + Possible values include: "Invalid", "AzureBlobs", "AzureFiles". + :paramtype restore_target_location_type: str or + ~azure.mgmt.dataprotection.models.RestoreTargetLocationType + :keyword url: Required. Url denoting the restore destination. It can point to container / file + share etc. + :paramtype url: str + """ super(TargetDetails, self).__init__(**kwargs) self.file_prefix = kwargs['file_prefix'] self.restore_target_location_type = kwargs['restore_target_location_type'] @@ -4083,9 +4934,9 @@ class TriggerBackupRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param backup_rule_options: Required. Name for the Rule of the Policy which needs to be applied + :ivar backup_rule_options: Required. Name for the Rule of the Policy which needs to be applied for this backup. - :type backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + :vartype backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions """ _validation = { @@ -4100,6 +4951,11 @@ def __init__( self, **kwargs ): + """ + :keyword backup_rule_options: Required. Name for the Rule of the Policy which needs to be + applied for this backup. + :paramtype backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + """ super(TriggerBackupRequest, self).__init__(**kwargs) self.backup_rule_options = kwargs['backup_rule_options'] @@ -4107,24 +4963,24 @@ def __init__( class UserFacingError(msrest.serialization.Model): """Error object used by layers that have access to localized content, and propagate that to user. - :param code: Unique code for this error. - :type code: str - :param details: Additional related Errors. - :type details: list[~azure.mgmt.dataprotection.models.UserFacingError] - :param inner_error: Inner Error. - :type inner_error: ~azure.mgmt.dataprotection.models.InnerError - :param is_retryable: Whether the operation will be retryable or not. - :type is_retryable: bool - :param is_user_error: Whether the operation is due to a user error or service error. - :type is_user_error: bool - :param properties: Any key value pairs that can be injected inside error object. - :type properties: dict[str, str] - :param message: - :type message: str - :param recommended_action: RecommendedAction � localized. - :type recommended_action: list[str] - :param target: Target of the error. - :type target: str + :ivar code: Unique code for this error. + :vartype code: str + :ivar details: Additional related Errors. + :vartype details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :ivar inner_error: Inner Error. + :vartype inner_error: ~azure.mgmt.dataprotection.models.InnerError + :ivar is_retryable: Whether the operation will be retryable or not. + :vartype is_retryable: bool + :ivar is_user_error: Whether the operation is due to a user error or service error. + :vartype is_user_error: bool + :ivar properties: Any key value pairs that can be injected inside error object. + :vartype properties: dict[str, str] + :ivar message: + :vartype message: str + :ivar recommended_action: RecommendedAction � localized. + :vartype recommended_action: list[str] + :ivar target: Target of the error. + :vartype target: str """ _attribute_map = { @@ -4143,6 +4999,26 @@ def __init__( self, **kwargs ): + """ + :keyword code: Unique code for this error. + :paramtype code: str + :keyword details: Additional related Errors. + :paramtype details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :keyword inner_error: Inner Error. + :paramtype inner_error: ~azure.mgmt.dataprotection.models.InnerError + :keyword is_retryable: Whether the operation will be retryable or not. + :paramtype is_retryable: bool + :keyword is_user_error: Whether the operation is due to a user error or service error. + :paramtype is_user_error: bool + :keyword properties: Any key value pairs that can be injected inside error object. + :paramtype properties: dict[str, str] + :keyword message: + :paramtype message: str + :keyword recommended_action: RecommendedAction � localized. + :paramtype recommended_action: list[str] + :keyword target: Target of the error. + :paramtype target: str + """ super(UserFacingError, self).__init__(**kwargs) self.code = kwargs.get('code', None) self.details = kwargs.get('details', None) @@ -4160,8 +5036,8 @@ class ValidateForBackupRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param backup_instance: Required. Backup Instance. - :type backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + :ivar backup_instance: Required. Backup Instance. + :vartype backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance """ _validation = { @@ -4176,6 +5052,10 @@ def __init__( self, **kwargs ): + """ + :keyword backup_instance: Required. Backup Instance. + :paramtype backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + """ super(ValidateForBackupRequest, self).__init__(**kwargs) self.backup_instance = kwargs['backup_instance'] @@ -4185,8 +5065,8 @@ class ValidateRestoreRequestObject(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param restore_request_object: Required. Gets or sets the restore request object. - :type restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + :ivar restore_request_object: Required. Gets or sets the restore request object. + :vartype restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest """ _validation = { @@ -4201,5 +5081,9 @@ def __init__( self, **kwargs ): + """ + :keyword restore_request_object: Required. Gets or sets the restore request object. + :paramtype restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + """ super(ValidateRestoreRequestObject, self).__init__(**kwargs) self.restore_request_object = kwargs['restore_request_object'] diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py index 27867c12c61d..2f22288f7812 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/models/_models_py3.py @@ -22,11 +22,11 @@ class DeleteOption(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param duration: Required. Duration of deletion after given timespan. - :type duration: str - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar duration: Required. Duration of deletion after given timespan. + :vartype duration: str + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -49,6 +49,10 @@ def __init__( duration: str, **kwargs ): + """ + :keyword duration: Required. Duration of deletion after given timespan. + :paramtype duration: str + """ super(DeleteOption, self).__init__(**kwargs) self.duration = duration self.object_type = None # type: Optional[str] @@ -59,11 +63,11 @@ class AbsoluteDeleteOption(DeleteOption): All required parameters must be populated in order to send to Azure. - :param duration: Required. Duration of deletion after given timespan. - :type duration: str - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar duration: Required. Duration of deletion after given timespan. + :vartype duration: str + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -82,6 +86,10 @@ def __init__( duration: str, **kwargs ): + """ + :keyword duration: Required. Duration of deletion after given timespan. + :paramtype duration: str + """ super(AbsoluteDeleteOption, self).__init__(duration=duration, **kwargs) self.object_type = 'AbsoluteDeleteOption' # type: str @@ -91,10 +99,10 @@ class AdHocBackupRuleOptions(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param rule_name: Required. - :type rule_name: str - :param trigger_option: Required. Adhoc backup trigger option. - :type trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + :ivar rule_name: Required. + :vartype rule_name: str + :ivar trigger_option: Required. Adhoc backup trigger option. + :vartype trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption """ _validation = { @@ -114,6 +122,12 @@ def __init__( trigger_option: "AdhocBackupTriggerOption", **kwargs ): + """ + :keyword rule_name: Required. + :paramtype rule_name: str + :keyword trigger_option: Required. Adhoc backup trigger option. + :paramtype trigger_option: ~azure.mgmt.dataprotection.models.AdhocBackupTriggerOption + """ super(AdHocBackupRuleOptions, self).__init__(**kwargs) self.rule_name = rule_name self.trigger_option = trigger_option @@ -122,8 +136,8 @@ def __init__( class AdhocBackupTriggerOption(msrest.serialization.Model): """Adhoc backup trigger option. - :param retention_tag_override: - :type retention_tag_override: str + :ivar retention_tag_override: + :vartype retention_tag_override: str """ _attribute_map = { @@ -136,6 +150,10 @@ def __init__( retention_tag_override: Optional[str] = None, **kwargs ): + """ + :keyword retention_tag_override: + :paramtype retention_tag_override: str + """ super(AdhocBackupTriggerOption, self).__init__(**kwargs) self.retention_tag_override = retention_tag_override @@ -143,8 +161,8 @@ def __init__( class AdhocBasedTaggingCriteria(msrest.serialization.Model): """Adhoc backup tagging criteria. - :param tag_info: Retention tag information. - :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + :ivar tag_info: Retention tag information. + :vartype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag """ _attribute_map = { @@ -157,6 +175,10 @@ def __init__( tag_info: Optional["RetentionTag"] = None, **kwargs ): + """ + :keyword tag_info: Retention tag information. + :paramtype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ super(AdhocBasedTaggingCriteria, self).__init__(**kwargs) self.tag_info = tag_info @@ -169,9 +191,9 @@ class TriggerContext(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -190,6 +212,8 @@ def __init__( self, **kwargs ): + """ + """ super(TriggerContext, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -199,11 +223,11 @@ class AdhocBasedTriggerContext(TriggerContext): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc backup. - :type tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + :vartype object_type: str + :ivar tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc backup. + :vartype tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria """ _validation = { @@ -222,6 +246,11 @@ def __init__( tagging_criteria: "AdhocBasedTaggingCriteria", **kwargs ): + """ + :keyword tagging_criteria: Required. Tagging Criteria containing retention tag for adhoc + backup. + :paramtype tagging_criteria: ~azure.mgmt.dataprotection.models.AdhocBasedTaggingCriteria + """ super(AdhocBasedTriggerContext, self).__init__(**kwargs) self.object_type = 'AdhocBasedTriggerContext' # type: str self.tagging_criteria = tagging_criteria @@ -235,9 +264,9 @@ class AuthCredentials(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -256,6 +285,8 @@ def __init__( self, **kwargs ): + """ + """ super(AuthCredentials, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -268,8 +299,8 @@ class AzureBackupRecoveryPoint(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -288,6 +319,8 @@ def __init__( self, **kwargs ): + """ + """ super(AzureBackupRecoveryPoint, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -297,27 +330,27 @@ class AzureBackupDiscreteRecoveryPoint(AzureBackupRecoveryPoint): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param friendly_name: - :type friendly_name: str - :param recovery_point_data_stores_details: - :type recovery_point_data_stores_details: + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar friendly_name: + :vartype friendly_name: str + :ivar recovery_point_data_stores_details: + :vartype recovery_point_data_stores_details: list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] - :param recovery_point_time: Required. - :type recovery_point_time: ~datetime.datetime - :param policy_name: - :type policy_name: str - :param policy_version: - :type policy_version: str - :param recovery_point_id: - :type recovery_point_id: str - :param recovery_point_type: - :type recovery_point_type: str - :param retention_tag_name: - :type retention_tag_name: str - :param retention_tag_version: - :type retention_tag_version: str + :ivar recovery_point_time: Required. + :vartype recovery_point_time: ~datetime.datetime + :ivar policy_name: + :vartype policy_name: str + :ivar policy_version: + :vartype policy_version: str + :ivar recovery_point_id: + :vartype recovery_point_id: str + :ivar recovery_point_type: + :vartype recovery_point_type: str + :ivar retention_tag_name: + :vartype retention_tag_name: str + :ivar retention_tag_version: + :vartype retention_tag_version: str """ _validation = { @@ -352,6 +385,27 @@ def __init__( retention_tag_version: Optional[str] = None, **kwargs ): + """ + :keyword friendly_name: + :paramtype friendly_name: str + :keyword recovery_point_data_stores_details: + :paramtype recovery_point_data_stores_details: + list[~azure.mgmt.dataprotection.models.RecoveryPointDataStoreDetails] + :keyword recovery_point_time: Required. + :paramtype recovery_point_time: ~datetime.datetime + :keyword policy_name: + :paramtype policy_name: str + :keyword policy_version: + :paramtype policy_version: str + :keyword recovery_point_id: + :paramtype recovery_point_id: str + :keyword recovery_point_type: + :paramtype recovery_point_type: str + :keyword retention_tag_name: + :paramtype retention_tag_name: str + :keyword retention_tag_version: + :paramtype retention_tag_version: str + """ super(AzureBackupDiscreteRecoveryPoint, self).__init__(**kwargs) self.object_type = 'AzureBackupDiscreteRecoveryPoint' # type: str self.friendly_name = friendly_name @@ -370,14 +424,14 @@ class AzureBackupFindRestorableTimeRangesRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type source_data_store_type: str or + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType - :param start_time: Start time for the List Restore Ranges request. ISO 8601 format. - :type start_time: str - :param end_time: End time for the List Restore Ranges request. ISO 8601 format. - :type end_time: str + :ivar start_time: Start time for the List Restore Ranges request. ISO 8601 format. + :vartype start_time: str + :ivar end_time: End time for the List Restore Ranges request. ISO 8601 format. + :vartype end_time: str """ _validation = { @@ -398,6 +452,16 @@ def __init__( end_time: Optional[str] = None, **kwargs ): + """ + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype source_data_store_type: str or + ~azure.mgmt.dataprotection.models.RestoreSourceDataStoreType + :keyword start_time: Start time for the List Restore Ranges request. ISO 8601 format. + :paramtype start_time: str + :keyword end_time: End time for the List Restore Ranges request. ISO 8601 format. + :paramtype end_time: str + """ super(AzureBackupFindRestorableTimeRangesRequest, self).__init__(**kwargs) self.source_data_store_type = source_data_store_type self.start_time = start_time @@ -407,21 +471,21 @@ def __init__( class DppWorkerRequest(msrest.serialization.Model): """DppWorkerRequest. - :param subscription_id: - :type subscription_id: str - :param uri: - :type uri: str - :param headers: Dictionary of + :ivar subscription_id: + :vartype subscription_id: str + :ivar uri: + :vartype uri: str + :ivar headers: Dictionary of . - :type headers: dict[str, list[str]] - :param supported_group_versions: - :type supported_group_versions: list[str] - :param culture_info: - :type culture_info: str - :param parameters: Dictionary of :code:``. - :type parameters: dict[str, str] - :param http_method: - :type http_method: str + :vartype headers: dict[str, list[str]] + :ivar supported_group_versions: + :vartype supported_group_versions: list[str] + :ivar culture_info: + :vartype culture_info: str + :ivar parameters: Dictionary of :code:``. + :vartype parameters: dict[str, str] + :ivar http_method: + :vartype http_method: str """ _attribute_map = { @@ -446,6 +510,23 @@ def __init__( http_method: Optional[str] = None, **kwargs ): + """ + :keyword subscription_id: + :paramtype subscription_id: str + :keyword uri: + :paramtype uri: str + :keyword headers: Dictionary of + . + :paramtype headers: dict[str, list[str]] + :keyword supported_group_versions: + :paramtype supported_group_versions: list[str] + :keyword culture_info: + :paramtype culture_info: str + :keyword parameters: Dictionary of :code:``. + :paramtype parameters: dict[str, str] + :keyword http_method: + :paramtype http_method: str + """ super(DppWorkerRequest, self).__init__(**kwargs) self.subscription_id = subscription_id self.uri = uri @@ -459,23 +540,23 @@ def __init__( class AzureBackupFindRestorableTimeRangesRequestResource(DppWorkerRequest): """List Restore Ranges Request. - :param subscription_id: - :type subscription_id: str - :param uri: - :type uri: str - :param headers: Dictionary of + :ivar subscription_id: + :vartype subscription_id: str + :ivar uri: + :vartype uri: str + :ivar headers: Dictionary of . - :type headers: dict[str, list[str]] - :param supported_group_versions: - :type supported_group_versions: list[str] - :param culture_info: - :type culture_info: str - :param parameters: Dictionary of :code:``. - :type parameters: dict[str, str] - :param http_method: - :type http_method: str - :param content: AzureBackupFindRestorableTimeRangesRequestResource content. - :type content: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + :vartype headers: dict[str, list[str]] + :ivar supported_group_versions: + :vartype supported_group_versions: list[str] + :ivar culture_info: + :vartype culture_info: str + :ivar parameters: Dictionary of :code:``. + :vartype parameters: dict[str, str] + :ivar http_method: + :vartype http_method: str + :ivar content: AzureBackupFindRestorableTimeRangesRequestResource content. + :vartype content: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest """ _attribute_map = { @@ -502,6 +583,26 @@ def __init__( content: Optional["AzureBackupFindRestorableTimeRangesRequest"] = None, **kwargs ): + """ + :keyword subscription_id: + :paramtype subscription_id: str + :keyword uri: + :paramtype uri: str + :keyword headers: Dictionary of + . + :paramtype headers: dict[str, list[str]] + :keyword supported_group_versions: + :paramtype supported_group_versions: list[str] + :keyword culture_info: + :paramtype culture_info: str + :keyword parameters: Dictionary of :code:``. + :paramtype parameters: dict[str, str] + :keyword http_method: + :paramtype http_method: str + :keyword content: AzureBackupFindRestorableTimeRangesRequestResource content. + :paramtype content: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesRequest + """ super(AzureBackupFindRestorableTimeRangesRequestResource, self).__init__(subscription_id=subscription_id, uri=uri, headers=headers, supported_group_versions=supported_group_versions, culture_info=culture_info, parameters=parameters, http_method=http_method, **kwargs) self.content = content @@ -509,10 +610,10 @@ def __init__( class AzureBackupFindRestorableTimeRangesResponse(msrest.serialization.Model): """List Restore Ranges Response. - :param restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. - :type restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] - :param object_type: - :type object_type: str + :ivar restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. + :vartype restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :ivar object_type: + :vartype object_type: str """ _attribute_map = { @@ -527,6 +628,12 @@ def __init__( object_type: Optional[str] = None, **kwargs ): + """ + :keyword restorable_time_ranges: Returns the Restore Ranges available on the Backup Instance. + :paramtype restorable_time_ranges: list[~azure.mgmt.dataprotection.models.RestorableTimeRange] + :keyword object_type: + :paramtype object_type: str + """ super(AzureBackupFindRestorableTimeRangesResponse, self).__init__(**kwargs) self.restorable_time_ranges = restorable_time_ranges self.object_type = object_type @@ -566,6 +673,8 @@ def __init__( self, **kwargs ): + """ + """ super(DppResource, self).__init__(**kwargs) self.id = None self.name = None @@ -587,8 +696,9 @@ class AzureBackupFindRestorableTimeRangesResponseResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupFindRestorableTimeRangesResponseResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + :ivar properties: AzureBackupFindRestorableTimeRangesResponseResource properties. + :vartype properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse """ _validation = { @@ -612,6 +722,11 @@ def __init__( properties: Optional["AzureBackupFindRestorableTimeRangesResponse"] = None, **kwargs ): + """ + :keyword properties: AzureBackupFindRestorableTimeRangesResponseResource properties. + :paramtype properties: + ~azure.mgmt.dataprotection.models.AzureBackupFindRestorableTimeRangesResponse + """ super(AzureBackupFindRestorableTimeRangesResponseResource, self).__init__(**kwargs) self.properties = properties @@ -623,71 +738,71 @@ class AzureBackupJob(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param activity_id: Required. Job Activity Id. - :type activity_id: str - :param backup_instance_friendly_name: Required. Name of the Backup Instance. - :type backup_instance_friendly_name: str + :ivar activity_id: Required. Job Activity Id. + :vartype activity_id: str + :ivar backup_instance_friendly_name: Required. Name of the Backup Instance. + :vartype backup_instance_friendly_name: str :ivar backup_instance_id: ARM ID of the Backup Instance. :vartype backup_instance_id: str - :param data_source_id: Required. ARM ID of the DataSource. - :type data_source_id: str - :param data_source_location: Required. Location of the DataSource. - :type data_source_location: str - :param data_source_name: Required. User Friendly Name of the DataSource. - :type data_source_name: str - :param data_source_set_name: Data Source Set Name of the DataSource. - :type data_source_set_name: str - :param data_source_type: Required. Type of DataSource. - :type data_source_type: str - :param duration: Total run time of the job. ISO 8601 format. - :type duration: str + :ivar data_source_id: Required. ARM ID of the DataSource. + :vartype data_source_id: str + :ivar data_source_location: Required. Location of the DataSource. + :vartype data_source_location: str + :ivar data_source_name: Required. User Friendly Name of the DataSource. + :vartype data_source_name: str + :ivar data_source_set_name: Data Source Set Name of the DataSource. + :vartype data_source_set_name: str + :ivar data_source_type: Required. Type of DataSource. + :vartype data_source_type: str + :ivar duration: Total run time of the job. ISO 8601 format. + :vartype duration: str :ivar end_time: EndTime of the job(in UTC). :vartype end_time: ~datetime.datetime :ivar error_details: A List, detailing the errors related to the job. :vartype error_details: list[~azure.mgmt.dataprotection.models.UserFacingError] :ivar extended_info: Extended Information about the job. :vartype extended_info: ~azure.mgmt.dataprotection.models.JobExtendedInfo - :param is_user_triggered: Required. Indicated that whether the job is adhoc(true) or + :ivar is_user_triggered: Required. Indicated that whether the job is adhoc(true) or scheduled(false). - :type is_user_triggered: bool - :param operation: Required. It indicates the type of Job i.e. Backup:full/log/diff + :vartype is_user_triggered: bool + :ivar operation: Required. It indicates the type of Job i.e. Backup:full/log/diff ;Restore:ALR/OLR; Tiering:Backup/Archive ; Management:ConfigureProtection/UnConfigure. - :type operation: str - :param operation_category: Required. It indicates the type of Job i.e. + :vartype operation: str + :ivar operation_category: Required. It indicates the type of Job i.e. Backup/Restore/Tiering/Management. - :type operation_category: str + :vartype operation_category: str :ivar policy_id: ARM ID of the policy. :vartype policy_id: str :ivar policy_name: Name of the policy. :vartype policy_name: str - :param progress_enabled: Required. Indicated whether progress is enabled for the job. - :type progress_enabled: bool + :ivar progress_enabled: Required. Indicated whether progress is enabled for the job. + :vartype progress_enabled: bool :ivar progress_url: Url which contains job's progress. :vartype progress_url: str :ivar restore_type: It indicates the sub type of operation i.e. in case of Restore it can be ALR/OLR. :vartype restore_type: str - :param source_resource_group: Required. Resource Group Name of the Datasource. - :type source_resource_group: str - :param source_subscription_id: Required. SubscriptionId corresponding to the DataSource. - :type source_subscription_id: str - :param start_time: Required. StartTime of the job(in UTC). - :type start_time: ~datetime.datetime - :param status: Required. Status of the job like + :ivar source_resource_group: Required. Resource Group Name of the Datasource. + :vartype source_resource_group: str + :ivar source_subscription_id: Required. SubscriptionId corresponding to the DataSource. + :vartype source_subscription_id: str + :ivar start_time: Required. StartTime of the job(in UTC). + :vartype start_time: ~datetime.datetime + :ivar status: Required. Status of the job like InProgress/Success/Failed/Cancelled/SuccessWithWarning. - :type status: str - :param subscription_id: Required. Subscription Id of the corresponding backup vault. - :type subscription_id: str - :param supported_actions: Required. List of supported actions. - :type supported_actions: list[str] - :param vault_name: Required. Name of the vault. - :type vault_name: str - :param etag: - :type etag: str - :param source_data_store_name: - :type source_data_store_name: str - :param destination_data_store_name: - :type destination_data_store_name: str + :vartype status: str + :ivar subscription_id: Required. Subscription Id of the corresponding backup vault. + :vartype subscription_id: str + :ivar supported_actions: Required. List of supported actions. + :vartype supported_actions: list[str] + :ivar vault_name: Required. Name of the vault. + :vartype vault_name: str + :ivar etag: + :vartype etag: str + :ivar source_data_store_name: + :vartype source_data_store_name: str + :ivar destination_data_store_name: + :vartype destination_data_store_name: str """ _validation = { @@ -778,6 +893,56 @@ def __init__( destination_data_store_name: Optional[str] = None, **kwargs ): + """ + :keyword activity_id: Required. Job Activity Id. + :paramtype activity_id: str + :keyword backup_instance_friendly_name: Required. Name of the Backup Instance. + :paramtype backup_instance_friendly_name: str + :keyword data_source_id: Required. ARM ID of the DataSource. + :paramtype data_source_id: str + :keyword data_source_location: Required. Location of the DataSource. + :paramtype data_source_location: str + :keyword data_source_name: Required. User Friendly Name of the DataSource. + :paramtype data_source_name: str + :keyword data_source_set_name: Data Source Set Name of the DataSource. + :paramtype data_source_set_name: str + :keyword data_source_type: Required. Type of DataSource. + :paramtype data_source_type: str + :keyword duration: Total run time of the job. ISO 8601 format. + :paramtype duration: str + :keyword is_user_triggered: Required. Indicated that whether the job is adhoc(true) or + scheduled(false). + :paramtype is_user_triggered: bool + :keyword operation: Required. It indicates the type of Job i.e. Backup:full/log/diff + ;Restore:ALR/OLR; Tiering:Backup/Archive ; Management:ConfigureProtection/UnConfigure. + :paramtype operation: str + :keyword operation_category: Required. It indicates the type of Job i.e. + Backup/Restore/Tiering/Management. + :paramtype operation_category: str + :keyword progress_enabled: Required. Indicated whether progress is enabled for the job. + :paramtype progress_enabled: bool + :keyword source_resource_group: Required. Resource Group Name of the Datasource. + :paramtype source_resource_group: str + :keyword source_subscription_id: Required. SubscriptionId corresponding to the DataSource. + :paramtype source_subscription_id: str + :keyword start_time: Required. StartTime of the job(in UTC). + :paramtype start_time: ~datetime.datetime + :keyword status: Required. Status of the job like + InProgress/Success/Failed/Cancelled/SuccessWithWarning. + :paramtype status: str + :keyword subscription_id: Required. Subscription Id of the corresponding backup vault. + :paramtype subscription_id: str + :keyword supported_actions: Required. List of supported actions. + :paramtype supported_actions: list[str] + :keyword vault_name: Required. Name of the vault. + :paramtype vault_name: str + :keyword etag: + :paramtype etag: str + :keyword source_data_store_name: + :paramtype source_data_store_name: str + :keyword destination_data_store_name: + :paramtype destination_data_store_name: str + """ super(AzureBackupJob, self).__init__(**kwargs) self.activity_id = activity_id self.backup_instance_friendly_name = backup_instance_friendly_name @@ -825,8 +990,8 @@ class AzureBackupJobResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupJobResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + :ivar properties: AzureBackupJobResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.AzureBackupJob """ _validation = { @@ -850,6 +1015,10 @@ def __init__( properties: Optional["AzureBackupJob"] = None, **kwargs ): + """ + :keyword properties: AzureBackupJobResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.AzureBackupJob + """ super(AzureBackupJobResource, self).__init__(**kwargs) self.properties = properties @@ -857,9 +1026,9 @@ def __init__( class DppResourceList(msrest.serialization.Model): """ListResource. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -872,6 +1041,11 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppResourceList, self).__init__(**kwargs) self.next_link = next_link @@ -879,11 +1053,11 @@ def __init__( class AzureBackupJobResourceList(DppResourceList): """List of AzureBackup Job resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] """ _attribute_map = { @@ -898,6 +1072,13 @@ def __init__( value: Optional[List["AzureBackupJobResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.AzureBackupJobResource] + """ super(AzureBackupJobResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -910,9 +1091,9 @@ class BackupParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -931,6 +1112,8 @@ def __init__( self, **kwargs ): + """ + """ super(BackupParameters, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -940,11 +1123,11 @@ class AzureBackupParams(BackupParameters): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param backup_type: Required. BackupType ; Full/Incremental etc. - :type backup_type: str + :vartype object_type: str + :ivar backup_type: Required. BackupType ; Full/Incremental etc. + :vartype backup_type: str """ _validation = { @@ -963,6 +1146,10 @@ def __init__( backup_type: str, **kwargs ): + """ + :keyword backup_type: Required. BackupType ; Full/Incremental etc. + :paramtype backup_type: str + """ super(AzureBackupParams, self).__init__(**kwargs) self.object_type = 'AzureBackupParams' # type: str self.backup_type = backup_type @@ -976,13 +1163,13 @@ class AzureBackupRestoreRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType """ _validation = { @@ -1008,6 +1195,13 @@ def __init__( source_data_store_type: Union[str, "SourceDataStoreType"], **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + """ super(AzureBackupRestoreRequest, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.restore_target_info = restore_target_info @@ -1022,15 +1216,15 @@ class AzureBackupRecoveryPointBasedRestoreRequest(AzureBackupRestoreRequest): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_id: Required. - :type recovery_point_id: str + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_id: Required. + :vartype recovery_point_id: str """ _validation = { @@ -1059,6 +1253,15 @@ def __init__( recovery_point_id: str, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_id: Required. + :paramtype recovery_point_id: str + """ super(AzureBackupRecoveryPointBasedRestoreRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, **kwargs) self.object_type = 'AzureBackupRecoveryPointBasedRestoreRequest' # type: str self.recovery_point_id = recovery_point_id @@ -1078,8 +1281,8 @@ class AzureBackupRecoveryPointResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: AzureBackupRecoveryPointResource properties. - :type properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + :ivar properties: AzureBackupRecoveryPointResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint """ _validation = { @@ -1103,6 +1306,10 @@ def __init__( properties: Optional["AzureBackupRecoveryPoint"] = None, **kwargs ): + """ + :keyword properties: AzureBackupRecoveryPointResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.AzureBackupRecoveryPoint + """ super(AzureBackupRecoveryPointResource, self).__init__(**kwargs) self.properties = properties @@ -1110,11 +1317,11 @@ def __init__( class AzureBackupRecoveryPointResourceList(DppResourceList): """Azure backup recoveryPoint resource list. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] """ _attribute_map = { @@ -1129,6 +1336,13 @@ def __init__( value: Optional[List["AzureBackupRecoveryPointResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResource] + """ super(AzureBackupRecoveryPointResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -1138,16 +1352,16 @@ class AzureBackupRecoveryTimeBasedRestoreRequest(AzureBackupRestoreRequest): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_time: Required. The recovery time in ISO 8601 format example - + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_time: Required. The recovery time in ISO 8601 format example - 2020-08-14T17:30:00.0000000Z. - :type recovery_point_time: str + :vartype recovery_point_time: str """ _validation = { @@ -1172,6 +1386,16 @@ def __init__( recovery_point_time: str, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_time: Required. The recovery time in ISO 8601 format example - + 2020-08-14T17:30:00.0000000Z. + :paramtype recovery_point_time: str + """ super(AzureBackupRecoveryTimeBasedRestoreRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, **kwargs) self.object_type = 'AzureBackupRecoveryTimeBasedRestoreRequest' # type: str self.recovery_point_time = recovery_point_time @@ -1182,14 +1406,14 @@ class AzureBackupRehydrationRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param recovery_point_id: Required. Id of the recovery point to be recovered. - :type recovery_point_id: str - :param rehydration_priority: Priority to be used for rehydration. Values High or Standard. + :ivar recovery_point_id: Required. Id of the recovery point to be recovered. + :vartype recovery_point_id: str + :ivar rehydration_priority: Priority to be used for rehydration. Values High or Standard. Possible values include: "Invalid", "High", "Standard". - :type rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority - :param rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D + :vartype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :ivar rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D . - :type rehydration_retention_duration: str + :vartype rehydration_retention_duration: str """ _validation = { @@ -1211,6 +1435,16 @@ def __init__( rehydration_priority: Optional[Union[str, "RehydrationPriority"]] = None, **kwargs ): + """ + :keyword recovery_point_id: Required. Id of the recovery point to be recovered. + :paramtype recovery_point_id: str + :keyword rehydration_priority: Priority to be used for rehydration. Values High or Standard. + Possible values include: "Invalid", "High", "Standard". + :paramtype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :keyword rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e + P10D . + :paramtype rehydration_retention_duration: str + """ super(AzureBackupRehydrationRequest, self).__init__(**kwargs) self.recovery_point_id = recovery_point_id self.rehydration_priority = rehydration_priority @@ -1222,21 +1456,21 @@ class AzureBackupRestoreWithRehydrationRequest(AzureBackupRecoveryPointBasedRest All required parameters must be populated in order to send to Azure. - :param object_type: Required. Constant filled by server. - :type object_type: str - :param restore_target_info: Required. Gets or sets the restore target information. - :type restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase - :param source_data_store_type: Required. Gets or sets the type of the source data store. + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar restore_target_info: Required. Gets or sets the restore target information. + :vartype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :ivar source_data_store_type: Required. Gets or sets the type of the source data store. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType - :param recovery_point_id: Required. - :type recovery_point_id: str - :param rehydration_priority: Required. Priority to be used for rehydration. Values High or + :vartype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :ivar recovery_point_id: Required. + :vartype recovery_point_id: str + :ivar rehydration_priority: Required. Priority to be used for rehydration. Values High or Standard. Possible values include: "Invalid", "High", "Standard". - :type rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority - :param rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D + :vartype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :ivar rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e P10D . - :type rehydration_retention_duration: str + :vartype rehydration_retention_duration: str """ _validation = { @@ -1267,6 +1501,21 @@ def __init__( rehydration_retention_duration: str, **kwargs ): + """ + :keyword restore_target_info: Required. Gets or sets the restore target information. + :paramtype restore_target_info: ~azure.mgmt.dataprotection.models.RestoreTargetInfoBase + :keyword source_data_store_type: Required. Gets or sets the type of the source data store. + Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype source_data_store_type: str or ~azure.mgmt.dataprotection.models.SourceDataStoreType + :keyword recovery_point_id: Required. + :paramtype recovery_point_id: str + :keyword rehydration_priority: Required. Priority to be used for rehydration. Values High or + Standard. Possible values include: "Invalid", "High", "Standard". + :paramtype rehydration_priority: str or ~azure.mgmt.dataprotection.models.RehydrationPriority + :keyword rehydration_retention_duration: Required. Retention duration in ISO 8601 format i.e + P10D . + :paramtype rehydration_retention_duration: str + """ super(AzureBackupRestoreWithRehydrationRequest, self).__init__(restore_target_info=restore_target_info, source_data_store_type=source_data_store_type, recovery_point_id=recovery_point_id, **kwargs) self.object_type = 'AzureBackupRestoreWithRehydrationRequest' # type: str self.rehydration_priority = rehydration_priority @@ -1281,10 +1530,10 @@ class BasePolicyRule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -1307,6 +1556,10 @@ def __init__( name: str, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + """ super(BasePolicyRule, self).__init__(**kwargs) self.name = name self.object_type = None # type: Optional[str] @@ -1317,16 +1570,16 @@ class AzureBackupRule(BasePolicyRule): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str - :param backup_parameters: BackupParameters base. - :type backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters - :param data_store: Required. DataStoreInfo base. - :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase - :param trigger: Required. Trigger context. - :type trigger: ~azure.mgmt.dataprotection.models.TriggerContext + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar backup_parameters: BackupParameters base. + :vartype backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters + :ivar data_store: Required. DataStoreInfo base. + :vartype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar trigger: Required. Trigger context. + :vartype trigger: ~azure.mgmt.dataprotection.models.TriggerContext """ _validation = { @@ -1353,6 +1606,16 @@ def __init__( backup_parameters: Optional["BackupParameters"] = None, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + :keyword backup_parameters: BackupParameters base. + :paramtype backup_parameters: ~azure.mgmt.dataprotection.models.BackupParameters + :keyword data_store: Required. DataStoreInfo base. + :paramtype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :keyword trigger: Required. Trigger context. + :paramtype trigger: ~azure.mgmt.dataprotection.models.TriggerContext + """ super(AzureBackupRule, self).__init__(name=name, **kwargs) self.object_type = 'AzureBackupRule' # type: str self.backup_parameters = backup_parameters @@ -1368,12 +1631,12 @@ class DataStoreParameters(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :vartype object_type: str + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes """ _validation = { @@ -1396,6 +1659,11 @@ def __init__( data_store_type: Union[str, "DataStoreTypes"], **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + """ super(DataStoreParameters, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.data_store_type = data_store_type @@ -1406,14 +1674,14 @@ class AzureOperationalStoreParameters(DataStoreParameters): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :vartype object_type: str + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes - :param resource_group_id: Gets or sets the Snapshot Resource Group Uri. - :type resource_group_id: str + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :ivar resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :vartype resource_group_id: str """ _validation = { @@ -1434,6 +1702,13 @@ def __init__( resource_group_id: Optional[str] = None, **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :keyword resource_group_id: Gets or sets the Snapshot Resource Group Uri. + :paramtype resource_group_id: str + """ super(AzureOperationalStoreParameters, self).__init__(data_store_type=data_store_type, **kwargs) self.object_type = 'AzureOperationalStoreParameters' # type: str self.resource_group_id = resource_group_id @@ -1444,14 +1719,14 @@ class AzureRetentionRule(BasePolicyRule): All required parameters must be populated in order to send to Azure. - :param name: Required. - :type name: str - :param object_type: Required. Constant filled by server. - :type object_type: str - :param is_default: - :type is_default: bool - :param lifecycles: Required. - :type lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + :ivar name: Required. + :vartype name: str + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar is_default: + :vartype is_default: bool + :ivar lifecycles: Required. + :vartype lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] """ _validation = { @@ -1475,6 +1750,14 @@ def __init__( is_default: Optional[bool] = None, **kwargs ): + """ + :keyword name: Required. + :paramtype name: str + :keyword is_default: + :paramtype is_default: bool + :keyword lifecycles: Required. + :paramtype lifecycles: list[~azure.mgmt.dataprotection.models.SourceLifeCycle] + """ super(AzureRetentionRule, self).__init__(name=name, **kwargs) self.object_type = 'AzureRetentionRule' # type: str self.is_default = is_default @@ -1489,9 +1772,9 @@ class BackupCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -1510,6 +1793,8 @@ def __init__( self, **kwargs ): + """ + """ super(BackupCriteria, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -1521,14 +1806,14 @@ class BackupInstance(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param friendly_name: Gets or sets the Backup Instance friendly name. - :type friendly_name: str - :param data_source_info: Required. Gets or sets the data source information. - :type data_source_info: ~azure.mgmt.dataprotection.models.Datasource - :param data_source_set_info: Gets or sets the data source set information. - :type data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param policy_info: Required. Gets or sets the policy information. - :type policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :ivar friendly_name: Gets or sets the Backup Instance friendly name. + :vartype friendly_name: str + :ivar data_source_info: Required. Gets or sets the data source information. + :vartype data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar data_source_set_info: Gets or sets the data source set information. + :vartype data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar policy_info: Required. Gets or sets the policy information. + :vartype policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo :ivar protection_status: Specifies the protection status of the resource. :vartype protection_status: ~azure.mgmt.dataprotection.models.ProtectionStatusDetails :ivar current_protection_state: Specifies the current protection state of the resource. @@ -1543,11 +1828,11 @@ class BackupInstance(msrest.serialization.Model): :ivar provisioning_state: Specifies the provisioning state of the resource i.e. provisioning/updating/Succeeded/Failed. :vartype provisioning_state: str - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials - :param object_type: Required. - :type object_type: str + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :ivar object_type: Required. + :vartype object_type: str """ _validation = { @@ -1584,6 +1869,21 @@ def __init__( datasource_auth_credentials: Optional["AuthCredentials"] = None, **kwargs ): + """ + :keyword friendly_name: Gets or sets the Backup Instance friendly name. + :paramtype friendly_name: str + :keyword data_source_info: Required. Gets or sets the data source information. + :paramtype data_source_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword data_source_set_info: Gets or sets the data source set information. + :paramtype data_source_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword policy_info: Required. Gets or sets the policy information. + :paramtype policy_info: ~azure.mgmt.dataprotection.models.PolicyInfo + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :keyword object_type: Required. + :paramtype object_type: str + """ super(BackupInstance, self).__init__(**kwargs) self.friendly_name = friendly_name self.data_source_info = data_source_info @@ -1611,8 +1911,8 @@ class BackupInstanceResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: BackupInstanceResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BackupInstance + :ivar properties: BackupInstanceResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BackupInstance """ _validation = { @@ -1636,6 +1936,10 @@ def __init__( properties: Optional["BackupInstance"] = None, **kwargs ): + """ + :keyword properties: BackupInstanceResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BackupInstance + """ super(BackupInstanceResource, self).__init__(**kwargs) self.properties = properties @@ -1643,11 +1947,11 @@ def __init__( class BackupInstanceResourceList(DppResourceList): """BackupInstance Resource list response. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] """ _attribute_map = { @@ -1662,6 +1966,13 @@ def __init__( value: Optional[List["BackupInstanceResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BackupInstanceResource] + """ super(BackupInstanceResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -1674,10 +1985,10 @@ class BaseBackupPolicy(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_types: Required. Type of datasource for the backup management. - :type datasource_types: list[str] - :param object_type: Required. Constant filled by server. - :type object_type: str + :ivar datasource_types: Required. Type of datasource for the backup management. + :vartype datasource_types: list[str] + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str """ _validation = { @@ -1700,6 +2011,10 @@ def __init__( datasource_types: List[str], **kwargs ): + """ + :keyword datasource_types: Required. Type of datasource for the backup management. + :paramtype datasource_types: list[str] + """ super(BaseBackupPolicy, self).__init__(**kwargs) self.datasource_types = datasource_types self.object_type = None # type: Optional[str] @@ -1710,13 +2025,13 @@ class BackupPolicy(BaseBackupPolicy): All required parameters must be populated in order to send to Azure. - :param datasource_types: Required. Type of datasource for the backup management. - :type datasource_types: list[str] - :param object_type: Required. Constant filled by server. - :type object_type: str - :param policy_rules: Required. Policy rule dictionary that contains rules for each backuptype + :ivar datasource_types: Required. Type of datasource for the backup management. + :vartype datasource_types: list[str] + :ivar object_type: Required. Constant filled by server. + :vartype object_type: str + :ivar policy_rules: Required. Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc. - :type policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + :vartype policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] """ _validation = { @@ -1738,6 +2053,13 @@ def __init__( policy_rules: List["BasePolicyRule"], **kwargs ): + """ + :keyword datasource_types: Required. Type of datasource for the backup management. + :paramtype datasource_types: list[str] + :keyword policy_rules: Required. Policy rule dictionary that contains rules for each backuptype + i.e Full/Incremental/Logs etc. + :paramtype policy_rules: list[~azure.mgmt.dataprotection.models.BasePolicyRule] + """ super(BackupPolicy, self).__init__(datasource_types=datasource_types, **kwargs) self.object_type = 'BackupPolicy' # type: str self.policy_rules = policy_rules @@ -1748,10 +2070,10 @@ class BackupSchedule(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param repeating_time_intervals: Required. ISO 8601 repeating time interval format. - :type repeating_time_intervals: list[str] - :param time_zone: Time zone for a schedule. Example: Pacific Standard Time. - :type time_zone: str + :ivar repeating_time_intervals: Required. ISO 8601 repeating time interval format. + :vartype repeating_time_intervals: list[str] + :ivar time_zone: Time zone for a schedule. Example: Pacific Standard Time. + :vartype time_zone: str """ _validation = { @@ -1770,6 +2092,12 @@ def __init__( time_zone: Optional[str] = None, **kwargs ): + """ + :keyword repeating_time_intervals: Required. ISO 8601 repeating time interval format. + :paramtype repeating_time_intervals: list[str] + :keyword time_zone: Time zone for a schedule. Example: Pacific Standard Time. + :paramtype time_zone: str + """ super(BackupSchedule, self).__init__(**kwargs) self.repeating_time_intervals = repeating_time_intervals self.time_zone = time_zone @@ -1791,8 +2119,8 @@ class BackupVault(msrest.serialization.Model): :vartype resource_move_state: str or ~azure.mgmt.dataprotection.models.ResourceMoveState :ivar resource_move_details: Resource move details for backup vault. :vartype resource_move_details: ~azure.mgmt.dataprotection.models.ResourceMoveDetails - :param storage_settings: Required. Storage Settings. - :type storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] + :ivar storage_settings: Required. Storage Settings. + :vartype storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] """ _validation = { @@ -1815,6 +2143,10 @@ def __init__( storage_settings: List["StorageSetting"], **kwargs ): + """ + :keyword storage_settings: Required. Storage Settings. + :paramtype storage_settings: list[~azure.mgmt.dataprotection.models.StorageSetting] + """ super(BackupVault, self).__init__(**kwargs) self.provisioning_state = None self.resource_move_state = None @@ -1827,18 +2159,18 @@ class DppTrackedResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str @@ -1873,6 +2205,16 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(DppTrackedResource, self).__init__(**kwargs) self.e_tag = e_tag self.id = None @@ -1891,25 +2233,25 @@ class BackupVaultResource(DppTrackedResource): All required parameters must be populated in order to send to Azure. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: Required. BackupVaultResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BackupVault + :ivar properties: Required. BackupVaultResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BackupVault """ _validation = { @@ -1942,6 +2284,18 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: Required. BackupVaultResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BackupVault + """ super(BackupVaultResource, self).__init__(e_tag=e_tag, identity=identity, location=location, tags=tags, **kwargs) self.properties = properties @@ -1949,11 +2303,11 @@ def __init__( class BackupVaultResourceList(DppResourceList): """List of BackupVault resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] """ _attribute_map = { @@ -1968,6 +2322,13 @@ def __init__( value: Optional[List["BackupVaultResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BackupVaultResource] + """ super(BackupVaultResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -1986,8 +2347,8 @@ class BaseBackupPolicyResource(DppResource): :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: BaseBackupPolicyResource properties. - :type properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + :ivar properties: BaseBackupPolicyResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy """ _validation = { @@ -2011,6 +2372,10 @@ def __init__( properties: Optional["BaseBackupPolicy"] = None, **kwargs ): + """ + :keyword properties: BaseBackupPolicyResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.BaseBackupPolicy + """ super(BaseBackupPolicyResource, self).__init__(**kwargs) self.properties = properties @@ -2018,11 +2383,11 @@ def __init__( class BaseBackupPolicyResourceList(DppResourceList): """List of BaseBackupPolicy resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] """ _attribute_map = { @@ -2037,6 +2402,13 @@ def __init__( value: Optional[List["BaseBackupPolicyResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.BaseBackupPolicyResource] + """ super(BaseBackupPolicyResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -2044,10 +2416,10 @@ def __init__( class CheckNameAvailabilityRequest(msrest.serialization.Model): """CheckNameAvailability Request. - :param name: Resource name for which availability needs to be checked. - :type name: str - :param type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. - :type type: str + :ivar name: Resource name for which availability needs to be checked. + :vartype name: str + :ivar type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. + :vartype type: str """ _attribute_map = { @@ -2062,6 +2434,12 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword name: Resource name for which availability needs to be checked. + :paramtype name: str + :keyword type: Describes the Resource type: Microsoft.DataProtection/BackupVaults. + :paramtype type: str + """ super(CheckNameAvailabilityRequest, self).__init__(**kwargs) self.name = name self.type = type @@ -2070,12 +2448,12 @@ def __init__( class CheckNameAvailabilityResult(msrest.serialization.Model): """CheckNameAvailability Result. - :param message: Gets or sets the message. - :type message: str - :param name_available: Gets or sets a value indicating whether [name available]. - :type name_available: bool - :param reason: Gets or sets the reason. - :type reason: str + :ivar message: Gets or sets the message. + :vartype message: str + :ivar name_available: Gets or sets a value indicating whether [name available]. + :vartype name_available: bool + :ivar reason: Gets or sets the reason. + :vartype reason: str """ _attribute_map = { @@ -2092,6 +2470,14 @@ def __init__( reason: Optional[str] = None, **kwargs ): + """ + :keyword message: Gets or sets the message. + :paramtype message: str + :keyword name_available: Gets or sets a value indicating whether [name available]. + :paramtype name_available: bool + :keyword reason: Gets or sets the reason. + :paramtype reason: str + """ super(CheckNameAvailabilityResult, self).__init__(**kwargs) self.message = message self.name_available = name_available @@ -2101,14 +2487,14 @@ def __init__( class ClientDiscoveryDisplay(msrest.serialization.Model): """Localized display information of an operation. - :param description: Description of the operation having details of what operation is about. - :type description: str - :param operation: Operations Name itself. - :type operation: str - :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 + :ivar description: Description of the operation having details of what operation is about. + :vartype description: str + :ivar operation: Operations Name itself. + :vartype operation: 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 """ _attribute_map = { @@ -2127,6 +2513,16 @@ def __init__( resource: Optional[str] = None, **kwargs ): + """ + :keyword description: Description of the operation having details of what operation is about. + :paramtype description: str + :keyword operation: Operations Name itself. + :paramtype operation: str + :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 + """ super(ClientDiscoveryDisplay, self).__init__(**kwargs) self.description = description self.operation = operation @@ -2137,12 +2533,12 @@ def __init__( class ClientDiscoveryForLogSpecification(msrest.serialization.Model): """Class to represent shoebox log specification in json client discovery. - :param blob_duration: blob duration of shoebox log specification. - :type blob_duration: str - :param display_name: Localized display name. - :type display_name: str - :param name: Name for shoebox log specification. - :type name: str + :ivar blob_duration: blob duration of shoebox log specification. + :vartype blob_duration: str + :ivar display_name: Localized display name. + :vartype display_name: str + :ivar name: Name for shoebox log specification. + :vartype name: str """ _attribute_map = { @@ -2159,6 +2555,14 @@ def __init__( name: Optional[str] = None, **kwargs ): + """ + :keyword blob_duration: blob duration of shoebox log specification. + :paramtype blob_duration: str + :keyword display_name: Localized display name. + :paramtype display_name: str + :keyword name: Name for shoebox log specification. + :paramtype name: str + """ super(ClientDiscoveryForLogSpecification, self).__init__(**kwargs) self.blob_duration = blob_duration self.display_name = display_name @@ -2168,8 +2572,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.dataprotection.models.ClientDiscoveryForServiceSpecification """ @@ -2183,6 +2587,11 @@ def __init__( service_specification: Optional["ClientDiscoveryForServiceSpecification"] = None, **kwargs ): + """ + :keyword service_specification: Operation properties. + :paramtype service_specification: + ~azure.mgmt.dataprotection.models.ClientDiscoveryForServiceSpecification + """ super(ClientDiscoveryForProperties, self).__init__(**kwargs) self.service_specification = service_specification @@ -2190,8 +2599,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.dataprotection.models.ClientDiscoveryForLogSpecification] """ @@ -2205,6 +2614,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.dataprotection.models.ClientDiscoveryForLogSpecification] + """ super(ClientDiscoveryForServiceSpecification, self).__init__(**kwargs) self.log_specifications = log_specifications @@ -2212,10 +2626,10 @@ def __init__( class ClientDiscoveryResponse(msrest.serialization.Model): """Operations List response which contains list of available APIs. - :param next_link: Link to the next chunk of Response. - :type next_link: str - :param value: List of available operations. - :type value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] + :ivar next_link: Link to the next chunk of Response. + :vartype next_link: str + :ivar value: List of available operations. + :vartype value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] """ _attribute_map = { @@ -2230,6 +2644,12 @@ def __init__( value: Optional[List["ClientDiscoveryValueForSingleApi"]] = None, **kwargs ): + """ + :keyword next_link: Link to the next chunk of Response. + :paramtype next_link: str + :keyword value: List of available operations. + :paramtype value: list[~azure.mgmt.dataprotection.models.ClientDiscoveryValueForSingleApi] + """ super(ClientDiscoveryResponse, self).__init__(**kwargs) self.next_link = next_link self.value = value @@ -2238,17 +2658,17 @@ def __init__( class ClientDiscoveryValueForSingleApi(msrest.serialization.Model): """Available operation details. - :param display: Contains the localized display information for this particular operation. - :type display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay - :param name: Name of the Operation. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param origin: The intended executor of the operation;governs the display of the operation in + :ivar display: Contains the localized display information for this particular operation. + :vartype display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :ivar name: Name of the Operation. + :vartype name: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :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: Properties for the given operation. - :type properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + :vartype origin: str + :ivar properties: Properties for the given operation. + :vartype properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties """ _attribute_map = { @@ -2269,6 +2689,19 @@ def __init__( properties: Optional["ClientDiscoveryForProperties"] = None, **kwargs ): + """ + :keyword display: Contains the localized display information for this particular operation. + :paramtype display: ~azure.mgmt.dataprotection.models.ClientDiscoveryDisplay + :keyword name: Name of the Operation. + :paramtype name: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :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: Properties for the given operation. + :paramtype properties: ~azure.mgmt.dataprotection.models.ClientDiscoveryForProperties + """ super(ClientDiscoveryValueForSingleApi, self).__init__(**kwargs) self.display = display self.name = name @@ -2285,9 +2718,9 @@ class CopyOption(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2306,6 +2739,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyOption, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2315,9 +2750,9 @@ class CopyOnExpiryOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2332,6 +2767,8 @@ def __init__( self, **kwargs ): + """ + """ super(CopyOnExpiryOption, self).__init__(**kwargs) self.object_type = 'CopyOnExpiryOption' # type: str @@ -2341,11 +2778,11 @@ class CustomCopyOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param duration: Data copied after given timespan. - :type duration: str + :vartype object_type: str + :ivar duration: Data copied after given timespan. + :vartype duration: str """ _validation = { @@ -2363,6 +2800,10 @@ def __init__( duration: Optional[str] = None, **kwargs ): + """ + :keyword duration: Data copied after given timespan. + :paramtype duration: str + """ super(CustomCopyOption, self).__init__(**kwargs) self.object_type = 'CustomCopyOption' # type: str self.duration = duration @@ -2373,21 +2814,21 @@ class Datasource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_type: DatasourceType of the resource. - :type datasource_type: str - :param object_type: Type of Datasource object, used to initialize the right inherited type. - :type object_type: str - :param resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. + :ivar datasource_type: DatasourceType of the resource. + :vartype datasource_type: str + :ivar object_type: Type of Datasource object, used to initialize the right inherited type. + :vartype object_type: str + :ivar resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. - :type resource_id: str - :param resource_location: Location of datasource. - :type resource_location: str - :param resource_name: Unique identifier of the resource in the context of parent. - :type resource_name: str - :param resource_type: Resource Type of Datasource. - :type resource_type: str - :param resource_uri: Uri of the resource. - :type resource_uri: str + :vartype resource_id: str + :ivar resource_location: Location of datasource. + :vartype resource_location: str + :ivar resource_name: Unique identifier of the resource in the context of parent. + :vartype resource_name: str + :ivar resource_type: Resource Type of Datasource. + :vartype resource_type: str + :ivar resource_uri: Uri of the resource. + :vartype resource_uri: str """ _validation = { @@ -2416,6 +2857,23 @@ def __init__( resource_uri: Optional[str] = None, **kwargs ): + """ + :keyword datasource_type: DatasourceType of the resource. + :paramtype datasource_type: str + :keyword object_type: Type of Datasource object, used to initialize the right inherited type. + :paramtype object_type: str + :keyword resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM + ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. + :paramtype resource_id: str + :keyword resource_location: Location of datasource. + :paramtype resource_location: str + :keyword resource_name: Unique identifier of the resource in the context of parent. + :paramtype resource_name: str + :keyword resource_type: Resource Type of Datasource. + :paramtype resource_type: str + :keyword resource_uri: Uri of the resource. + :paramtype resource_uri: str + """ super(Datasource, self).__init__(**kwargs) self.datasource_type = datasource_type self.object_type = object_type @@ -2431,21 +2889,21 @@ class DatasourceSet(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param datasource_type: DatasourceType of the resource. - :type datasource_type: str - :param object_type: Type of Datasource object, used to initialize the right inherited type. - :type object_type: str - :param resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. + :ivar datasource_type: DatasourceType of the resource. + :vartype datasource_type: str + :ivar object_type: Type of Datasource object, used to initialize the right inherited type. + :vartype object_type: str + :ivar resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. - :type resource_id: str - :param resource_location: Location of datasource. - :type resource_location: str - :param resource_name: Unique identifier of the resource in the context of parent. - :type resource_name: str - :param resource_type: Resource Type of Datasource. - :type resource_type: str - :param resource_uri: Uri of the resource. - :type resource_uri: str + :vartype resource_id: str + :ivar resource_location: Location of datasource. + :vartype resource_location: str + :ivar resource_name: Unique identifier of the resource in the context of parent. + :vartype resource_name: str + :ivar resource_type: Resource Type of Datasource. + :vartype resource_type: str + :ivar resource_uri: Uri of the resource. + :vartype resource_uri: str """ _validation = { @@ -2474,6 +2932,23 @@ def __init__( resource_uri: Optional[str] = None, **kwargs ): + """ + :keyword datasource_type: DatasourceType of the resource. + :paramtype datasource_type: str + :keyword object_type: Type of Datasource object, used to initialize the right inherited type. + :paramtype object_type: str + :keyword resource_id: Required. Full ARM ID of the resource. For azure resources, this is ARM + ID. For non azure resources, this will be the ID created by backup service via Fabric/Vault. + :paramtype resource_id: str + :keyword resource_location: Location of datasource. + :paramtype resource_location: str + :keyword resource_name: Unique identifier of the resource in the context of parent. + :paramtype resource_name: str + :keyword resource_type: Resource Type of Datasource. + :paramtype resource_type: str + :keyword resource_uri: Uri of the resource. + :paramtype resource_uri: str + """ super(DatasourceSet, self).__init__(**kwargs) self.datasource_type = datasource_type self.object_type = object_type @@ -2489,12 +2964,12 @@ class DataStoreInfoBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values + :ivar data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible values include: "OperationalStore", "VaultStore", "ArchiveStore". - :type data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :vartype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2514,6 +2989,14 @@ def __init__( object_type: str, **kwargs ): + """ + :keyword data_store_type: Required. type of datastore; Operational/Vault/Archive. Possible + values include: "OperationalStore", "VaultStore", "ArchiveStore". + :paramtype data_store_type: str or ~azure.mgmt.dataprotection.models.DataStoreTypes + :keyword object_type: Required. Type of Datasource object, used to initialize the right + inherited type. + :paramtype object_type: str + """ super(DataStoreInfoBase, self).__init__(**kwargs) self.data_store_type = data_store_type self.object_type = object_type @@ -2522,10 +3005,10 @@ def __init__( class Day(msrest.serialization.Model): """Day of the week. - :param date: Date of the month. - :type date: int - :param is_last: Whether Date is last date of month. - :type is_last: bool + :ivar date: Date of the month. + :vartype date: int + :ivar is_last: Whether Date is last date of month. + :vartype is_last: bool """ _attribute_map = { @@ -2540,6 +3023,12 @@ def __init__( is_last: Optional[bool] = None, **kwargs ): + """ + :keyword date: Date of the month. + :paramtype date: int + :keyword is_last: Whether Date is last date of month. + :paramtype is_last: bool + """ super(Day, self).__init__(**kwargs) self.date = date self.is_last = is_last @@ -2575,6 +3064,8 @@ def __init__( self, **kwargs ): + """ + """ super(DppBaseResource, self).__init__(**kwargs) self.id = None self.name = None @@ -2584,11 +3075,11 @@ def __init__( class DppBaseResourceList(msrest.serialization.Model): """Base for all lists of V2 resources. - :param value: List of Dpp resources. - :type value: list[~azure.mgmt.dataprotection.models.DppBaseResource] - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar value: List of Dpp resources. + :vartype value: list[~azure.mgmt.dataprotection.models.DppBaseResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -2603,6 +3094,13 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword value: List of Dpp resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.DppBaseResource] + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppBaseResourceList, self).__init__(**kwargs) self.value = value self.next_link = next_link @@ -2619,8 +3117,8 @@ class DppIdentityDetails(msrest.serialization.Model): :ivar tenant_id: A Globally Unique Identifier (GUID) that represents the Azure AD tenant where the resource is now a member. :vartype tenant_id: str - :param type: The identityType which can be either SystemAssigned or None. - :type type: str + :ivar type: The identityType which can be either SystemAssigned or None. + :vartype type: str """ _validation = { @@ -2640,6 +3138,10 @@ def __init__( type: Optional[str] = None, **kwargs ): + """ + :keyword type: The identityType which can be either SystemAssigned or None. + :paramtype type: str + """ super(DppIdentityDetails, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None @@ -2649,9 +3151,9 @@ def __init__( class DppTrackedResourceList(msrest.serialization.Model): """DppTrackedResourceList. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str """ _attribute_map = { @@ -2664,6 +3166,11 @@ def __init__( next_link: Optional[str] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + """ super(DppTrackedResourceList, self).__init__(**kwargs) self.next_link = next_link @@ -2705,6 +3212,8 @@ def __init__( self, **kwargs ): + """ + """ super(Error, self).__init__(**kwargs) self.additional_info = None self.code = None @@ -2738,6 +3247,8 @@ def __init__( self, **kwargs ): + """ + """ super(ErrorAdditionalInfo, self).__init__(**kwargs) self.info = None self.type = None @@ -2776,6 +3287,8 @@ def __init__( self, **kwargs ): + """ + """ super(ExportJobsResult, self).__init__(**kwargs) self.blob_url = None self.blob_sas_key = None @@ -2791,9 +3304,9 @@ class FeatureValidationRequestBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2812,6 +3325,8 @@ def __init__( self, **kwargs ): + """ + """ super(FeatureValidationRequestBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2821,14 +3336,14 @@ class FeatureValidationRequest(FeatureValidationRequestBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param feature_type: backup support feature type. Possible values include: "Invalid", + :vartype object_type: str + :ivar feature_type: backup support feature type. Possible values include: "Invalid", "DataSourceType". - :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType - :param feature_name: backup support feature name. - :type feature_name: str + :vartype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :ivar feature_name: backup support feature name. + :vartype feature_name: str """ _validation = { @@ -2848,6 +3363,13 @@ def __init__( feature_name: Optional[str] = None, **kwargs ): + """ + :keyword feature_type: backup support feature type. Possible values include: "Invalid", + "DataSourceType". + :paramtype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :keyword feature_name: backup support feature name. + :paramtype feature_name: str + """ super(FeatureValidationRequest, self).__init__(**kwargs) self.object_type = 'FeatureValidationRequest' # type: str self.feature_type = feature_type @@ -2862,9 +3384,9 @@ class FeatureValidationResponseBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2883,6 +3405,8 @@ def __init__( self, **kwargs ): + """ + """ super(FeatureValidationResponseBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -2892,14 +3416,14 @@ class FeatureValidationResponse(FeatureValidationResponseBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param feature_type: backup support feature type. Possible values include: "Invalid", + :vartype object_type: str + :ivar feature_type: backup support feature type. Possible values include: "Invalid", "DataSourceType". - :type feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType - :param features: Response features. - :type features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + :vartype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :ivar features: Response features. + :vartype features: list[~azure.mgmt.dataprotection.models.SupportedFeature] """ _validation = { @@ -2919,6 +3443,13 @@ def __init__( features: Optional[List["SupportedFeature"]] = None, **kwargs ): + """ + :keyword feature_type: backup support feature type. Possible values include: "Invalid", + "DataSourceType". + :paramtype feature_type: str or ~azure.mgmt.dataprotection.models.FeatureType + :keyword features: Response features. + :paramtype features: list[~azure.mgmt.dataprotection.models.SupportedFeature] + """ super(FeatureValidationResponse, self).__init__(**kwargs) self.object_type = 'FeatureValidationResponse' # type: str self.feature_type = feature_type @@ -2930,9 +3461,9 @@ class ImmediateCopyOption(CopyOption): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -2947,6 +3478,8 @@ def __init__( self, **kwargs ): + """ + """ super(ImmediateCopyOption, self).__init__(**kwargs) self.object_type = 'ImmediateCopyOption' # type: str @@ -2954,13 +3487,13 @@ def __init__( class InnerError(msrest.serialization.Model): """Inner Error. - :param additional_info: Any Key value pairs that can be provided to the client for additional + :ivar additional_info: Any Key value pairs that can be provided to the client for additional verbose information. - :type additional_info: dict[str, str] - :param code: Unique code for this error. - :type code: str - :param embedded_inner_error: Child Inner Error, to allow Nesting. - :type embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + :vartype additional_info: dict[str, str] + :ivar code: Unique code for this error. + :vartype code: str + :ivar embedded_inner_error: Child Inner Error, to allow Nesting. + :vartype embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError """ _attribute_map = { @@ -2977,6 +3510,15 @@ def __init__( embedded_inner_error: Optional["InnerError"] = None, **kwargs ): + """ + :keyword additional_info: Any Key value pairs that can be provided to the client for additional + verbose information. + :paramtype additional_info: dict[str, str] + :keyword code: Unique code for this error. + :paramtype code: str + :keyword embedded_inner_error: Child Inner Error, to allow Nesting. + :paramtype embedded_inner_error: ~azure.mgmt.dataprotection.models.InnerError + """ super(InnerError, self).__init__(**kwargs) self.additional_info = additional_info self.code = code @@ -2991,9 +3533,9 @@ class ItemLevelRestoreCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str + :vartype object_type: str """ _validation = { @@ -3012,6 +3554,8 @@ def __init__( self, **kwargs ): + """ + """ super(ItemLevelRestoreCriteria, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -3024,13 +3568,13 @@ class RestoreTargetInfoBase(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str """ _validation = { @@ -3055,6 +3599,12 @@ def __init__( restore_location: Optional[str] = None, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + """ super(RestoreTargetInfoBase, self).__init__(**kwargs) self.object_type = None # type: Optional[str] self.recovery_option = recovery_option @@ -3066,22 +3616,22 @@ class ItemLevelRestoreTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param restore_criteria: Required. Restore Criteria. - :type restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] - :param datasource_info: Required. Information of target DS. - :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource - :param datasource_set_info: Information of target DS Set. - :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar restore_criteria: Required. Restore Criteria. + :vartype restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :ivar datasource_info: Required. Information of target DS. + :vartype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar datasource_set_info: Information of target DS Set. + :vartype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials """ _validation = { @@ -3112,6 +3662,21 @@ def __init__( datasource_auth_credentials: Optional["AuthCredentials"] = None, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword restore_criteria: Required. Restore Criteria. + :paramtype restore_criteria: list[~azure.mgmt.dataprotection.models.ItemLevelRestoreCriteria] + :keyword datasource_info: Required. Information of target DS. + :paramtype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword datasource_set_info: Information of target DS Set. + :paramtype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + """ super(ItemLevelRestoreTargetInfo, self).__init__(recovery_option=recovery_option, restore_location=restore_location, **kwargs) self.object_type = 'ItemLevelRestoreTargetInfo' # type: str self.restore_criteria = restore_criteria @@ -3125,8 +3690,8 @@ class JobExtendedInfo(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param additional_details: Job's Additional Details. - :type additional_details: dict[str, str] + :ivar additional_details: Job's Additional Details. + :vartype additional_details: dict[str, str] :ivar backup_instance_state: State of the Backup Instance. :vartype backup_instance_state: str :ivar data_transferred_in_bytes: Number of bytes transferred. @@ -3166,6 +3731,10 @@ def __init__( additional_details: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword additional_details: Job's Additional Details. + :paramtype additional_details: dict[str, str] + """ super(JobExtendedInfo, self).__init__(**kwargs) self.additional_details = additional_details self.backup_instance_state = None @@ -3183,16 +3752,16 @@ class JobSubTask(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param additional_details: Additional details of Sub Tasks. - :type additional_details: dict[str, str] - :param task_id: Required. Task Id of the Sub Task. - :type task_id: int - :param task_name: Required. Name of the Sub Task. - :type task_name: str + :ivar additional_details: Additional details of Sub Tasks. + :vartype additional_details: dict[str, str] + :ivar task_id: Required. Task Id of the Sub Task. + :vartype task_id: int + :ivar task_name: Required. Name of the Sub Task. + :vartype task_name: str :ivar task_progress: Progress of the Sub Task. :vartype task_progress: str - :param task_status: Required. Status of the Sub Task. - :type task_status: str + :ivar task_status: Required. Status of the Sub Task. + :vartype task_status: str """ _validation = { @@ -3219,6 +3788,16 @@ def __init__( additional_details: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword additional_details: Additional details of Sub Tasks. + :paramtype additional_details: dict[str, str] + :keyword task_id: Required. Task Id of the Sub Task. + :paramtype task_id: int + :keyword task_name: Required. Name of the Sub Task. + :paramtype task_name: str + :keyword task_status: Required. Status of the Sub Task. + :paramtype task_status: str + """ super(JobSubTask, self).__init__(**kwargs) self.additional_details = additional_details self.task_id = task_id @@ -3235,9 +3814,9 @@ class OperationExtendedInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param object_type: Required. This property will be used as the discriminator for deciding the + :ivar object_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 object_type: str + :vartype object_type: str """ _validation = { @@ -3256,6 +3835,8 @@ def __init__( self, **kwargs ): + """ + """ super(OperationExtendedInfo, self).__init__(**kwargs) self.object_type = None # type: Optional[str] @@ -3265,11 +3846,11 @@ class OperationJobExtendedInfo(OperationExtendedInfo): All required parameters must be populated in order to send to Azure. - :param object_type: Required. This property will be used as the discriminator for deciding the + :ivar object_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 object_type: str - :param job_id: Arm Id of the job created for this operation. - :type job_id: str + :vartype object_type: str + :ivar job_id: Arm Id of the job created for this operation. + :vartype job_id: str """ _validation = { @@ -3287,6 +3868,10 @@ def __init__( job_id: Optional[str] = None, **kwargs ): + """ + :keyword job_id: Arm Id of the job created for this operation. + :paramtype job_id: str + """ super(OperationJobExtendedInfo, self).__init__(**kwargs) self.object_type = 'OperationJobExtendedInfo' # type: str self.job_id = job_id @@ -3295,24 +3880,24 @@ 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. The full set of optional properties (e.g. inner errors / details) can be found in the "Error Response" section. - :type error: ~azure.mgmt.dataprotection.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.dataprotection.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 properties: End time of the operation. - :type properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo - :param start_time: Start time of the operation. - :type start_time: ~datetime.datetime - :param status: - :type status: str + :vartype name: str + :ivar properties: End time of the operation. + :vartype properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :ivar start_time: Start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar status: + :vartype status: str """ _attribute_map = { @@ -3337,6 +3922,26 @@ def __init__( status: Optional[str] = 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. + The full set of optional properties (e.g. inner errors / details) can be found in the "Error + Response" section. + :paramtype error: ~azure.mgmt.dataprotection.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 properties: End time of the operation. + :paramtype properties: ~azure.mgmt.dataprotection.models.OperationExtendedInfo + :keyword start_time: Start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword status: + :paramtype status: str + """ super(OperationResource, self).__init__(**kwargs) self.end_time = end_time self.error = error @@ -3350,10 +3955,10 @@ def __init__( class PatchResourceRequestInput(msrest.serialization.Model): """Patch Request content for Microsoft.DataProtection resources. - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { @@ -3368,6 +3973,12 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): + """ + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ super(PatchResourceRequestInput, self).__init__(**kwargs) self.identity = identity self.tags = tags @@ -3380,12 +3991,12 @@ class PolicyInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param policy_id: Required. - :type policy_id: str + :ivar policy_id: Required. + :vartype policy_id: str :ivar policy_version: :vartype policy_version: str - :param policy_parameters: Policy parameters for the backup instance. - :type policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters + :ivar policy_parameters: Policy parameters for the backup instance. + :vartype policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters """ _validation = { @@ -3406,6 +4017,12 @@ def __init__( policy_parameters: Optional["PolicyParameters"] = None, **kwargs ): + """ + :keyword policy_id: Required. + :paramtype policy_id: str + :keyword policy_parameters: Policy parameters for the backup instance. + :paramtype policy_parameters: ~azure.mgmt.dataprotection.models.PolicyParameters + """ super(PolicyInfo, self).__init__(**kwargs) self.policy_id = policy_id self.policy_version = None @@ -3415,8 +4032,9 @@ def __init__( class PolicyParameters(msrest.serialization.Model): """Parameters in Policy. - :param data_store_parameters_list: Gets or sets the DataStore Parameters. - :type data_store_parameters_list: list[~azure.mgmt.dataprotection.models.DataStoreParameters] + :ivar data_store_parameters_list: Gets or sets the DataStore Parameters. + :vartype data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] """ _attribute_map = { @@ -3429,6 +4047,11 @@ def __init__( data_store_parameters_list: Optional[List["DataStoreParameters"]] = None, **kwargs ): + """ + :keyword data_store_parameters_list: Gets or sets the DataStore Parameters. + :paramtype data_store_parameters_list: + list[~azure.mgmt.dataprotection.models.DataStoreParameters] + """ super(PolicyParameters, self).__init__(**kwargs) self.data_store_parameters_list = data_store_parameters_list @@ -3436,12 +4059,12 @@ def __init__( class ProtectionStatusDetails(msrest.serialization.Model): """Protection status details. - :param error_details: Specifies the protection status error of the resource. - :type error_details: ~azure.mgmt.dataprotection.models.UserFacingError - :param status: Specifies the protection status of the resource. Possible values include: + :ivar error_details: Specifies the protection status error of the resource. + :vartype error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :ivar status: Specifies the protection status of the resource. Possible values include: "ConfiguringProtection", "ConfiguringProtectionFailed", "ProtectionConfigured", "ProtectionStopped", "SoftDeleted", "SoftDeleting". - :type status: str or ~azure.mgmt.dataprotection.models.Status + :vartype status: str or ~azure.mgmt.dataprotection.models.Status """ _attribute_map = { @@ -3456,6 +4079,14 @@ def __init__( status: Optional[Union[str, "Status"]] = None, **kwargs ): + """ + :keyword error_details: Specifies the protection status error of the resource. + :paramtype error_details: ~azure.mgmt.dataprotection.models.UserFacingError + :keyword status: Specifies the protection status of the resource. Possible values include: + "ConfiguringProtection", "ConfiguringProtectionFailed", "ProtectionConfigured", + "ProtectionStopped", "SoftDeleted", "SoftDeleting". + :paramtype status: str or ~azure.mgmt.dataprotection.models.Status + """ super(ProtectionStatusDetails, self).__init__(**kwargs) self.error_details = error_details self.status = status @@ -3466,13 +4097,13 @@ class RangeBasedItemLevelRestoreCriteria(ItemLevelRestoreCriteria): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param min_matching_value: minimum value for range prefix match. - :type min_matching_value: str - :param max_matching_value: maximum value for range prefix match. - :type max_matching_value: str + :vartype object_type: str + :ivar min_matching_value: minimum value for range prefix match. + :vartype min_matching_value: str + :ivar max_matching_value: maximum value for range prefix match. + :vartype max_matching_value: str """ _validation = { @@ -3492,6 +4123,12 @@ def __init__( max_matching_value: Optional[str] = None, **kwargs ): + """ + :keyword min_matching_value: minimum value for range prefix match. + :paramtype min_matching_value: str + :keyword max_matching_value: maximum value for range prefix match. + :paramtype max_matching_value: str + """ super(RangeBasedItemLevelRestoreCriteria, self).__init__(**kwargs) self.object_type = 'RangeBasedItemLevelRestoreCriteria' # type: str self.min_matching_value = min_matching_value @@ -3503,23 +4140,23 @@ class RecoveryPointDataStoreDetails(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param creation_time: - :type creation_time: ~datetime.datetime - :param expiry_time: - :type expiry_time: ~datetime.datetime - :param id: - :type id: str - :param meta_data: - :type meta_data: str - :param state: - :type state: str - :param type: - :type type: str - :param visible: - :type visible: bool + :ivar creation_time: + :vartype creation_time: ~datetime.datetime + :ivar expiry_time: + :vartype expiry_time: ~datetime.datetime + :ivar id: + :vartype id: str + :ivar meta_data: + :vartype meta_data: str + :ivar state: + :vartype state: str + :ivar type: + :vartype type: str + :ivar visible: + :vartype visible: bool :ivar rehydration_expiry_time: :vartype rehydration_expiry_time: ~datetime.datetime - :ivar rehydration_status: Possible values include: "CREATE_IN_PROGRESS", "COMPLETED", + :ivar rehydration_status: Possible values include: "CREATE_IN_PROGRESS", "COMPLETED", "DELETE_IN_PROGRESS", "DELETED", "FAILED". :vartype rehydration_status: str or ~azure.mgmt.dataprotection.models.RehydrationStatus """ @@ -3553,6 +4190,22 @@ def __init__( visible: Optional[bool] = None, **kwargs ): + """ + :keyword creation_time: + :paramtype creation_time: ~datetime.datetime + :keyword expiry_time: + :paramtype expiry_time: ~datetime.datetime + :keyword id: + :paramtype id: str + :keyword meta_data: + :paramtype meta_data: str + :keyword state: + :paramtype state: str + :keyword type: + :paramtype type: str + :keyword visible: + :paramtype visible: bool + """ super(RecoveryPointDataStoreDetails, self).__init__(**kwargs) self.creation_time = creation_time self.expiry_time = expiry_time @@ -3568,18 +4221,18 @@ def __init__( class RecoveryPointsFilters(msrest.serialization.Model): """RecoveryPointsFilters. - :param restore_point_data_store_id: - :type restore_point_data_store_id: str - :param is_visible: - :type is_visible: bool - :param start_date: - :type start_date: str - :param end_date: - :type end_date: str - :param extended_info: - :type extended_info: bool - :param restore_point_state: - :type restore_point_state: str + :ivar restore_point_data_store_id: + :vartype restore_point_data_store_id: str + :ivar is_visible: + :vartype is_visible: bool + :ivar start_date: + :vartype start_date: str + :ivar end_date: + :vartype end_date: str + :ivar extended_info: + :vartype extended_info: bool + :ivar restore_point_state: + :vartype restore_point_state: str """ _attribute_map = { @@ -3602,6 +4255,20 @@ def __init__( restore_point_state: Optional[str] = None, **kwargs ): + """ + :keyword restore_point_data_store_id: + :paramtype restore_point_data_store_id: str + :keyword is_visible: + :paramtype is_visible: bool + :keyword start_date: + :paramtype start_date: str + :keyword end_date: + :paramtype end_date: str + :keyword extended_info: + :paramtype extended_info: bool + :keyword restore_point_state: + :paramtype restore_point_state: str + """ super(RecoveryPointsFilters, self).__init__(**kwargs) self.restore_point_data_store_id = restore_point_data_store_id self.is_visible = is_visible @@ -3652,6 +4319,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceGuard, self).__init__(**kwargs) self.provisioning_state = None self.allow_auto_approvals = None @@ -3685,6 +4354,8 @@ def __init__( self, **kwargs ): + """ + """ super(ResourceGuardOperation, self).__init__(**kwargs) self.vault_critical_operation = None self.request_resource_type = None @@ -3695,25 +4366,25 @@ class ResourceGuardResource(DppTrackedResource): Variables are only populated by the server, and will be ignored when sending a request. - :param e_tag: Optional ETag. - :type e_tag: str + :ivar e_tag: Optional ETag. + :vartype e_tag: str :ivar id: Resource Id represents the complete path to the resource. :vartype id: str - :param identity: Input Managed Identity Details. - :type identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails - :param location: Resource location. - :type location: str + :ivar identity: Input Managed Identity Details. + :vartype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :ivar location: Resource location. + :vartype location: str :ivar name: Resource name associated with the resource. :vartype name: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] :ivar type: Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~azure.mgmt.dataprotection.models.SystemData - :param properties: ResourceGuardResource properties. - :type properties: ~azure.mgmt.dataprotection.models.ResourceGuard + :ivar properties: ResourceGuardResource properties. + :vartype properties: ~azure.mgmt.dataprotection.models.ResourceGuard """ _validation = { @@ -3745,6 +4416,18 @@ def __init__( properties: Optional["ResourceGuard"] = None, **kwargs ): + """ + :keyword e_tag: Optional ETag. + :paramtype e_tag: str + :keyword identity: Input Managed Identity Details. + :paramtype identity: ~azure.mgmt.dataprotection.models.DppIdentityDetails + :keyword location: Resource location. + :paramtype location: str + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: ResourceGuardResource properties. + :paramtype properties: ~azure.mgmt.dataprotection.models.ResourceGuard + """ super(ResourceGuardResource, self).__init__(e_tag=e_tag, identity=identity, location=location, tags=tags, **kwargs) self.properties = properties @@ -3752,11 +4435,11 @@ def __init__( class ResourceGuardResourceList(DppTrackedResourceList): """List of ResourceGuard resources. - :param next_link: The uri to fetch the next page of resources. Call ListNext() fetches next - page of resources. - :type next_link: str - :param value: List of resources. - :type value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] + :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page + of resources. + :vartype next_link: str + :ivar value: List of resources. + :vartype value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] """ _attribute_map = { @@ -3771,6 +4454,13 @@ def __init__( value: Optional[List["ResourceGuardResource"]] = None, **kwargs ): + """ + :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next + page of resources. + :paramtype next_link: str + :keyword value: List of resources. + :paramtype value: list[~azure.mgmt.dataprotection.models.ResourceGuardResource] + """ super(ResourceGuardResourceList, self).__init__(next_link=next_link, **kwargs) self.value = value @@ -3778,19 +4468,19 @@ def __init__( class ResourceMoveDetails(msrest.serialization.Model): """ResourceMoveDetails will be returned in response to GetResource call from ARM. - :param operation_id: CorrelationId of latest ResourceMove operation attempted. - :type operation_id: str - :param start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 + :ivar operation_id: CorrelationId of latest ResourceMove operation attempted. + :vartype operation_id: str + :ivar start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format. - :type start_time_utc: str - :param completion_time_utc: Completion time in UTC of latest ResourceMove operation attempted. + :vartype start_time_utc: str + :ivar completion_time_utc: Completion time in UTC of latest ResourceMove operation attempted. ISO 8601 format. - :type completion_time_utc: str - :param source_resource_path: ARM resource path of source resource. - :type source_resource_path: str - :param target_resource_path: ARM resource path of target resource used in latest ResourceMove + :vartype completion_time_utc: str + :ivar source_resource_path: ARM resource path of source resource. + :vartype source_resource_path: str + :ivar target_resource_path: ARM resource path of target resource used in latest ResourceMove operation. - :type target_resource_path: str + :vartype target_resource_path: str """ _attribute_map = { @@ -3811,6 +4501,21 @@ def __init__( target_resource_path: Optional[str] = None, **kwargs ): + """ + :keyword operation_id: CorrelationId of latest ResourceMove operation attempted. + :paramtype operation_id: str + :keyword start_time_utc: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 + format. + :paramtype start_time_utc: str + :keyword completion_time_utc: Completion time in UTC of latest ResourceMove operation + attempted. ISO 8601 format. + :paramtype completion_time_utc: str + :keyword source_resource_path: ARM resource path of source resource. + :paramtype source_resource_path: str + :keyword target_resource_path: ARM resource path of target resource used in latest ResourceMove + operation. + :paramtype target_resource_path: str + """ super(ResourceMoveDetails, self).__init__(**kwargs) self.operation_id = operation_id self.start_time_utc = start_time_utc @@ -3824,12 +4529,12 @@ class RestorableTimeRange(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param start_time: Required. Start time for the available restore range. - :type start_time: str - :param end_time: Required. End time for the available restore range. - :type end_time: str - :param object_type: - :type object_type: str + :ivar start_time: Required. Start time for the available restore range. + :vartype start_time: str + :ivar end_time: Required. End time for the available restore range. + :vartype end_time: str + :ivar object_type: + :vartype object_type: str """ _validation = { @@ -3851,6 +4556,14 @@ def __init__( object_type: Optional[str] = None, **kwargs ): + """ + :keyword start_time: Required. Start time for the available restore range. + :paramtype start_time: str + :keyword end_time: Required. End time for the available restore range. + :paramtype end_time: str + :keyword object_type: + :paramtype object_type: str + """ super(RestorableTimeRange, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -3862,16 +4575,16 @@ class RestoreFilesTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param target_details: Required. Destination of RestoreAsFiles operation, when destination is + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar target_details: Required. Destination of RestoreAsFiles operation, when destination is not a datasource. - :type target_details: ~azure.mgmt.dataprotection.models.TargetDetails + :vartype target_details: ~azure.mgmt.dataprotection.models.TargetDetails """ _validation = { @@ -3895,6 +4608,15 @@ def __init__( restore_location: Optional[str] = None, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword target_details: Required. Destination of RestoreAsFiles operation, when destination is + not a datasource. + :paramtype target_details: ~azure.mgmt.dataprotection.models.TargetDetails + """ super(RestoreFilesTargetInfo, self).__init__(recovery_option=recovery_option, restore_location=restore_location, **kwargs) self.object_type = 'RestoreFilesTargetInfo' # type: str self.target_details = target_details @@ -3903,10 +4625,10 @@ def __init__( class RestoreJobRecoveryPointDetails(msrest.serialization.Model): """RestoreJobRecoveryPointDetails. - :param recovery_point_id: - :type recovery_point_id: str - :param recovery_point_time: - :type recovery_point_time: ~datetime.datetime + :ivar recovery_point_id: + :vartype recovery_point_id: str + :ivar recovery_point_time: + :vartype recovery_point_time: ~datetime.datetime """ _attribute_map = { @@ -3921,6 +4643,12 @@ def __init__( recovery_point_time: Optional[datetime.datetime] = None, **kwargs ): + """ + :keyword recovery_point_id: + :paramtype recovery_point_id: str + :keyword recovery_point_time: + :paramtype recovery_point_time: ~datetime.datetime + """ super(RestoreJobRecoveryPointDetails, self).__init__(**kwargs) self.recovery_point_id = recovery_point_id self.recovery_point_time = recovery_point_time @@ -3931,20 +4659,20 @@ class RestoreTargetInfo(RestoreTargetInfoBase): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of Datasource object, used to initialize the right inherited + :ivar object_type: Required. Type of Datasource object, used to initialize the right inherited type.Constant filled by server. - :type object_type: str - :param recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". - :type recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption - :param restore_location: Target Restore region. - :type restore_location: str - :param datasource_info: Required. Information of target DS. - :type datasource_info: ~azure.mgmt.dataprotection.models.Datasource - :param datasource_set_info: Information of target DS Set. - :type datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet - :param datasource_auth_credentials: Credentials to use to authenticate with data source + :vartype object_type: str + :ivar recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :vartype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :ivar restore_location: Target Restore region. + :vartype restore_location: str + :ivar datasource_info: Required. Information of target DS. + :vartype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :ivar datasource_set_info: Information of target DS Set. + :vartype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :ivar datasource_auth_credentials: Credentials to use to authenticate with data source provider. - :type datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + :vartype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials """ _validation = { @@ -3972,6 +4700,19 @@ def __init__( datasource_auth_credentials: Optional["AuthCredentials"] = None, **kwargs ): + """ + :keyword recovery_option: Required. Recovery Option. Possible values include: "FailIfExists". + :paramtype recovery_option: str or ~azure.mgmt.dataprotection.models.RecoveryOption + :keyword restore_location: Target Restore region. + :paramtype restore_location: str + :keyword datasource_info: Required. Information of target DS. + :paramtype datasource_info: ~azure.mgmt.dataprotection.models.Datasource + :keyword datasource_set_info: Information of target DS Set. + :paramtype datasource_set_info: ~azure.mgmt.dataprotection.models.DatasourceSet + :keyword datasource_auth_credentials: Credentials to use to authenticate with data source + provider. + :paramtype datasource_auth_credentials: ~azure.mgmt.dataprotection.models.AuthCredentials + """ super(RestoreTargetInfo, self).__init__(recovery_option=recovery_option, restore_location=restore_location, **kwargs) self.object_type = 'RestoreTargetInfo' # type: str self.datasource_info = datasource_info @@ -3990,8 +4731,8 @@ class RetentionTag(msrest.serialization.Model): :vartype e_tag: str :ivar id: Retention Tag version. :vartype id: str - :param tag_name: Required. Retention Tag Name to relate it to retention rule. - :type tag_name: str + :ivar tag_name: Required. Retention Tag Name to relate it to retention rule. + :vartype tag_name: str """ _validation = { @@ -4012,6 +4753,10 @@ def __init__( tag_name: str, **kwargs ): + """ + :keyword tag_name: Required. Retention Tag Name to relate it to retention rule. + :paramtype tag_name: str + """ super(RetentionTag, self).__init__(**kwargs) self.e_tag = None self.id = None @@ -4023,23 +4768,23 @@ class ScheduleBasedBackupCriteria(BackupCriteria): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / + :vartype object_type: str + :ivar absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" and should be part of AbsoluteMarker enum. - :type absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] - :param days_of_month: This is day of the month from 1 to 28 other wise last of month. - :type days_of_month: list[~azure.mgmt.dataprotection.models.Day] - :param days_of_the_week: It should be Sunday/Monday/T..../Saturday. - :type days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] - :param months_of_year: It should be January/February/....../December. - :type months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] - :param schedule_times: List of schedule times for backup. - :type schedule_times: list[~datetime.datetime] - :param weeks_of_the_month: It should be First/Second/Third/Fourth/Last. - :type weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] + :vartype absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :ivar days_of_month: This is day of the month from 1 to 28 other wise last of month. + :vartype days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :ivar days_of_the_week: It should be Sunday/Monday/T..../Saturday. + :vartype days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] + :ivar months_of_year: It should be January/February/....../December. + :vartype months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :ivar schedule_times: List of schedule times for backup. + :vartype schedule_times: list[~datetime.datetime] + :ivar weeks_of_the_month: It should be First/Second/Third/Fourth/Last. + :vartype weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] """ _validation = { @@ -4067,6 +4812,22 @@ def __init__( weeks_of_the_month: Optional[List[Union[str, "WeekNumber"]]] = None, **kwargs ): + """ + :keyword absolute_criteria: it contains absolute values like "AllBackup" / "FirstOfDay" / + "FirstOfWeek" / "FirstOfMonth" + and should be part of AbsoluteMarker enum. + :paramtype absolute_criteria: list[str or ~azure.mgmt.dataprotection.models.AbsoluteMarker] + :keyword days_of_month: This is day of the month from 1 to 28 other wise last of month. + :paramtype days_of_month: list[~azure.mgmt.dataprotection.models.Day] + :keyword days_of_the_week: It should be Sunday/Monday/T..../Saturday. + :paramtype days_of_the_week: list[str or ~azure.mgmt.dataprotection.models.DayOfWeek] + :keyword months_of_year: It should be January/February/....../December. + :paramtype months_of_year: list[str or ~azure.mgmt.dataprotection.models.Month] + :keyword schedule_times: List of schedule times for backup. + :paramtype schedule_times: list[~datetime.datetime] + :keyword weeks_of_the_month: It should be First/Second/Third/Fourth/Last. + :paramtype weeks_of_the_month: list[str or ~azure.mgmt.dataprotection.models.WeekNumber] + """ super(ScheduleBasedBackupCriteria, self).__init__(**kwargs) self.object_type = 'ScheduleBasedBackupCriteria' # type: str self.absolute_criteria = absolute_criteria @@ -4082,13 +4843,13 @@ class ScheduleBasedTriggerContext(TriggerContext): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param schedule: Required. Schedule for this backup. - :type schedule: ~azure.mgmt.dataprotection.models.BackupSchedule - :param tagging_criteria: Required. List of tags that can be applicable for given schedule. - :type tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] + :vartype object_type: str + :ivar schedule: Required. Schedule for this backup. + :vartype schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :ivar tagging_criteria: Required. List of tags that can be applicable for given schedule. + :vartype tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] """ _validation = { @@ -4110,6 +4871,12 @@ def __init__( tagging_criteria: List["TaggingCriteria"], **kwargs ): + """ + :keyword schedule: Required. Schedule for this backup. + :paramtype schedule: ~azure.mgmt.dataprotection.models.BackupSchedule + :keyword tagging_criteria: Required. List of tags that can be applicable for given schedule. + :paramtype tagging_criteria: list[~azure.mgmt.dataprotection.models.TaggingCriteria] + """ super(ScheduleBasedTriggerContext, self).__init__(**kwargs) self.object_type = 'ScheduleBasedTriggerContext' # type: str self.schedule = schedule @@ -4121,11 +4888,11 @@ class SecretStoreBasedAuthCredentials(AuthCredentials): All required parameters must be populated in order to send to Azure. - :param object_type: Required. Type of the specific object - used for deserializing.Constant + :ivar object_type: Required. Type of the specific object - used for deserializing.Constant filled by server. - :type object_type: str - :param secret_store_resource: Secret store resource. - :type secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource + :vartype object_type: str + :ivar secret_store_resource: Secret store resource. + :vartype secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource """ _validation = { @@ -4143,6 +4910,10 @@ def __init__( secret_store_resource: Optional["SecretStoreResource"] = None, **kwargs ): + """ + :keyword secret_store_resource: Secret store resource. + :paramtype secret_store_resource: ~azure.mgmt.dataprotection.models.SecretStoreResource + """ super(SecretStoreBasedAuthCredentials, self).__init__(**kwargs) self.object_type = 'SecretStoreBasedAuthCredentials' # type: str self.secret_store_resource = secret_store_resource @@ -4153,11 +4924,11 @@ class SecretStoreResource(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param uri: Uri to get to the resource. - :type uri: str - :param secret_store_type: Required. Gets or sets the type of secret store. Possible values + :ivar uri: Uri to get to the resource. + :vartype uri: str + :ivar secret_store_type: Required. Gets or sets the type of secret store. Possible values include: "Invalid", "AzureKeyVault". - :type secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType + :vartype secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType """ _validation = { @@ -4176,6 +4947,13 @@ def __init__( uri: Optional[str] = None, **kwargs ): + """ + :keyword uri: Uri to get to the resource. + :paramtype uri: str + :keyword secret_store_type: Required. Gets or sets the type of secret store. Possible values + include: "Invalid", "AzureKeyVault". + :paramtype secret_store_type: str or ~azure.mgmt.dataprotection.models.SecretStoreType + """ super(SecretStoreResource, self).__init__(**kwargs) self.uri = uri self.secret_store_type = secret_store_type @@ -4186,12 +4964,12 @@ class SourceLifeCycle(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param delete_after: Required. Delete Option. - :type delete_after: ~azure.mgmt.dataprotection.models.DeleteOption - :param source_data_store: Required. DataStoreInfo base. - :type source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase - :param target_data_store_copy_settings: - :type target_data_store_copy_settings: + :ivar delete_after: Required. Delete Option. + :vartype delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :ivar source_data_store: Required. DataStoreInfo base. + :vartype source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar target_data_store_copy_settings: + :vartype target_data_store_copy_settings: list[~azure.mgmt.dataprotection.models.TargetCopySetting] """ @@ -4214,6 +4992,15 @@ def __init__( target_data_store_copy_settings: Optional[List["TargetCopySetting"]] = None, **kwargs ): + """ + :keyword delete_after: Required. Delete Option. + :paramtype delete_after: ~azure.mgmt.dataprotection.models.DeleteOption + :keyword source_data_store: Required. DataStoreInfo base. + :paramtype source_data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :keyword target_data_store_copy_settings: + :paramtype target_data_store_copy_settings: + list[~azure.mgmt.dataprotection.models.TargetCopySetting] + """ super(SourceLifeCycle, self).__init__(**kwargs) self.delete_after = delete_after self.source_data_store = source_data_store @@ -4223,12 +5010,11 @@ def __init__( class StorageSetting(msrest.serialization.Model): """Storage setting. - :param datastore_type: Gets or sets the type of the datastore. Possible values include: + :ivar datastore_type: Gets or sets the type of the datastore. Possible values include: "ArchiveStore", "SnapshotStore", "VaultStore". - :type datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes - :param type: Gets or sets the type. Possible values include: "GeoRedundant", - "LocallyRedundant". - :type type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + :vartype datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :ivar type: Gets or sets the type. Possible values include: "GeoRedundant", "LocallyRedundant". + :vartype type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes """ _attribute_map = { @@ -4243,6 +5029,14 @@ def __init__( type: Optional[Union[str, "StorageSettingTypes"]] = None, **kwargs ): + """ + :keyword datastore_type: Gets or sets the type of the datastore. Possible values include: + "ArchiveStore", "SnapshotStore", "VaultStore". + :paramtype datastore_type: str or ~azure.mgmt.dataprotection.models.StorageSettingStoreTypes + :keyword type: Gets or sets the type. Possible values include: "GeoRedundant", + "LocallyRedundant". + :paramtype type: str or ~azure.mgmt.dataprotection.models.StorageSettingTypes + """ super(StorageSetting, self).__init__(**kwargs) self.datastore_type = datastore_type self.type = type @@ -4251,13 +5045,13 @@ def __init__( class SupportedFeature(msrest.serialization.Model): """Elements class for feature request. - :param feature_name: support feature type. - :type feature_name: str - :param support_status: feature support status. Possible values include: "Invalid", + :ivar feature_name: support feature type. + :vartype feature_name: str + :ivar support_status: feature support status. Possible values include: "Invalid", "NotSupported", "AlphaPreview", "PrivatePreview", "PublicPreview", "GenerallyAvailable". - :type support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus - :param exposure_controlled_features: support feature type. - :type exposure_controlled_features: list[str] + :vartype support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :ivar exposure_controlled_features: support feature type. + :vartype exposure_controlled_features: list[str] """ _attribute_map = { @@ -4274,6 +5068,15 @@ def __init__( exposure_controlled_features: Optional[List[str]] = None, **kwargs ): + """ + :keyword feature_name: support feature type. + :paramtype feature_name: str + :keyword support_status: feature support status. Possible values include: "Invalid", + "NotSupported", "AlphaPreview", "PrivatePreview", "PublicPreview", "GenerallyAvailable". + :paramtype support_status: str or ~azure.mgmt.dataprotection.models.FeatureSupportStatus + :keyword exposure_controlled_features: support feature type. + :paramtype exposure_controlled_features: list[str] + """ super(SupportedFeature, self).__init__(**kwargs) self.feature_name = feature_name self.support_status = support_status @@ -4283,20 +5086,20 @@ def __init__( 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.dataprotection.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.dataprotection.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.dataprotection.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.dataprotection.models.CreatedByType + :ivar last_modified_at: The type of identity that last modified the resource. + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { @@ -4319,6 +5122,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.dataprotection.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.dataprotection.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 @@ -4333,14 +5152,14 @@ class TaggingCriteria(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param criteria: Criteria which decides whether the tag can be applied to a triggered backup. - :type criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] - :param is_default: Required. Specifies if tag is default. - :type is_default: bool - :param tagging_priority: Required. Retention Tag priority. - :type tagging_priority: long - :param tag_info: Required. Retention tag information. - :type tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + :ivar criteria: Criteria which decides whether the tag can be applied to a triggered backup. + :vartype criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :ivar is_default: Required. Specifies if tag is default. + :vartype is_default: bool + :ivar tagging_priority: Required. Retention Tag priority. + :vartype tagging_priority: long + :ivar tag_info: Required. Retention tag information. + :vartype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag """ _validation = { @@ -4365,6 +5184,16 @@ def __init__( criteria: Optional[List["BackupCriteria"]] = None, **kwargs ): + """ + :keyword criteria: Criteria which decides whether the tag can be applied to a triggered backup. + :paramtype criteria: list[~azure.mgmt.dataprotection.models.BackupCriteria] + :keyword is_default: Required. Specifies if tag is default. + :paramtype is_default: bool + :keyword tagging_priority: Required. Retention Tag priority. + :paramtype tagging_priority: long + :keyword tag_info: Required. Retention tag information. + :paramtype tag_info: ~azure.mgmt.dataprotection.models.RetentionTag + """ super(TaggingCriteria, self).__init__(**kwargs) self.criteria = criteria self.is_default = is_default @@ -4377,10 +5206,10 @@ class TargetCopySetting(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. - :type copy_after: ~azure.mgmt.dataprotection.models.CopyOption - :param data_store: Required. Info of target datastore. - :type data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + :ivar copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. + :vartype copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :ivar data_store: Required. Info of target datastore. + :vartype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase """ _validation = { @@ -4400,6 +5229,12 @@ def __init__( data_store: "DataStoreInfoBase", **kwargs ): + """ + :keyword copy_after: Required. It can be CustomCopyOption or ImmediateCopyOption. + :paramtype copy_after: ~azure.mgmt.dataprotection.models.CopyOption + :keyword data_store: Required. Info of target datastore. + :paramtype data_store: ~azure.mgmt.dataprotection.models.DataStoreInfoBase + """ super(TargetCopySetting, self).__init__(**kwargs) self.copy_after = copy_after self.data_store = data_store @@ -4410,20 +5245,20 @@ class TargetDetails(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param file_prefix: Required. Restore operation may create multiple files inside location + :ivar file_prefix: Required. Restore operation may create multiple files inside location pointed by Url Below will be the common prefix for all of them. - :type file_prefix: str - :param restore_target_location_type: Required. Denotes the target location where the data will + :vartype file_prefix: str + :ivar restore_target_location_type: Required. Denotes the target location where the data will be restored, string value for the enum {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. Possible values include: "Invalid", "AzureBlobs", "AzureFiles". - :type restore_target_location_type: str or + :vartype restore_target_location_type: str or ~azure.mgmt.dataprotection.models.RestoreTargetLocationType - :param url: Required. Url denoting the restore destination. It can point to container / file + :ivar url: Required. Url denoting the restore destination. It can point to container / file share etc. - :type url: str + :vartype url: str """ _validation = { @@ -4446,6 +5281,22 @@ def __init__( url: str, **kwargs ): + """ + :keyword file_prefix: Required. Restore operation may create multiple files inside location + pointed by Url + Below will be the common prefix for all of them. + :paramtype file_prefix: str + :keyword restore_target_location_type: Required. Denotes the target location where the data + will be restored, + string value for the enum + {Microsoft.Internal.AzureBackup.DataProtection.Common.Interface.RestoreTargetLocationType}. + Possible values include: "Invalid", "AzureBlobs", "AzureFiles". + :paramtype restore_target_location_type: str or + ~azure.mgmt.dataprotection.models.RestoreTargetLocationType + :keyword url: Required. Url denoting the restore destination. It can point to container / file + share etc. + :paramtype url: str + """ super(TargetDetails, self).__init__(**kwargs) self.file_prefix = file_prefix self.restore_target_location_type = restore_target_location_type @@ -4457,9 +5308,9 @@ class TriggerBackupRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param backup_rule_options: Required. Name for the Rule of the Policy which needs to be applied + :ivar backup_rule_options: Required. Name for the Rule of the Policy which needs to be applied for this backup. - :type backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + :vartype backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions """ _validation = { @@ -4476,6 +5327,11 @@ def __init__( backup_rule_options: "AdHocBackupRuleOptions", **kwargs ): + """ + :keyword backup_rule_options: Required. Name for the Rule of the Policy which needs to be + applied for this backup. + :paramtype backup_rule_options: ~azure.mgmt.dataprotection.models.AdHocBackupRuleOptions + """ super(TriggerBackupRequest, self).__init__(**kwargs) self.backup_rule_options = backup_rule_options @@ -4483,24 +5339,24 @@ def __init__( class UserFacingError(msrest.serialization.Model): """Error object used by layers that have access to localized content, and propagate that to user. - :param code: Unique code for this error. - :type code: str - :param details: Additional related Errors. - :type details: list[~azure.mgmt.dataprotection.models.UserFacingError] - :param inner_error: Inner Error. - :type inner_error: ~azure.mgmt.dataprotection.models.InnerError - :param is_retryable: Whether the operation will be retryable or not. - :type is_retryable: bool - :param is_user_error: Whether the operation is due to a user error or service error. - :type is_user_error: bool - :param properties: Any key value pairs that can be injected inside error object. - :type properties: dict[str, str] - :param message: - :type message: str - :param recommended_action: RecommendedAction � localized. - :type recommended_action: list[str] - :param target: Target of the error. - :type target: str + :ivar code: Unique code for this error. + :vartype code: str + :ivar details: Additional related Errors. + :vartype details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :ivar inner_error: Inner Error. + :vartype inner_error: ~azure.mgmt.dataprotection.models.InnerError + :ivar is_retryable: Whether the operation will be retryable or not. + :vartype is_retryable: bool + :ivar is_user_error: Whether the operation is due to a user error or service error. + :vartype is_user_error: bool + :ivar properties: Any key value pairs that can be injected inside error object. + :vartype properties: dict[str, str] + :ivar message: + :vartype message: str + :ivar recommended_action: RecommendedAction � localized. + :vartype recommended_action: list[str] + :ivar target: Target of the error. + :vartype target: str """ _attribute_map = { @@ -4529,6 +5385,26 @@ def __init__( target: Optional[str] = None, **kwargs ): + """ + :keyword code: Unique code for this error. + :paramtype code: str + :keyword details: Additional related Errors. + :paramtype details: list[~azure.mgmt.dataprotection.models.UserFacingError] + :keyword inner_error: Inner Error. + :paramtype inner_error: ~azure.mgmt.dataprotection.models.InnerError + :keyword is_retryable: Whether the operation will be retryable or not. + :paramtype is_retryable: bool + :keyword is_user_error: Whether the operation is due to a user error or service error. + :paramtype is_user_error: bool + :keyword properties: Any key value pairs that can be injected inside error object. + :paramtype properties: dict[str, str] + :keyword message: + :paramtype message: str + :keyword recommended_action: RecommendedAction � localized. + :paramtype recommended_action: list[str] + :keyword target: Target of the error. + :paramtype target: str + """ super(UserFacingError, self).__init__(**kwargs) self.code = code self.details = details @@ -4546,8 +5422,8 @@ class ValidateForBackupRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param backup_instance: Required. Backup Instance. - :type backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + :ivar backup_instance: Required. Backup Instance. + :vartype backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance """ _validation = { @@ -4564,6 +5440,10 @@ def __init__( backup_instance: "BackupInstance", **kwargs ): + """ + :keyword backup_instance: Required. Backup Instance. + :paramtype backup_instance: ~azure.mgmt.dataprotection.models.BackupInstance + """ super(ValidateForBackupRequest, self).__init__(**kwargs) self.backup_instance = backup_instance @@ -4573,8 +5453,8 @@ class ValidateRestoreRequestObject(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param restore_request_object: Required. Gets or sets the restore request object. - :type restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + :ivar restore_request_object: Required. Gets or sets the restore request object. + :vartype restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest """ _validation = { @@ -4591,5 +5471,9 @@ def __init__( restore_request_object: "AzureBackupRestoreRequest", **kwargs ): + """ + :keyword restore_request_object: Required. Gets or sets the restore request object. + :paramtype restore_request_object: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest + """ super(ValidateRestoreRequestObject, self).__init__(**kwargs) self.restore_request_object = restore_request_object diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py index 68829a4eb021..f9ab3a0070da 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_instances_operations.py @@ -5,26 +5,396 @@ # 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_request( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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_get_request( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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_adhoc_backup_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_validate_for_backup_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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] + 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 + ) + + +def build_trigger_rehydrate_request_initial( + resource_group_name, # type: str + subscription_id, # type: str + vault_name, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_trigger_restore_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_validate_for_restore_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class BackupInstancesOperations(object): """BackupInstancesOperations operations. @@ -47,6 +417,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, vault_name, # type: str @@ -61,8 +432,10 @@ def list( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupInstanceResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BackupInstanceResourceList] + :return: An iterator like instance of either BackupInstanceResourceList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BackupInstanceResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackupInstanceResourceList"] @@ -70,36 +443,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + 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('BackupInstanceResourceList', pipeline_response) + deserialized = self._deserialize("BackupInstanceResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -117,11 +487,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.DataProtection/backupVaults/{vaultName}/backupInstances'} # type: ignore + @distributed_trace def get( self, vault_name, # type: str @@ -148,28 +520,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_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 @@ -183,8 +545,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + def _create_or_update_initial( self, vault_name, # type: str @@ -199,33 +563,23 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'BackupInstanceResource') + + request = build_create_or_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_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(parameters, 'BackupInstanceResource') - 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 @@ -243,8 +597,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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, vault_name, # type: str @@ -266,15 +623,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.dataprotection.models.BackupInstanceResource :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. - :return: An instance of LROPoller that returns either BackupInstanceResource or the result of cls(response) + :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 BackupInstanceResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.BackupInstanceResource] - :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.BackupInstanceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -287,28 +648,21 @@ def begin_create_or_update( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('BackupInstanceResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -320,6 +674,7 @@ 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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore def _delete_initial( @@ -335,28 +690,18 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + template_url=self._delete_initial.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 @@ -369,12 +714,15 @@ def _delete_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore + + @distributed_trace def begin_delete( self, vault_name, # type: str @@ -393,15 +741,17 @@ def begin_delete( :type backup_instance_name: str :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 None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -416,22 +766,14 @@ def begin_delete( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -443,6 +785,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}'} # type: ignore def _adhoc_backup_initial( @@ -459,33 +802,23 @@ def _adhoc_backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._adhoc_backup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'TriggerBackupRequest') - # 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_adhoc_backup_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._adhoc_backup_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(parameters, 'TriggerBackupRequest') - 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 @@ -493,8 +826,8 @@ def _adhoc_backup_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -502,13 +835,17 @@ def _adhoc_backup_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _adhoc_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup'} # type: ignore + + @distributed_trace def begin_adhoc_backup( self, vault_name, # type: str @@ -530,15 +867,20 @@ def begin_adhoc_backup( :type parameters: ~azure.mgmt.dataprotection.models.TriggerBackupRequest :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. - :return: An instance of LROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -551,28 +893,21 @@ def begin_adhoc_backup( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -584,6 +919,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_adhoc_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup'} # type: ignore def _validate_for_backup_initial( @@ -599,32 +935,22 @@ def _validate_for_backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._validate_for_backup_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + 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(parameters, 'ValidateForBackupRequest') + + request = build_validate_for_backup_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + json=_json, + template_url=self._validate_for_backup_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(parameters, 'ValidateForBackupRequest') - 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 @@ -632,8 +958,8 @@ def _validate_for_backup_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -641,13 +967,17 @@ def _validate_for_backup_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _validate_for_backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup'} # type: ignore + + @distributed_trace def begin_validate_for_backup( self, vault_name, # type: str @@ -666,15 +996,20 @@ def begin_validate_for_backup( :type parameters: ~azure.mgmt.dataprotection.models.ValidateForBackupRequest :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. - :return: An instance of LROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -686,27 +1021,21 @@ def begin_validate_for_backup( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -718,6 +1047,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_for_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/validateForBackup'} # type: ignore def _trigger_rehydrate_initial( @@ -734,33 +1064,23 @@ def _trigger_rehydrate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._trigger_rehydrate_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupRehydrationRequest') + + request = build_trigger_rehydrate_request_initial( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + vault_name=vault_name, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._trigger_rehydrate_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(parameters, 'AzureBackupRehydrationRequest') - 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 @@ -773,12 +1093,15 @@ def _trigger_rehydrate_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _trigger_rehydrate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate'} # type: ignore + + @distributed_trace def begin_trigger_rehydrate( self, resource_group_name, # type: str @@ -800,15 +1123,18 @@ def begin_trigger_rehydrate( :type parameters: ~azure.mgmt.dataprotection.models.AzureBackupRehydrationRequest :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 None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :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[None] lro_delay = kwargs.pop( 'polling_interval', @@ -821,25 +1147,18 @@ def begin_trigger_rehydrate( vault_name=vault_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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): if cls: return cls(pipeline_response, None, {}) - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -851,6 +1170,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_rehydrate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate'} # type: ignore def _trigger_restore_initial( @@ -867,33 +1187,23 @@ def _trigger_restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._trigger_restore_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupRestoreRequest') + + request = build_trigger_restore_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._trigger_restore_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(parameters, 'AzureBackupRestoreRequest') - 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 @@ -901,8 +1211,8 @@ def _trigger_restore_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -910,13 +1220,17 @@ def _trigger_restore_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _trigger_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore'} # type: ignore + + @distributed_trace def begin_trigger_restore( self, vault_name, # type: str @@ -938,15 +1252,20 @@ def begin_trigger_restore( :type parameters: ~azure.mgmt.dataprotection.models.AzureBackupRestoreRequest :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. - :return: An instance of LROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -959,28 +1278,21 @@ def begin_trigger_restore( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -992,6 +1304,7 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore'} # type: ignore def _validate_for_restore_initial( @@ -1008,33 +1321,23 @@ def _validate_for_restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._validate_for_restore_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'ValidateRestoreRequestObject') - # 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_validate_for_restore_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self._validate_for_restore_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(parameters, 'ValidateRestoreRequestObject') - 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 @@ -1042,8 +1345,8 @@ def _validate_for_restore_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -1051,13 +1354,17 @@ def _validate_for_restore_initial( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + _validate_for_restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore'} # type: ignore + + @distributed_trace def begin_validate_for_restore( self, vault_name, # type: str @@ -1079,15 +1386,20 @@ def begin_validate_for_restore( :type parameters: ~azure.mgmt.dataprotection.models.ValidateRestoreRequestObject :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. - :return: An instance of LROPoller that returns either OperationJobExtendedInfo or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] - :raises ~azure.core.exceptions.HttpResponseError: + :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 OperationJobExtendedInfo or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.OperationJobExtendedInfo] + :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.OperationJobExtendedInfo"] lro_delay = kwargs.pop( 'polling_interval', @@ -1100,28 +1412,21 @@ def begin_validate_for_restore( resource_group_name=resource_group_name, backup_instance_name=backup_instance_name, parameters=parameters, + 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('OperationJobExtendedInfo', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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: @@ -1133,4 +1438,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_validate_for_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore'} # type: ignore diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py index 66ec3395e92e..61b0a9c4506f 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_policies_operations.py @@ -5,24 +5,186 @@ # 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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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_get_request( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_policy_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_policy_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_policy_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupPolicyName": _SERIALIZER.url("backup_policy_name", backup_policy_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 + ) + +# fmt: on class BackupPoliciesOperations(object): """BackupPoliciesOperations operations. @@ -45,6 +207,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, vault_name, # type: str @@ -59,8 +222,10 @@ def list( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BaseBackupPolicyResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BaseBackupPolicyResourceList] + :return: An iterator like instance of either BaseBackupPolicyResourceList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BaseBackupPolicyResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BaseBackupPolicyResourceList"] @@ -68,36 +233,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + 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('BaseBackupPolicyResourceList', pipeline_response) + deserialized = self._deserialize("BaseBackupPolicyResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +277,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.DataProtection/backupVaults/{vaultName}/backupPolicies'} # type: ignore + @distributed_trace def get( self, vault_name, # type: str @@ -148,28 +312,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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 @@ -183,8 +337,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + + @distributed_trace def create_or_update( self, vault_name, # type: str @@ -216,33 +373,23 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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(parameters, 'BaseBackupPolicyResource') - # 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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(parameters, 'BaseBackupPolicyResource') - 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 @@ -256,8 +403,11 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + + @distributed_trace def delete( self, vault_name, # type: str @@ -286,28 +436,18 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupPolicyName': self._serialize.url("backup_policy_name", backup_policy_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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_policy_name=backup_policy_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 @@ -319,3 +459,4 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py index a04e8c5e27a8..ddf7e73c23e6 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vault_operation_results_operations.py @@ -5,23 +5,69 @@ # 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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + operation_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, '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 BackupVaultOperationResultsOperations(object): """BackupVaultOperationResultsOperations operations. @@ -44,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, vault_name, # type: str @@ -70,28 +117,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + + request = build_get_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + operation_id=operation_id, + 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 @@ -99,8 +136,8 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('BackupVaultResource', pipeline_response) @@ -108,9 +145,12 @@ def get( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py index d7894a30a873..2dabffa28a06 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_backup_vaults_operations.py @@ -5,26 +5,292 @@ # 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_get_in_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults') + 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_get_in_resource_group_request( + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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_get_request( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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_create_or_update_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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] + 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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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="DELETE", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_update_request_initial( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "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] + 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 + ) + + +def build_check_name_availability_request( + resource_group_name, # type: str + subscription_id, # type: str + location, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, '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 BackupVaultsOperations(object): """BackupVaultsOperations operations. @@ -47,6 +313,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_in_subscription( self, **kwargs # type: Any @@ -55,7 +322,8 @@ def get_in_subscription( """Returns resource collection belonging to a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupVaultResourceList or the result of cls(response) + :return: An iterator like instance of either BackupVaultResourceList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -64,34 +332,29 @@ def get_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_in_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_in_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.get_in_subscription.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_get_in_subscription_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('BackupVaultResourceList', pipeline_response) + deserialized = self._deserialize("BackupVaultResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,11 +372,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults'} # type: ignore + @distributed_trace def get_in_resource_group( self, resource_group_name, # type: str @@ -125,7 +390,8 @@ def get_in_resource_group( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BackupVaultResourceList or the result of cls(response) + :return: An iterator like instance of either BackupVaultResourceList or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.BackupVaultResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -134,35 +400,31 @@ def get_in_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_in_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_get_in_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + template_url=self.get_in_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_get_in_resource_group_request( + resource_group_name=resource_group_name, + 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('BackupVaultResourceList', pipeline_response) + deserialized = self._deserialize("BackupVaultResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -180,11 +442,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults'} # type: ignore + @distributed_trace def get( self, vault_name, # type: str @@ -208,27 +472,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_get_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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 @@ -242,8 +496,10 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + def _create_or_update_initial( self, vault_name, # type: str @@ -257,32 +513,22 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + 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(parameters, 'BackupVaultResource') + + request = build_create_or_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'BackupVaultResource') - 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 @@ -300,8 +546,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.DataProtection/backupVaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_create_or_update( self, vault_name, # type: str @@ -320,15 +569,19 @@ def begin_create_or_update( :type parameters: ~azure.mgmt.dataprotection.models.BackupVaultResource :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. - :return: An instance of LROPoller that returns either BackupVaultResource or the result of cls(response) + :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 BackupVaultResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] - :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.BackupVaultResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -340,27 +593,21 @@ def begin_create_or_update( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('BackupVaultResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -372,8 +619,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.DataProtection/backupVaults/{vaultName}'} # type: ignore + @distributed_trace def delete( self, vault_name, # type: str @@ -397,27 +646,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_delete_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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 @@ -430,6 +669,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + def _update_initial( self, vault_name, # type: str @@ -443,32 +683,22 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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') + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PatchResourceRequestInput') - # 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_update_request_initial( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'PatchResourceRequestInput') - 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 @@ -484,8 +714,11 @@ def _update_initial( return cls(pipeline_response, deserialized, {}) return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}'} # type: ignore + + @distributed_trace def begin_update( self, vault_name, # type: str @@ -505,15 +738,19 @@ def begin_update( :type parameters: ~azure.mgmt.dataprotection.models.PatchResourceRequestInput :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. - :return: An instance of LROPoller that returns either BackupVaultResource or the result of cls(response) + :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 BackupVaultResource or the result of + cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.dataprotection.models.BackupVaultResource] - :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.BackupVaultResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -525,27 +762,21 @@ def begin_update( vault_name=vault_name, resource_group_name=resource_group_name, parameters=parameters, + 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('BackupVaultResource', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) return deserialized - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: @@ -557,8 +788,10 @@ 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.DataProtection/backupVaults/{vaultName}'} # type: ignore + @distributed_trace def check_name_availability( self, resource_group_name, # type: str @@ -587,32 +820,22 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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(parameters, 'CheckNameAvailabilityRequest') - # 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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + 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(parameters, 'CheckNameAvailabilityRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -626,4 +849,6 @@ def check_name_availability( return cls(pipeline_response, deserialized, {}) return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/checkNameAvailability'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py index 47420332c4c3..1e3b34c4eb0d 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations.py @@ -5,23 +5,69 @@ # 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_feature_support_request( + subscription_id, # type: str + location, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, '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 DataProtectionOperations(object): """DataProtectionOperations operations. @@ -44,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def check_feature_support( self, location, # type: str @@ -69,31 +116,21 @@ def check_feature_support( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.check_feature_support.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'location': self._serialize.url("location", location, 'str'), - } - 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(parameters, 'FeatureValidationRequestBase') - # 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_feature_support_request( + subscription_id=self._config.subscription_id, + location=location, + content_type=content_type, + json=_json, + template_url=self.check_feature_support.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(parameters, 'FeatureValidationRequestBase') - 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 @@ -107,4 +144,6 @@ def check_feature_support( return cls(pipeline_response, deserialized, {}) return deserialized + check_feature_support.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_operations.py index aa0b0343c117..d1ec2d2e2ac7 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_operations_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_data_protection_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-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/providers/Microsoft.DataProtection/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 DataProtectionOperationsOperations(object): """DataProtectionOperationsOperations 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,7 +88,8 @@ 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) + :return: An iterator like instance of either ClientDiscoveryResponse or the result of + cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.ClientDiscoveryResponse] :raises: ~azure.core.exceptions.HttpResponseError """ @@ -62,30 +98,27 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 +136,7 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py index a22827dafd75..a37e4ef3986f 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operation_result_operations.py @@ -5,23 +5,69 @@ # 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 + operation_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/operations/{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 ExportJobsOperationResultOperations(object): """ExportJobsOperationResultOperations operations. @@ -44,6 +90,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, resource_group_name, # type: str @@ -72,28 +119,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - '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_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.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 @@ -109,4 +146,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/operations/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py index 9fd4f08a874e..7bd338aaf93e 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_export_jobs_operations.py @@ -5,25 +5,69 @@ # 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.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, 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_trigger_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + vault_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs') + 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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class ExportJobsOperations(object): """ExportJobsOperations operations. @@ -58,27 +102,17 @@ def _trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self._trigger_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') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = build_trigger_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + template_url=self._trigger_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -90,12 +124,15 @@ def _trigger_initial( if response.status_code == 202: response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, None, response_headers) _trigger_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs'} # type: ignore + + @distributed_trace def begin_trigger( self, resource_group_name, # type: str @@ -111,15 +148,17 @@ def begin_trigger( :type vault_name: str :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 None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -133,21 +172,14 @@ def begin_trigger( cls=lambda x,y,z: x, **kwargs ) - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - 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, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -159,4 +191,5 @@ def get_long_running_output(pipeline_response): ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/exportBackupJobs'} # type: ignore diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py index 1e7e0d74d189..9c611525df64 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_jobs_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-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs') + 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 + job_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}') + 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'), + "jobId": _SERIALIZER.url("job_id", job_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 JobsOperations(object): """JobsOperations 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 @@ -59,8 +142,10 @@ def list( :param vault_name: The name of the backup 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 AzureBackupJobResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.AzureBackupJobResourceList] + :return: An iterator like instance of either AzureBackupJobResourceList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.AzureBackupJobResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBackupJobResourceList"] @@ -68,36 +153,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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('AzureBackupJobResourceList', pipeline_response) + deserialized = self._deserialize("AzureBackupJobResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -115,11 +197,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.DataProtection/backupVaults/{vaultName}/backupJobs'} # type: ignore + @distributed_trace def get( self, resource_group_name, # type: str @@ -147,28 +231,18 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'jobId': self._serialize.url("job_id", job_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_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + vault_name=vault_name, + job_id=job_id, + 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 @@ -182,4 +256,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py index cd2604a8468c..c979e66fb791 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_result_operations.py @@ -5,23 +5,67 @@ # 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 + operation_id, # type: str + location, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "operationId": _SERIALIZER.url("operation_id", operation_id, '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] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class OperationResultOperations(object): """OperationResultOperations operations. @@ -44,6 +88,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, operation_id, # type: str @@ -69,27 +114,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'operationId': self._serialize.url("operation_id", operation_id, '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') + + request = build_get_request( + subscription_id=self._config.subscription_id, + operation_id=operation_id, + location=location, + 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 @@ -97,8 +132,8 @@ def get( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} deserialized = None + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('OperationJobExtendedInfo', pipeline_response) @@ -106,9 +141,12 @@ def get( response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + if cls: return cls(pipeline_response, deserialized, response_headers) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationResults/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py index 0bc8bf9eacab..44f5e0689a3c 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_operation_status_operations.py @@ -5,23 +5,67 @@ # 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 + location, # type: str + operation_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "location": _SERIALIZER.url("location", location, '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 OperationStatusOperations(object): """OperationStatusOperations operations. @@ -44,6 +88,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get( self, location, # type: str @@ -69,27 +114,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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'), - 'location': self._serialize.url("location", location, '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_request( + subscription_id=self._config.subscription_id, + location=location, + operation_id=operation_id, + 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 @@ -103,4 +138,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py index 935b39fd586f..283201247c81 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_recovery_points_operations.py @@ -5,24 +5,117 @@ # 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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + filter = kwargs.pop('filter', None) # type: Optional[str] + skip_token = kwargs.pop('skip_token', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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') + if filter is not None: + query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = _SERIALIZER.query("skip_token", skip_token, '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( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + recovery_point_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_name, 'str'), + "recoveryPointId": _SERIALIZER.url("recovery_point_id", recovery_point_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 RecoveryPointsOperations(object): """RecoveryPointsOperations operations. @@ -45,6 +138,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def list( self, vault_name, # type: str @@ -68,8 +162,10 @@ def list( :param skip_token: skipToken Filter. :type skip_token: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AzureBackupRecoveryPointResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResourceList] + :return: An iterator like instance of either AzureBackupRecoveryPointResourceList or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.AzureBackupRecoveryPointResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AzureBackupRecoveryPointResourceList"] @@ -77,41 +173,39 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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 = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_list_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + filter=filter, + skip_token=skip_token, + 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( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + filter=filter, + skip_token=skip_token, + 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('AzureBackupRecoveryPointResourceList', pipeline_response) + deserialized = self._deserialize("AzureBackupRecoveryPointResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -129,11 +223,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.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints'} # type: ignore + @distributed_trace def get( self, vault_name, # type: str @@ -163,29 +259,19 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_name, 'str'), - 'recoveryPointId': self._serialize.url("recovery_point_id", recovery_point_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_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + recovery_point_id=recovery_point_id, + 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 @@ -199,4 +285,6 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_resource_guards_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_resource_guards_operations.py index a6502b9277ab..cbeebb3b7abd 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_resource_guards_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_resource_guards_operations.py @@ -5,24 +5,694 @@ # 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_get_resources_in_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/resourceGuards') + 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_get_resources_in_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards') + 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_put_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_get_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_delete_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_patch_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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 + ) + + +def build_get_disable_soft_delete_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_delete_resource_guard_proxy_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_backup_security_pin_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_delete_protected_item_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_update_protection_policy_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_update_protected_item_requests_objects_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_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_default_disable_soft_delete_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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_default_delete_resource_guard_proxy_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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_default_backup_security_pin_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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_default_delete_protected_item_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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_default_update_protection_policy_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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_default_update_protected_item_requests_object_request( + resource_group_name, # type: str + subscription_id, # type: str + resource_guards_name, # type: str + request_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}') + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "resourceGuardsName": _SERIALIZER.url("resource_guards_name", resource_guards_name, 'str'), + "requestName": _SERIALIZER.url("request_name", request_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 ResourceGuardsOperations(object): """ResourceGuardsOperations operations. @@ -45,6 +715,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def get_resources_in_subscription( self, **kwargs # type: Any @@ -55,8 +726,10 @@ def get_resources_in_subscription( Returns ResourceGuards collection belonging to a subscription. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceGuardResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] + :return: An iterator like instance of either ResourceGuardResourceList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceGuardResourceList"] @@ -64,34 +737,29 @@ def get_resources_in_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_resources_in_subscription.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) + + request = build_get_resources_in_subscription_request( + subscription_id=self._config.subscription_id, + template_url=self.get_resources_in_subscription.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_get_resources_in_subscription_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('ResourceGuardResourceList', pipeline_response) + deserialized = self._deserialize("ResourceGuardResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -109,11 +777,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_resources_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/resourceGuards'} # type: ignore + @distributed_trace def get_resources_in_resource_group( self, resource_group_name, # type: str @@ -127,8 +797,10 @@ def get_resources_in_resource_group( :param resource_group_name: The name of the resource group where the backup vault is present. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ResourceGuardResourceList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] + :return: An iterator like instance of either ResourceGuardResourceList or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.dataprotection.models.ResourceGuardResourceList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceGuardResourceList"] @@ -136,35 +808,31 @@ def get_resources_in_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_resources_in_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_get_resources_in_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + template_url=self.get_resources_in_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_get_resources_in_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('ResourceGuardResourceList', pipeline_response) + deserialized = self._deserialize("ResourceGuardResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -182,11 +850,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_resources_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards'} # type: ignore + @distributed_trace def put( self, resource_group_name, # type: str @@ -215,32 +885,22 @@ def put( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.put.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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(parameters, 'ResourceGuardResource') - # 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_put_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + content_type=content_type, + json=_json, + template_url=self.put.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(parameters, 'ResourceGuardResource') - 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 @@ -254,8 +914,11 @@ def put( return cls(pipeline_response, deserialized, {}) return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace def get( self, resource_group_name, # type: str @@ -281,27 +944,17 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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 @@ -315,8 +968,11 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace def delete( self, resource_group_name, # type: str @@ -342,27 +998,17 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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 @@ -375,6 +1021,8 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace def patch( self, resource_group_name, # type: str @@ -383,7 +1031,8 @@ def patch( **kwargs # type: Any ): # type: (...) -> "_models.ResourceGuardResource" - """Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. + """Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for + a resource. Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. @@ -404,32 +1053,22 @@ def patch( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.patch.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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(parameters, 'PatchResourceRequestInput') - # 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_patch_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + content_type=content_type, + json=_json, + template_url=self.patch.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(parameters, 'PatchResourceRequestInput') - 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 @@ -443,8 +1082,11 @@ def patch( return cls(pipeline_response, deserialized, {}) return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}'} # type: ignore + + @distributed_trace def get_disable_soft_delete_requests_objects( self, resource_group_name, # type: str @@ -452,7 +1094,8 @@ def get_disable_soft_delete_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -471,36 +1114,33 @@ def get_disable_soft_delete_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_disable_soft_delete_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_disable_soft_delete_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_disable_soft_delete_requests_objects.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_get_disable_soft_delete_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -518,11 +1158,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_disable_soft_delete_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests'} # type: ignore + @distributed_trace def get_delete_resource_guard_proxy_requests_objects( self, resource_group_name, # type: str @@ -530,7 +1172,8 @@ def get_delete_resource_guard_proxy_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -549,36 +1192,33 @@ def get_delete_resource_guard_proxy_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_delete_resource_guard_proxy_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_delete_resource_guard_proxy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_delete_resource_guard_proxy_requests_objects.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_get_delete_resource_guard_proxy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -596,11 +1236,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_delete_resource_guard_proxy_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests'} # type: ignore + @distributed_trace def get_backup_security_pin_requests_objects( self, resource_group_name, # type: str @@ -608,7 +1250,8 @@ def get_backup_security_pin_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -627,36 +1270,33 @@ def get_backup_security_pin_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_backup_security_pin_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_backup_security_pin_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_backup_security_pin_requests_objects.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_get_backup_security_pin_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -674,11 +1314,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_backup_security_pin_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests'} # type: ignore + @distributed_trace def get_delete_protected_item_requests_objects( self, resource_group_name, # type: str @@ -686,7 +1328,8 @@ def get_delete_protected_item_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -705,36 +1348,33 @@ def get_delete_protected_item_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_delete_protected_item_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_delete_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_delete_protected_item_requests_objects.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_get_delete_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -752,11 +1392,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_delete_protected_item_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests'} # type: ignore + @distributed_trace def get_update_protection_policy_requests_objects( self, resource_group_name, # type: str @@ -764,7 +1406,8 @@ def get_update_protection_policy_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -783,36 +1426,33 @@ def get_update_protection_policy_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_update_protection_policy_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_update_protection_policy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_update_protection_policy_requests_objects.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_get_update_protection_policy_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -830,11 +1470,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_update_protection_policy_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests'} # type: ignore + @distributed_trace def get_update_protected_item_requests_objects( self, resource_group_name, # type: str @@ -842,7 +1484,8 @@ def get_update_protected_item_requests_objects( **kwargs # type: Any ): # type: (...) -> Iterable["_models.DppBaseResourceList"] - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -861,36 +1504,33 @@ def get_update_protected_item_requests_objects( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-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.get_update_protected_item_requests_objects.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_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_get_update_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + template_url=self.get_update_protected_item_requests_objects.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_get_update_protected_item_requests_objects_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_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('DppBaseResourceList', pipeline_response) + deserialized = self._deserialize("DppBaseResourceList", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -908,11 +1548,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged( get_next, extract_data ) get_update_protected_item_requests_objects.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests'} # type: ignore + @distributed_trace def get_default_disable_soft_delete_requests_object( self, resource_group_name, # type: str @@ -921,7 +1563,8 @@ def get_default_disable_soft_delete_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -942,28 +1585,18 @@ def get_default_disable_soft_delete_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_disable_soft_delete_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_disable_soft_delete_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_disable_soft_delete_requests_object.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 @@ -977,8 +1610,11 @@ def get_default_disable_soft_delete_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_disable_soft_delete_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/disableSoftDeleteRequests/{requestName}'} # type: ignore + + @distributed_trace def get_default_delete_resource_guard_proxy_requests_object( self, resource_group_name, # type: str @@ -987,7 +1623,8 @@ def get_default_delete_resource_guard_proxy_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1008,28 +1645,18 @@ def get_default_delete_resource_guard_proxy_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_delete_resource_guard_proxy_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_delete_resource_guard_proxy_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_delete_resource_guard_proxy_requests_object.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 @@ -1043,8 +1670,11 @@ def get_default_delete_resource_guard_proxy_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_delete_resource_guard_proxy_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteResourceGuardProxyRequests/{requestName}'} # type: ignore + + @distributed_trace def get_default_backup_security_pin_requests_object( self, resource_group_name, # type: str @@ -1053,7 +1683,8 @@ def get_default_backup_security_pin_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1074,28 +1705,18 @@ def get_default_backup_security_pin_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_backup_security_pin_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_backup_security_pin_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_backup_security_pin_requests_object.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 @@ -1109,8 +1730,11 @@ def get_default_backup_security_pin_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_backup_security_pin_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/getBackupSecurityPINRequests/{requestName}'} # type: ignore + + @distributed_trace def get_default_delete_protected_item_requests_object( self, resource_group_name, # type: str @@ -1119,7 +1743,8 @@ def get_default_delete_protected_item_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1140,28 +1765,18 @@ def get_default_delete_protected_item_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_delete_protected_item_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_delete_protected_item_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_delete_protected_item_requests_object.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 @@ -1175,8 +1790,11 @@ def get_default_delete_protected_item_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_delete_protected_item_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}'} # type: ignore + + @distributed_trace def get_default_update_protection_policy_requests_object( self, resource_group_name, # type: str @@ -1185,7 +1803,8 @@ def get_default_update_protection_policy_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1206,28 +1825,18 @@ def get_default_update_protection_policy_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_update_protection_policy_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_update_protection_policy_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_update_protection_policy_requests_object.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 @@ -1241,8 +1850,11 @@ def get_default_update_protection_policy_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_update_protection_policy_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectionPolicyRequests/{requestName}'} # type: ignore + + @distributed_trace def get_default_update_protected_item_requests_object( self, resource_group_name, # type: str @@ -1251,7 +1863,8 @@ def get_default_update_protected_item_requests_object( **kwargs # type: Any ): # type: (...) -> "_models.DppBaseResource" - """Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. + """Returns collection of operation request objects for a critical operation protected by the given + ResourceGuard resource. Returns collection of operation request objects for a critical operation protected by the given ResourceGuard resource. @@ -1272,28 +1885,18 @@ def get_default_update_protected_item_requests_object( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - accept = "application/json" - - # Construct URL - url = self.get_default_update_protected_item_requests_object.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGuardsName': self._serialize.url("resource_guards_name", resource_guards_name, 'str'), - 'requestName': self._serialize.url("request_name", request_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_default_update_protected_item_requests_object_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + resource_guards_name=resource_guards_name, + request_name=request_name, + template_url=self.get_default_update_protected_item_requests_object.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 @@ -1307,4 +1910,6 @@ def get_default_update_protected_item_requests_object( return cls(pipeline_response, deserialized, {}) return deserialized + get_default_update_protected_item_requests_object.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/updateProtectedItemRequests/{requestName}'} # type: ignore + diff --git a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_operations.py b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_operations.py index c35009b32d98..8de93a559041 100644 --- a/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_operations.py +++ b/sdk/dataprotection/azure-mgmt-dataprotection/azure/mgmt/dataprotection/operations/_restorable_time_ranges_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_find_request( + vault_name, # type: str + resource_group_name, # type: str + subscription_id, # type: str + backup_instance_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-07-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges') + path_format_arguments = { + "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "backupInstanceName": _SERIALIZER.url("backup_instance_name", backup_instance_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="POST", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +# fmt: on class RestorableTimeRangesOperations(object): """RestorableTimeRangesOperations operations. @@ -44,6 +94,7 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + @distributed_trace def find( self, vault_name, # type: str @@ -73,33 +124,23 @@ def find( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-07-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.find.metadata['url'] # type: ignore - path_format_arguments = { - 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'backupInstanceName': self._serialize.url("backup_instance_name", backup_instance_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(parameters, 'AzureBackupFindRestorableTimeRangesRequest') - # 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_find_request( + vault_name=vault_name, + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + backup_instance_name=backup_instance_name, + content_type=content_type, + json=_json, + template_url=self.find.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(parameters, 'AzureBackupFindRestorableTimeRangesRequest') - 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 @@ -113,4 +154,6 @@ def find( return cls(pipeline_response, deserialized, {}) return deserialized + find.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges'} # type: ignore +