diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md
index 479ffbb4876b..c297a444826a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/CHANGELOG.md
@@ -1,5 +1,21 @@
# Release History
+## 9.2.0 (2025-04-09)
+
+### Features Added
+
+ - Model `AzureFileShareRecoveryPoint` added property `recovery_point_tier_details`
+ - Model `AzureIaaSClassicComputeVMProtectedItem` added property `policy_type`
+ - Model `AzureIaaSComputeVMProtectedItem` added property `policy_type`
+ - Model `AzureIaaSVMProtectedItem` added property `policy_type`
+ - Model `AzureStorageContainer` added property `operation_type`
+ - Enum `OperationType` added member `REHYDRATE`
+ - Added model `AzureVmWorkloadSAPAseDatabaseProtectableItem`
+ - Added model `AzureWorkloadSAPAsePointInTimeRecoveryPoint`
+ - Added model `AzureWorkloadSAPAsePointInTimeRestoreRequest`
+ - Added model `AzureWorkloadSAPAseRecoveryPoint`
+ - Added model `AzureWorkloadSAPAseRestoreRequest`
+
## 9.1.0 (2024-04-22)
### Features Added
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md
index 3829fe5f875b..0fa804713543 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/README.md
@@ -24,7 +24,7 @@ pip install azure-identity
### Authentication
-By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
+By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json
index e0769101898e..b49c1ee9d1ec 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "2897e4040dd3d922061ae55bc002358aeaded619",
+ "commit": "8449e4af94ec9307715385e3bdb2adfa56b2da66",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
- "autorest": "3.9.7",
+ "autorest": "3.10.2",
"use": [
- "@autorest/python@6.13.7",
+ "@autorest/python@6.27.4",
"@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/recoveryservicesbackup/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
+ "autorest_command": "autorest specification/recoveryservicesbackup/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/recoveryservicesbackup/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py
index f89ed38360ab..6b357123854d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "9.1.0"
+VERSION = "9.2.0"
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/__init__.py
index 4365d800f0cd..82cbe78128c0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/__init__.py
@@ -5,15 +5,21 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._recovery_services_backup_client import RecoveryServicesBackupClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._recovery_services_backup_client import RecoveryServicesBackupClient # type: ignore
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -21,6 +27,6 @@
__all__ = [
"RecoveryServicesBackupClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_configuration.py
index faef70e51a05..961befe03514 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_configuration.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@@ -28,13 +27,13 @@ class RecoveryServicesBackupClientConfiguration: # pylint: disable=too-many-ins
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription Id. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-04-01")
+ api_version: str = kwargs.pop("api_version", "2025-02-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_recovery_services_backup_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_recovery_services_backup_client.py
index 6e682578ce80..0c6defdd61e3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_recovery_services_backup_client.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_recovery_services_backup_client.py
@@ -8,6 +8,7 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
+from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
@@ -74,13 +75,12 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class RecoveryServicesBackupClient(
RecoveryServicesBackupClientOperationsMixin
-): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+): # pylint: disable=too-many-instance-attributes
"""Open API 2.0 Specs for Azure RecoveryServices Backup service.
:ivar backup_resource_storage_configs_non_crr: BackupResourceStorageConfigsNonCRROperations
@@ -248,7 +248,7 @@ class RecoveryServicesBackupClient(
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -443,7 +443,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()
- def __enter__(self) -> "RecoveryServicesBackupClient":
+ def __enter__(self) -> Self:
self._client.__enter__()
return self
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_serialization.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_serialization.py
index 2f781d740827..b24ab2885450 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_serialization.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_serialization.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +52,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
:param data: Input, could be bytes or stream (will be decoded with UTF8) or text
:type data: str or bytes or IO
:param str content_type: The content type.
+ :return: The deserialized data.
+ :rtype: object
"""
if hasattr(data, "read"):
# Assume a stream
@@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
try:
return json.loads(data_as_str)
except ValueError as err:
- raise DeserializationError("JSON is invalid: {}".format(err), err)
+ raise DeserializationError("JSON is invalid: {}".format(err), err) from err
elif "xml" in (content_type or []):
try:
@@ -144,6 +145,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
+ elif content_type.startswith("text/"):
+ return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
@classmethod
@@ -153,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -182,15 +190,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -204,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -233,24 +256,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -298,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None:
setattr(self, k, kwargs[k])
def __eq__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are equal
+ :rtype: bool
+ """
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
def __ne__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are not equal
+ :rtype: bool
+ """
return not self.__eq__(other)
def __str__(self) -> str:
@@ -324,7 +366,11 @@ def is_xml_model(cls) -> bool:
@classmethod
def _create_xml_node(cls):
- """Create XML node."""
+ """Create XML node.
+
+ :returns: The XML node
+ :rtype: xml.etree.ElementTree.Element
+ """
try:
xml_map = cls._xml_map # type: ignore
except AttributeError:
@@ -344,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, keep_readonly=keep_readonly, **kwargs
+ )
def as_dict(
self,
@@ -378,12 +426,15 @@ def my_key_transformer(key, attr_desc, value):
If you want XML serialization, you can pass the kwargs is_xml=True.
+ :param bool keep_readonly: If you want to serialize the readonly attributes
:param function key_transformer: A key transformer function.
:returns: A dict JSON compatible object
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs
+ )
@classmethod
def _infer_class_models(cls):
@@ -393,7 +444,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -406,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -424,9 +476,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -446,21 +500,25 @@ def _flatten_subtype(cls, key, objects):
return {}
result = dict(cls._subtype_map[key])
for valuetype in cls._subtype_map[key].values():
- result.update(objects[valuetype]._flatten_subtype(key, objects))
+ result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
return result
@classmethod
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
- Remove the polymorphic key from the initial data.
+
+ :param dict response: The initial data
+ :param dict objects: The class objects
+ :returns: The class to be used
+ :rtype: class
"""
for subtype_key in cls.__dict__.get("_subtype_map", {}).keys():
subtype_value = None
if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
if subtype_value:
@@ -499,11 +557,13 @@ def _decode_attribute_map_key(key):
inside the received data.
:param str key: A key string from the generated code
+ :returns: The decoded key
+ :rtype: str
"""
return key.replace("\\.", ".")
-class Serializer(object):
+class Serializer: # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -538,7 +598,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -558,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -590,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
serialized = {}
if is_xml_model_serialization:
- serialized = target_obj._create_xml_node()
+ serialized = target_obj._create_xml_node() # pylint: disable=protected-access
try:
- attributes = target_obj._attribute_map
+ attributes = target_obj._attribute_map # pylint: disable=protected-access
for attr, attr_desc in attributes.items():
attr_name = attr
- if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False):
+ if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access
+ attr_name, {}
+ ).get("readonly", False):
continue
if attr_name == "additional_properties" and attr_desc["key"] == "":
@@ -631,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if isinstance(new_attr, list):
serialized.extend(new_attr) # type: ignore
elif isinstance(new_attr, ET.Element):
- # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces.
+ # If the down XML has no XML/Name,
+ # we MUST replace the tag with the local tag. But keeping the namespaces.
if "name" not in getattr(orig_attr, "_xml_map", {}):
splitted_tag = new_attr.tag.split("}")
if len(splitted_tag) == 2: # Namespace
@@ -662,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -701,7 +767,7 @@ def body(self, data, data_type, **kwargs):
attribute_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
]
- data = deserializer._deserialize(data_type, data)
+ data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access
except DeserializationError as err:
raise SerializationError("Unable to build a model: " + str(err)) from err
@@ -710,9 +776,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -726,21 +794,20 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
@@ -757,19 +824,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -778,21 +846,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -803,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs):
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
- elif data_type in self.serialize_type:
+ if data_type in self.serialize_type:
return self.serialize_type[data_type](data, **kwargs)
# If dependencies is empty, try with current data class
@@ -819,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
raise SerializationError(msg.format(data, data_type)) from err
- else:
- return self._serialize(data, **kwargs)
+ return self._serialize(data, **kwargs)
@classmethod
- def _get_custom_serializers(cls, data_type, **kwargs):
+ def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements
custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type)
if custom_serializer:
return custom_serializer
@@ -839,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs):
- basic_types_serializers dict[str, callable] : If set, use the callable as serializer
- is_xml bool : If set, use xml_basic_types_serializers
- :param data: Object to be serialized.
+ :param obj data: Object to be serialized.
:param str data_type: Type of object in the iterable.
+ :rtype: str, int, float, bool
+ :return: serialized object
"""
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
if custom_serializer:
return custom_serializer(data)
if data_type == "str":
return cls.serialize_unicode(data)
- return eval(data_type)(data) # nosec
+ return eval(data_type)(data) # nosec # pylint: disable=eval-used
@classmethod
def serialize_unicode(cls, data):
"""Special handling for serializing unicode strings in Py2.
Encode to UTF-8 if unicode, otherwise handle as a str.
- :param data: Object to be serialized.
+ :param str data: Object to be serialized.
:rtype: str
+ :return: serialized object
"""
try: # If I received an enum, return its value
return data.value
@@ -869,8 +938,7 @@ def serialize_unicode(cls, data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
def serialize_iter(self, data, iter_type, div=None, **kwargs):
"""Serialize iterable.
@@ -880,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
serialization_ctxt['type'] should be same as data_type.
- is_xml bool : If set, serialize as XML
- :param list attr: Object to be serialized.
+ :param list data: Object to be serialized.
:param str iter_type: Type of object in the iterable.
- :param bool required: Whether the objects in the iterable must
- not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
- :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
+ :return: serialized iterable
"""
if isinstance(data, str):
raise SerializationError("Refuse str type as a valid iter type.")
@@ -943,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs):
:param dict attr: Object to be serialized.
:param str dict_type: Type of object in the dictionary.
- :param bool required: Whether the objects in the dictionary must
- not be None or empty.
:rtype: dict
+ :return: serialized dictionary
"""
serialization_ctxt = kwargs.get("serialization_ctxt", {})
serialized = {}
@@ -969,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs):
return serialized
- def serialize_object(self, attr, **kwargs):
+ def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
@@ -977,6 +1042,7 @@ def serialize_object(self, attr, **kwargs):
:param dict attr: Object to be serialized.
:rtype: dict or str
+ :return: serialized object
"""
if attr is None:
return None
@@ -1001,7 +1067,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_decimal(attr)
# If it's a model or I know this dependency, serialize as a Model
- elif obj_type in self.dependencies.values() or isinstance(attr, Model):
+ if obj_type in self.dependencies.values() or isinstance(attr, Model):
return self._serialize(attr)
if obj_type == dict:
@@ -1032,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None):
try:
enum_obj(result) # type: ignore
return result
- except ValueError:
+ except ValueError as exc:
for enum_value in enum_obj: # type: ignore
if enum_value.value.lower() == str(attr).lower():
return enum_value.value
error = "{!r} is not valid value for enum {!r}"
- raise SerializationError(error.format(attr, enum_obj))
+ raise SerializationError(error.format(attr, enum_obj)) from exc
@staticmethod
- def serialize_bytearray(attr, **kwargs):
+ def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize bytearray into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
return b64encode(attr).decode()
@staticmethod
- def serialize_base64(attr, **kwargs):
+ def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize str into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
encoded = b64encode(attr).decode("ascii")
return encoded.strip("=").replace("+", "-").replace("/", "_")
@staticmethod
- def serialize_decimal(attr, **kwargs):
+ def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Decimal object to float.
- :param attr: Object to be serialized.
+ :param decimal attr: Object to be serialized.
:rtype: float
+ :return: serialized decimal
"""
return float(attr)
@staticmethod
- def serialize_long(attr, **kwargs):
+ def serialize_long(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize long (Py2) or int (Py3).
- :param attr: Object to be serialized.
+ :param int attr: Object to be serialized.
:rtype: int/long
+ :return: serialized long
"""
return _long_type(attr)
@staticmethod
- def serialize_date(attr, **kwargs):
+ def serialize_date(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Date object into ISO-8601 formatted string.
:param Date attr: Object to be serialized.
:rtype: str
+ :return: serialized date
"""
if isinstance(attr, str):
attr = isodate.parse_date(attr)
@@ -1089,11 +1160,12 @@ def serialize_date(attr, **kwargs):
return t
@staticmethod
- def serialize_time(attr, **kwargs):
+ def serialize_time(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Time object into ISO-8601 formatted string.
:param datetime.time attr: Object to be serialized.
:rtype: str
+ :return: serialized time
"""
if isinstance(attr, str):
attr = isodate.parse_time(attr)
@@ -1103,30 +1175,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1139,12 +1213,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1170,13 +1245,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1184,11 +1260,11 @@ def serialize_unix(attr, **kwargs):
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
return int(calendar.timegm(attr.utctimetuple()))
- except AttributeError:
- raise TypeError("Unix time object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("Unix time object must be valid Datetime object.") from exc
-def rest_key_extractor(attr, attr_desc, data):
+def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
key = attr_desc["key"]
working_data = data
@@ -1209,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data):
return working_data.get(key)
-def rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements
+ attr, attr_desc, data
+):
key = attr_desc["key"]
working_data = data
@@ -1230,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
return attribute_key_case_insensitive_extractor(key, None, working_data)
-def last_rest_key_extractor(attr, attr_desc, data):
- """Extract the attribute in "data" based on the last part of the JSON path key."""
+def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
+ """Extract the attribute in "data" based on the last part of the JSON path key.
+
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
+ """
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
return attribute_key_extractor(dict_keys[-1], None, data)
-def last_rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
"""Extract the attribute in "data" based on the last part of the JSON path key.
This is the case insensitive version of "last_rest_key_extractor"
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
"""
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
@@ -1277,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type):
return xml_name
-def xml_key_extractor(attr, attr_desc, data):
+def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements
if isinstance(data, dict):
return None
@@ -1329,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1352,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data):
return children[0]
-class Deserializer(object):
+class Deserializer:
"""Response object model deserializer.
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1361,9 +1450,9 @@ class Deserializer(object):
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
- valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
+ valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1401,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1414,12 +1504,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1438,13 +1529,13 @@ def _deserialize(self, target_obj, data):
if isinstance(response, str):
return self.deserialize_data(data, response)
- elif isinstance(response, type) and issubclass(response, Enum):
+ if isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
- if data is None:
+ if data is None or data is CoreNull:
return data
try:
- attributes = response._attribute_map # type: ignore
+ attributes = response._attribute_map # type: ignore # pylint: disable=protected-access
d_attrs = {}
for attr, attr_desc in attributes.items():
# Check empty string. If it's not empty, someone has a real "additionalProperties"...
@@ -1474,9 +1565,8 @@ def _deserialize(self, target_obj, data):
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
raise DeserializationError(msg) from err
- else:
- additional_properties = self._build_additional_properties(attributes, data)
- return self._instantiate_model(response, d_attrs, additional_properties)
+ additional_properties = self._build_additional_properties(attributes, data)
+ return self._instantiate_model(response, d_attrs, additional_properties)
def _build_additional_properties(self, attribute_map, data):
if not self.additional_properties_detection:
@@ -1503,6 +1593,8 @@ def _classify_target(self, target, data):
:param str target: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
+ :return: The classified target object and its class name.
+ :rtype: tuple
"""
if target is None:
return None, None
@@ -1514,7 +1606,7 @@ def _classify_target(self, target, data):
return target, target
try:
- target = target._classify(data, self.dependencies) # type: ignore
+ target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access
except AttributeError:
pass # Target is not a Model, no classify
return target, target.__class__.__name__ # type: ignore
@@ -1529,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
:param str target_obj: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
:param str content_type: Swagger "produces" if available.
+ :return: Deserialized object.
+ :rtype: object
"""
try:
return self(target_obj, data, content_type=content_type)
- except:
+ except: # pylint: disable=bare-except
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
@@ -1550,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None):
If raw_data is something else, bypass all logic and return it directly.
- :param raw_data: Data to be processed.
- :param content_type: How to parse if raw_data is a string/bytes.
+ :param obj raw_data: Data to be processed.
+ :param str content_type: How to parse if raw_data is a string/bytes.
:raises JSONDecodeError: If JSON is requested and parsing is impossible.
:raises UnicodeDecodeError: If bytes is not UTF8
+ :rtype: object
+ :return: Unpacked content.
"""
# Assume this is enough to detect a Pipeline Response without importing it
context = getattr(raw_data, "context", {})
@@ -1577,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None):
def _instantiate_model(self, response, attrs, additional_properties=None):
"""Instantiate a response model passing in deserialized args.
- :param response: The response model class.
- :param d_attrs: The deserialized response attributes.
+ :param Response response: The response model class.
+ :param dict attrs: The deserialized response attributes.
+ :param dict additional_properties: Additional properties to be set.
+ :rtype: Response
+ :return: The instantiated response model.
"""
if callable(response):
subtype = getattr(response, "_subtype_map", {})
try:
- readonly = [k for k, v in response._validation.items() if v.get("readonly")]
- const = [k for k, v in response._validation.items() if v.get("constant")]
+ readonly = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("readonly")
+ ]
+ const = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("constant")
+ ]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
- response_obj.additional_properties = additional_properties
+ response_obj.additional_properties = additional_properties # type: ignore
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
- raise DeserializationError(msg + str(err))
+ raise DeserializationError(msg + str(err)) from err
else:
try:
for attr, value in attrs.items():
@@ -1603,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1625,7 +1733,11 @@ def deserialize_data(self, data, data_type):
if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())):
return data
- is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"]
+ is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment
+ "object",
+ "[]",
+ r"{}",
+ ]
if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text:
return None
data_val = self.deserialize_type[data_type](data)
@@ -1645,14 +1757,14 @@ def deserialize_data(self, data, data_type):
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
raise DeserializationError(msg) from err
- else:
- return self._deserialize(obj_type, data)
+ return self._deserialize(obj_type, data)
def deserialize_iter(self, attr, iter_type):
"""Deserialize an iterable.
:param list attr: Iterable to be deserialized.
:param str iter_type: The type of object in the iterable.
+ :return: Deserialized iterable.
:rtype: list
"""
if attr is None:
@@ -1669,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type):
:param dict/list attr: Dictionary to be deserialized. Also accepts
a list of key, value pairs.
:param str dict_type: The object type of the items in the dictionary.
+ :return: Deserialized dictionary.
:rtype: dict
"""
if isinstance(attr, list):
@@ -1679,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1718,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs):
pass
return deserialized
- else:
- error = "Cannot deserialize generic object with type: "
- raise TypeError(error + str(obj_type))
+ error = "Cannot deserialize generic object with type: "
+ raise TypeError(error + str(obj_type))
- def deserialize_basic(self, attr, data_type):
+ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements
"""Deserialize basic builtin data type from string.
Will attempt to convert to str, int, float and bool.
This function will also accept '1', '0', 'true' and 'false' as
@@ -1730,6 +1843,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1741,24 +1855,23 @@ def deserialize_basic(self, attr, data_type):
if data_type == "str":
# None or '', node is empty string.
return ""
- else:
- # None or '', node with a strong type is None.
- # Don't try to model "empty bool" or "empty int"
- return None
+ # None or '', node with a strong type is None.
+ # Don't try to model "empty bool" or "empty int"
+ return None
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, str):
+ if isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
- elif attr.lower() in ["false", "0"]:
+ if attr.lower() in ["false", "0"]:
return False
raise TypeError("Invalid boolean value: {}".format(attr))
if data_type == "str":
return self.deserialize_unicode(attr)
- return eval(data_type)(attr) # nosec
+ return eval(data_type)(attr) # nosec # pylint: disable=eval-used
@staticmethod
def deserialize_unicode(data):
@@ -1766,6 +1879,7 @@ def deserialize_unicode(data):
as a string.
:param str data: response string to be deserialized.
+ :return: Deserialized string.
:rtype: str or unicode
"""
# We might be here because we have an enum modeled as string,
@@ -1779,8 +1893,7 @@ def deserialize_unicode(data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
@staticmethod
def deserialize_enum(data, enum_obj):
@@ -1792,6 +1905,7 @@ def deserialize_enum(data, enum_obj):
:param str data: Response string to be deserialized. If this value is
None or invalid it will be returned as-is.
:param Enum enum_obj: Enum object to deserialize to.
+ :return: Deserialized enum object.
:rtype: Enum
"""
if isinstance(data, enum_obj) or data is None:
@@ -1802,9 +1916,9 @@ def deserialize_enum(data, enum_obj):
# Workaround. We might consider remove it in the future.
try:
return list(enum_obj.__members__.values())[data]
- except IndexError:
+ except IndexError as exc:
error = "{!r} is not a valid index for enum {!r}"
- raise DeserializationError(error.format(data, enum_obj))
+ raise DeserializationError(error.format(data, enum_obj)) from exc
try:
return enum_obj(str(data))
except ValueError:
@@ -1820,6 +1934,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1832,6 +1947,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1847,8 +1963,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1863,6 +1980,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1875,6 +1993,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1885,14 +2004,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1908,6 +2027,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1922,6 +2042,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1937,14 +2058,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1974,8 +2095,7 @@ def deserialize_iso(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_unix(attr):
@@ -1983,6 +2103,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -1994,5 +2115,4 @@ def deserialize_unix(attr):
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_vendor.py
index 1c9b3845478f..29bb43ff4a9c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_vendor.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_vendor.py
@@ -8,25 +8,14 @@
from abc import ABC
from typing import TYPE_CHECKING
-from azure.core.pipeline.transport import HttpRequest
-
from ._configuration import RecoveryServicesBackupClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from ._serialization import Deserializer, Serializer
-def _convert_request(request, files=None):
- data = request.content if not files else None
- request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
- if files:
- request.set_formdata_body(files)
- return request
-
-
class RecoveryServicesBackupClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_version.py
index f89ed38360ab..6b357123854d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_version.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "9.1.0"
+VERSION = "9.2.0"
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/__init__.py
index 8e5f383e6ee4..53250d84c9b1 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/__init__.py
@@ -5,12 +5,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._recovery_services_backup_client import RecoveryServicesBackupClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._recovery_services_backup_client import RecoveryServicesBackupClient # type: ignore
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@
__all__ = [
"RecoveryServicesBackupClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_configuration.py
index 145656e3c12b..11feae42f734 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_configuration.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@@ -28,13 +27,13 @@ class RecoveryServicesBackupClientConfiguration: # pylint: disable=too-many-ins
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The subscription Id. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-04-01")
+ api_version: str = kwargs.pop("api_version", "2025-02-01")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_recovery_services_backup_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_recovery_services_backup_client.py
index 323c1eebd797..510b81326623 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_recovery_services_backup_client.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_recovery_services_backup_client.py
@@ -8,6 +8,7 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
+from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
@@ -74,13 +75,12 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class RecoveryServicesBackupClient(
RecoveryServicesBackupClientOperationsMixin
-): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+): # pylint: disable=too-many-instance-attributes
"""Open API 2.0 Specs for Azure RecoveryServices Backup service.
:ivar backup_resource_storage_configs_non_crr: BackupResourceStorageConfigsNonCRROperations
@@ -250,7 +250,7 @@ class RecoveryServicesBackupClient(
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this
+ :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -447,7 +447,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()
- async def __aenter__(self) -> "RecoveryServicesBackupClient":
+ async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_vendor.py
index 1da41c8befcd..59f8ee276e9a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_vendor.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/_vendor.py
@@ -8,12 +8,9 @@
from abc import ABC
from typing import TYPE_CHECKING
-from azure.core.pipeline.transport import HttpRequest
-
from ._configuration import RecoveryServicesBackupClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/__init__.py
index 29071c5cf960..634b1b06bf96 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/__init__.py
@@ -5,65 +5,69 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._backup_resource_storage_configs_non_crr_operations import BackupResourceStorageConfigsNonCRROperations
-from ._protection_intent_operations import ProtectionIntentOperations
-from ._backup_status_operations import BackupStatusOperations
-from ._feature_support_operations import FeatureSupportOperations
-from ._backup_protection_intent_operations import BackupProtectionIntentOperations
-from ._backup_usage_summaries_operations import BackupUsageSummariesOperations
-from ._operations import Operations
-from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations
-from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations
-from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations
-from ._private_endpoint_operations import PrivateEndpointOperations
-from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin
-from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations
-from ._protected_items_operations import ProtectedItemsOperations
-from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations
-from ._recovery_points_operations import RecoveryPointsOperations
-from ._restores_operations import RestoresOperations
-from ._backup_policies_operations import BackupPoliciesOperations
-from ._protection_policies_operations import ProtectionPoliciesOperations
-from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations
-from ._backup_jobs_operations import BackupJobsOperations
-from ._job_details_operations import JobDetailsOperations
-from ._job_cancellations_operations import JobCancellationsOperations
-from ._job_operation_results_operations import JobOperationResultsOperations
-from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations
-from ._jobs_operations import JobsOperations
-from ._backup_protected_items_operations import BackupProtectedItemsOperations
-from ._operation_operations import OperationOperations
-from ._validate_operation_operations import ValidateOperationOperations
-from ._validate_operation_results_operations import ValidateOperationResultsOperations
-from ._validate_operation_statuses_operations import ValidateOperationStatusesOperations
-from ._backup_engines_operations import BackupEnginesOperations
-from ._protection_container_refresh_operation_results_operations import (
- ProtectionContainerRefreshOperationResultsOperations,
-)
-from ._protectable_containers_operations import ProtectableContainersOperations
-from ._protection_containers_operations import ProtectionContainersOperations
-from ._backup_workload_items_operations import BackupWorkloadItemsOperations
-from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations
-from ._backups_operations import BackupsOperations
-from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations
-from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations
-from ._backup_operation_results_operations import BackupOperationResultsOperations
-from ._backup_operation_statuses_operations import BackupOperationStatusesOperations
-from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations
-from ._backup_protectable_items_operations import BackupProtectableItemsOperations
-from ._backup_protection_containers_operations import BackupProtectionContainersOperations
-from ._deleted_protection_containers_operations import DeletedProtectionContainersOperations
-from ._security_pins_operations import SecurityPINsOperations
-from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations
-from ._resource_guard_proxies_operations import ResourceGuardProxiesOperations
-from ._resource_guard_proxy_operations import ResourceGuardProxyOperations
-from ._fetch_tiering_cost_operations import FetchTieringCostOperations
-from ._get_tiering_cost_operation_result_operations import GetTieringCostOperationResultOperations
-from ._tiering_cost_operation_status_operations import TieringCostOperationStatusOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._backup_resource_storage_configs_non_crr_operations import BackupResourceStorageConfigsNonCRROperations # type: ignore
+from ._protection_intent_operations import ProtectionIntentOperations # type: ignore
+from ._backup_status_operations import BackupStatusOperations # type: ignore
+from ._feature_support_operations import FeatureSupportOperations # type: ignore
+from ._backup_protection_intent_operations import BackupProtectionIntentOperations # type: ignore
+from ._backup_usage_summaries_operations import BackupUsageSummariesOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations # type: ignore
+from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations # type: ignore
+from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations # type: ignore
+from ._private_endpoint_operations import PrivateEndpointOperations # type: ignore
+from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin # type: ignore
+from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations # type: ignore
+from ._protected_items_operations import ProtectedItemsOperations # type: ignore
+from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations # type: ignore
+from ._recovery_points_operations import RecoveryPointsOperations # type: ignore
+from ._restores_operations import RestoresOperations # type: ignore
+from ._backup_policies_operations import BackupPoliciesOperations # type: ignore
+from ._protection_policies_operations import ProtectionPoliciesOperations # type: ignore
+from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations # type: ignore
+from ._backup_jobs_operations import BackupJobsOperations # type: ignore
+from ._job_details_operations import JobDetailsOperations # type: ignore
+from ._job_cancellations_operations import JobCancellationsOperations # type: ignore
+from ._job_operation_results_operations import JobOperationResultsOperations # type: ignore
+from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations # type: ignore
+from ._jobs_operations import JobsOperations # type: ignore
+from ._backup_protected_items_operations import BackupProtectedItemsOperations # type: ignore
+from ._operation_operations import OperationOperations # type: ignore
+from ._validate_operation_operations import ValidateOperationOperations # type: ignore
+from ._validate_operation_results_operations import ValidateOperationResultsOperations # type: ignore
+from ._validate_operation_statuses_operations import ValidateOperationStatusesOperations # type: ignore
+from ._backup_engines_operations import BackupEnginesOperations # type: ignore
+from ._protection_container_refresh_operation_results_operations import ProtectionContainerRefreshOperationResultsOperations # type: ignore
+from ._protectable_containers_operations import ProtectableContainersOperations # type: ignore
+from ._protection_containers_operations import ProtectionContainersOperations # type: ignore
+from ._backup_workload_items_operations import BackupWorkloadItemsOperations # type: ignore
+from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations # type: ignore
+from ._backups_operations import BackupsOperations # type: ignore
+from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations # type: ignore
+from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations # type: ignore
+from ._backup_operation_results_operations import BackupOperationResultsOperations # type: ignore
+from ._backup_operation_statuses_operations import BackupOperationStatusesOperations # type: ignore
+from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations # type: ignore
+from ._backup_protectable_items_operations import BackupProtectableItemsOperations # type: ignore
+from ._backup_protection_containers_operations import BackupProtectionContainersOperations # type: ignore
+from ._deleted_protection_containers_operations import DeletedProtectionContainersOperations # type: ignore
+from ._security_pins_operations import SecurityPINsOperations # type: ignore
+from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations # type: ignore
+from ._resource_guard_proxies_operations import ResourceGuardProxiesOperations # type: ignore
+from ._resource_guard_proxy_operations import ResourceGuardProxyOperations # type: ignore
+from ._fetch_tiering_cost_operations import FetchTieringCostOperations # type: ignore
+from ._get_tiering_cost_operation_result_operations import GetTieringCostOperationResultOperations # type: ignore
+from ._tiering_cost_operation_status_operations import TieringCostOperationStatusOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -121,5 +125,5 @@
"GetTieringCostOperationResultOperations",
"TieringCostOperationStatusOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_engines_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_engines_operations.py
index 8abf219dde77..6d88d30d154b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_engines_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_engines_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,18 +19,19 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_engines_operations import build_get_request, build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -63,6 +64,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.BackupEngineBaseResource"]:
+ # pylint: disable=line-too-long
"""Backup management servers registered to Recovery Services Vault. Returns a pageable list of
servers.
@@ -87,7 +89,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupEngineBaseResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -108,7 +110,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -124,7 +125,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -180,7 +180,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupEngineBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -205,7 +205,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -219,7 +218,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupEngineBaseResource", pipeline_response)
+ deserialized = self._deserialize("BackupEngineBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_jobs_operations.py
index b2cb4a1ecee7..c8fd662cc590 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_jobs_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -84,7 +85,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -105,7 +106,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -121,7 +121,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_results_operations.py
index 061e0e273ed5..5ab0576eda71 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -52,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def get( # pylint: disable=inconsistent-return-statements
- self, vault_name: str, resource_group_name: str, operation_id: str, **kwargs: Any
- ) -> None:
+ async def get(self, vault_name: str, resource_group_name: str, operation_id: str, **kwargs: Any) -> None:
"""Provides the status of the delete operations such as deleting backed up item. Once the
operation has started, the
status code in the response would be Accepted. It will continue to be in this state till it
@@ -74,7 +73,7 @@ async def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -97,7 +96,6 @@ async def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_statuses_operations.py
index dffc6f1d7baf..3f5ce46fc877 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_operation_statuses_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -72,7 +73,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -95,7 +96,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -109,7 +109,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_policies_operations.py
index e5766b110dac..d0a13fa7ffbd 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_policies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_policies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_policies_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,6 +58,7 @@ def __init__(self, *args, **kwargs) -> None:
def list(
self, vault_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.ProtectionPolicyResource"]:
+ # pylint: disable=line-too-long
"""Lists of backup policies associated with Recovery Services Vault. API provides pagination
parameters to fetch
scoped results.
@@ -80,7 +82,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionPolicyResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -100,7 +102,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -116,7 +117,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protectable_items_operations.py
index db12ab535554..64f210822a31 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protectable_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protectable_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_protectable_items_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -62,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.WorkloadProtectableItemResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of protectable objects within your subscription according to the query
filter and the
pagination parameters.
@@ -87,7 +89,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkloadProtectableItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -108,7 +110,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -124,7 +125,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protected_items_operations.py
index 4fd9a550625f..2778e144daa6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protected_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protected_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_protected_items_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -62,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.ProtectedItemResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of all items that are backed up within a vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -85,7 +87,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectedItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -106,7 +108,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -122,7 +123,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_containers_operations.py
index 6b5454195f0b..9e6cdd6c80bf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_protection_containers_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,6 +58,7 @@ def __init__(self, *args, **kwargs) -> None:
def list(
self, vault_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.ProtectionContainerResource"]:
+ # pylint: disable=line-too-long
"""Lists the containers registered to Recovery Services Vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -78,7 +80,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -98,7 +100,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -114,7 +115,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_intent_operations.py
index ae8387afe465..1601071b8ec8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_intent_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_protection_intent_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_protection_intent_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -62,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.ProtectionIntentResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of all intents that are present within a vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -85,7 +87,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionIntentResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -106,7 +108,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -122,7 +123,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_encryption_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_encryption_configs_operations.py
index 48ab1898e1e1..3cb3f81e0c73 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_encryption_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_encryption_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_resource_encryption_configs_operations import build_get_request, build_update_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -68,7 +69,7 @@ async def get(
~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceEncryptionConfigExtendedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -90,7 +91,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -105,7 +105,9 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceEncryptionConfigExtendedResource", pipeline_response)
+ deserialized = self._deserialize(
+ "BackupResourceEncryptionConfigExtendedResource", pipeline_response.http_response
+ )
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -113,7 +115,7 @@ async def get(
return deserialized # type: ignore
@overload
- async def update( # pylint: disable=inconsistent-return-statements
+ async def update(
self,
vault_name: str,
resource_group_name: str,
@@ -141,7 +143,7 @@ async def update( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def update( # pylint: disable=inconsistent-return-statements
+ async def update(
self,
vault_name: str,
resource_group_name: str,
@@ -168,7 +170,7 @@ async def update( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def update( # pylint: disable=inconsistent-return-statements
+ async def update(
self,
vault_name: str,
resource_group_name: str,
@@ -191,7 +193,7 @@ async def update( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -225,7 +227,6 @@ async def update( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_storage_configs_non_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_storage_configs_non_crr_operations.py
index 83fb6ba12ad1..f2f462cc59ad 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_storage_configs_non_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_storage_configs_non_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,21 +18,22 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_resource_storage_configs_non_crr_operations import (
build_get_request,
build_patch_request,
build_update_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +72,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -93,7 +94,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -108,7 +108,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -193,7 +193,7 @@ async def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -227,7 +227,6 @@ async def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -242,7 +241,7 @@ async def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -250,7 +249,7 @@ async def update(
return deserialized # type: ignore
@overload
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -278,7 +277,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -305,7 +304,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -327,7 +326,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -361,7 +360,6 @@ async def patch( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_vault_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_vault_configs_operations.py
index 5cdcd5ab80ae..974c6dc562f6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_vault_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_resource_vault_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,21 +18,22 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_resource_vault_configs_operations import (
build_get_request,
build_put_request,
build_update_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +72,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -93,7 +94,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -108,7 +108,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -203,7 +203,7 @@ async def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -238,7 +238,6 @@ async def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -253,7 +252,7 @@ async def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -348,7 +347,7 @@ async def put(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -383,7 +382,6 @@ async def put(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -398,7 +396,7 @@ async def put(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_status_operations.py
index b0aed943760b..7535ee25a96d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_status_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -115,7 +116,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupStatusResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -148,7 +149,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -162,7 +162,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupStatusResponse", pipeline_response)
+ deserialized = self._deserialize("BackupStatusResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_usage_summaries_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_usage_summaries_operations.py
index 17a10fa2bce0..06af73933a4b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_usage_summaries_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_usage_summaries_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_usage_summaries_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -62,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.BackupManagementUsage"]:
+ # pylint: disable=line-too-long
"""Fetches the backup management usage summaries of the vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -85,7 +87,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupManagementUsageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -106,7 +108,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -122,7 +123,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_workload_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_workload_items_operations.py
index f71b9449b14d..0a562e27881e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_workload_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backup_workload_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_workload_items_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -64,6 +65,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.WorkloadItemResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of workload item of a specific container according to the query filter
and the pagination
parameters.
@@ -93,7 +95,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkloadItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -116,7 +118,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -132,7 +133,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backups_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backups_operations.py
index be67d92850fb..11f5b787862a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backups_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_backups_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backups_operations import build_trigger_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -53,7 +54,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@overload
- async def trigger( # pylint: disable=inconsistent-return-statements
+ async def trigger(
self,
vault_name: str,
resource_group_name: str,
@@ -91,7 +92,7 @@ async def trigger( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def trigger( # pylint: disable=inconsistent-return-statements
+ async def trigger(
self,
vault_name: str,
resource_group_name: str,
@@ -129,7 +130,7 @@ async def trigger( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def trigger( # pylint: disable=inconsistent-return-statements
+ async def trigger(
self,
vault_name: str,
resource_group_name: str,
@@ -162,7 +163,7 @@ async def trigger( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -199,7 +200,6 @@ async def trigger( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_bms_prepare_data_move_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_bms_prepare_data_move_operation_result_operations.py
index e126b7d7a4da..473ff0463ab5 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_bms_prepare_data_move_operation_result_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_bms_prepare_data_move_operation_result_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._bms_prepare_data_move_operation_result_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -70,7 +71,7 @@ async def get(
or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -93,7 +94,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -110,7 +110,9 @@ async def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("VaultStorageConfigOperationResultResponse", pipeline_response)
+ deserialized = self._deserialize(
+ "VaultStorageConfigOperationResultResponse", pipeline_response.http_response
+ )
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_deleted_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_deleted_protection_containers_operations.py
index 4473e931d749..7b33051d3a1d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_deleted_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_deleted_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._deleted_protection_containers_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,6 +58,7 @@ def __init__(self, *args, **kwargs) -> None:
def list(
self, resource_group_name: str, vault_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.ProtectionContainerResource"]:
+ # pylint: disable=line-too-long
"""Lists the soft deleted containers registered to Recovery Services Vault.
:param resource_group_name: The name of the resource group where the recovery services vault is
@@ -78,7 +80,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -98,7 +100,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -114,7 +115,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_export_jobs_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_export_jobs_operation_results_operations.py
index 474dc4832437..7cfa9fa0c171 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_export_jobs_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_export_jobs_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._export_jobs_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +72,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationResultInfoBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -94,7 +95,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -108,11 +108,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response)
-
- if response.status_code == 202:
- deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response)
+ deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_feature_support_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_feature_support_operations.py
index dcebcc0215e9..fbba812cae2e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_feature_support_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_feature_support_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._feature_support_operations import build_validate_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -118,7 +119,7 @@ async def validate(
~azure.mgmt.recoveryservicesbackup.activestamp.models.AzureVMResourceFeatureSupportResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -151,7 +152,6 @@ async def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -165,7 +165,7 @@ async def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AzureVMResourceFeatureSupportResponse", pipeline_response)
+ deserialized = self._deserialize("AzureVMResourceFeatureSupportResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_fetch_tiering_cost_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_fetch_tiering_cost_operations.py
index d14e77b38b33..2de5aa789481 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_fetch_tiering_cost_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_fetch_tiering_cost_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,22 +15,25 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._fetch_tiering_cost_operations import build_post_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -60,8 +63,8 @@ async def _post_initial(
vault_name: str,
parameters: Union[_models.FetchTieringCostInfoRequest, IO[bytes]],
**kwargs: Any
- ) -> Optional[_models.TieringCostInfo]:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -74,7 +77,7 @@ async def _post_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[Optional[_models.TieringCostInfo]] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -95,10 +98,10 @@ async def _post_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -106,17 +109,19 @@ async def _post_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = None
response_headers = {}
- if response.status_code == 200:
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
-
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -233,10 +238,11 @@ async def begin_post(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
+ deserialized = self._deserialize("TieringCostInfo", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_get_tiering_cost_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_get_tiering_cost_operation_result_operations.py
index ebb352f30db1..0751e7bb8241 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_get_tiering_cost_operation_result_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_get_tiering_cost_operation_result_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._get_tiering_cost_operation_result_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -68,7 +69,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TieringCostInfo
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -91,7 +92,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -105,7 +105,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
+ deserialized = self._deserialize("TieringCostInfo", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_item_level_recovery_connections_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_item_level_recovery_connections_operations.py
index bb4753006bbb..4b12d932eab9 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_item_level_recovery_connections_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_item_level_recovery_connections_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._item_level_recovery_connections_operations import build_provision_request, build_revoke_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -53,7 +54,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@overload
- async def provision( # pylint: disable=inconsistent-return-statements
+ async def provision(
self,
vault_name: str,
resource_group_name: str,
@@ -99,7 +100,7 @@ async def provision( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def provision( # pylint: disable=inconsistent-return-statements
+ async def provision(
self,
vault_name: str,
resource_group_name: str,
@@ -145,7 +146,7 @@ async def provision( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def provision( # pylint: disable=inconsistent-return-statements
+ async def provision(
self,
vault_name: str,
resource_group_name: str,
@@ -186,7 +187,7 @@ async def provision( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -224,7 +225,6 @@ async def provision( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -242,7 +242,7 @@ async def provision( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
- async def revoke( # pylint: disable=inconsistent-return-statements
+ async def revoke(
self,
vault_name: str,
resource_group_name: str,
@@ -276,7 +276,7 @@ async def revoke( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -302,7 +302,6 @@ async def revoke( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_cancellations_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_cancellations_operations.py
index 41acaa2f7231..57d6378ac314 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_cancellations_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_cancellations_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._job_cancellations_operations import build_trigger_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -52,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def trigger( # pylint: disable=inconsistent-return-statements
- self, vault_name: str, resource_group_name: str, job_name: str, **kwargs: Any
- ) -> None:
+ async def trigger(self, vault_name: str, resource_group_name: str, job_name: str, **kwargs: Any) -> None:
"""Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call
GetCancelOperationResult API.
@@ -69,7 +68,7 @@ async def trigger( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -92,7 +91,6 @@ async def trigger( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_details_operations.py
index cabd773f0966..a67e01a791aa 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_details_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_details_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._job_details_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -66,7 +67,7 @@ async def get(self, vault_name: str, resource_group_name: str, job_name: str, **
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.JobResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -89,7 +90,6 @@ async def get(self, vault_name: str, resource_group_name: str, job_name: str, **
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -103,7 +103,7 @@ async def get(self, vault_name: str, resource_group_name: str, job_name: str, **
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("JobResource", pipeline_response)
+ deserialized = self._deserialize("JobResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_operation_results_operations.py
index 02e057bbe6cb..01e9344b5f2b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_job_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._job_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def get( # pylint: disable=inconsistent-return-statements
+ async def get(
self, vault_name: str, resource_group_name: str, job_name: str, operation_id: str, **kwargs: Any
) -> None:
"""Fetches the result of any operation.
@@ -71,7 +72,7 @@ async def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -95,7 +96,6 @@ async def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_jobs_operations.py
index 2d9b7eb9ea49..bf20feffe451 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._jobs_operations import build_export_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def export( # pylint: disable=inconsistent-return-statements
+ async def export(
self, vault_name: str, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any
) -> None:
"""Triggers export of jobs specified by filters and returns an OperationID to track.
@@ -68,7 +69,7 @@ async def export( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -91,7 +92,6 @@ async def export( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operation_operations.py
index b1881bc8f484..6f3267a50b41 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operation_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operation_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._operation_operations import build_validate_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -131,7 +132,7 @@ async def validate(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ValidateOperationsResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,7 +166,6 @@ async def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -179,7 +179,7 @@ async def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response)
+ deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operations.py
index d8275b973377..a93da553f769 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -55,6 +56,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.ClientDiscoveryValueForSingleApi"]:
+ # pylint: disable=line-too-long
"""Returns the list of available operations.
:return: An iterator like instance of either ClientDiscoveryValueForSingleApi or the result of
@@ -69,7 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ClientDiscoveryValueForS
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ClientDiscoveryResponse] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -85,7 +87,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -101,7 +102,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_connection_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_connection_operations.py
index 589de026ce3c..8b5561c1b969 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_connection_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_connection_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,26 +15,29 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._private_endpoint_connection_operations import (
build_delete_request,
build_get_request,
build_put_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +78,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.PrivateEndpointConnectionResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -98,7 +101,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -113,7 +115,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -127,8 +129,8 @@ async def _put_initial(
private_endpoint_connection_name: str,
parameters: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
- ) -> _models.PrivateEndpointConnectionResource:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -141,7 +143,7 @@ async def _put_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -163,10 +165,10 @@ async def _put_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -174,14 +176,14 @@ async def _put_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -199,6 +201,7 @@ async def begin_put(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -232,6 +235,7 @@ async def begin_put(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -262,6 +266,7 @@ async def begin_put(
parameters: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -304,10 +309,11 @@ async def begin_put(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
@@ -329,10 +335,10 @@ def get_long_running_output(pipeline_response):
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
- async def _delete_initial( # pylint: disable=inconsistent-return-statements
+ async def _delete_initial(
self, vault_name: str, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -344,7 +350,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
vault_name=vault_name,
@@ -355,10 +361,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -366,11 +372,19 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace_async
async def begin_delete(
@@ -398,7 +412,7 @@ async def begin_delete(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._delete_initial( # type: ignore
+ raw_result = await self._delete_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@@ -408,6 +422,7 @@ async def begin_delete(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_operations.py
index 14a253c5db23..149aa4d4c218 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_private_endpoint_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._private_endpoint_operations import build_get_operation_status_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -77,7 +78,7 @@ async def get_operation_status(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -101,7 +102,6 @@ async def get_operation_status(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -116,7 +116,7 @@ async def get_operation_status(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protectable_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protectable_containers_operations.py
index a45b9bb8b7e7..f4030739a101 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protectable_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protectable_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protectable_containers_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,6 +58,7 @@ def __init__(self, *args, **kwargs) -> None:
def list(
self, vault_name: str, resource_group_name: str, fabric_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.ProtectableContainerResource"]:
+ # pylint: disable=line-too-long
"""Lists the containers that can be registered to Recovery Services Vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -80,7 +82,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectableContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -101,7 +103,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -117,7 +118,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_results_operations.py
index 9300a9b643c2..d18259553f9f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protected_item_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +83,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -108,7 +109,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -124,7 +124,7 @@ async def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_statuses_operations.py
index eabeefbdf9d1..d56459c954d6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_item_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protected_item_operation_statuses_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -86,7 +87,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -112,7 +113,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -126,7 +126,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_items_operations.py
index d4b45e3d9e36..f10cbc6cf473 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protected_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,21 +18,22 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protected_items_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -88,7 +89,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -114,7 +115,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -128,7 +128,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -257,7 +257,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -295,7 +295,6 @@ async def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -311,7 +310,7 @@ async def create_or_update(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -319,7 +318,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self,
vault_name: str,
resource_group_name: str,
@@ -347,7 +346,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -372,7 +371,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_operation_results_operations.py
index e99af15ca524..f6c33df7c4cc 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protection_container_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +81,7 @@ async def get(
None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -105,7 +106,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -121,7 +121,7 @@ async def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_refresh_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_refresh_operation_results_operations.py
index 0315e440f07c..fad279cd2ea8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_refresh_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_container_refresh_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protection_container_refresh_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def get( # pylint: disable=inconsistent-return-statements
+ async def get(
self, vault_name: str, resource_group_name: str, fabric_name: str, operation_id: str, **kwargs: Any
) -> None:
"""Provides the result of the refresh operation triggered by the BeginRefresh operation.
@@ -71,7 +72,7 @@ async def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -95,7 +96,6 @@ async def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_containers_operations.py
index b3be04766a75..31664434064d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,19 +15,19 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._protection_containers_operations import (
build_get_request,
build_inquire_request,
@@ -35,8 +35,11 @@
build_register_request,
build_unregister_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -79,7 +82,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionContainerResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -103,7 +106,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -117,7 +119,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -132,8 +134,8 @@ async def _register_initial(
container_name: str,
parameters: Union[_models.ProtectionContainerResource, IO[bytes]],
**kwargs: Any
- ) -> Optional[_models.ProtectionContainerResource]:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -146,7 +148,7 @@ async def _register_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[Optional[_models.ProtectionContainerResource]] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -169,10 +171,10 @@ async def _register_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -180,12 +182,14 @@ async def _register_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -204,6 +208,7 @@ async def begin_register(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -243,6 +248,7 @@ async def begin_register(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -279,6 +285,7 @@ async def begin_register(
parameters: Union[_models.ProtectionContainerResource, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -326,10 +333,11 @@ async def begin_register(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
@@ -352,7 +360,7 @@ def get_long_running_output(pipeline_response):
)
@distributed_trace_async
- async def unregister( # pylint: disable=inconsistent-return-statements
+ async def unregister(
self, vault_name: str, resource_group_name: str, fabric_name: str, container_name: str, **kwargs: Any
) -> None:
"""Unregisters the given container from your Recovery Services Vault. This is an asynchronous
@@ -374,7 +382,7 @@ async def unregister( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -398,7 +406,6 @@ async def unregister( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -416,7 +423,7 @@ async def unregister( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
- async def inquire( # pylint: disable=inconsistent-return-statements
+ async def inquire(
self,
vault_name: str,
resource_group_name: str,
@@ -445,7 +452,7 @@ async def inquire( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -470,7 +477,6 @@ async def inquire( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -488,7 +494,7 @@ async def inquire( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
- async def refresh( # pylint: disable=inconsistent-return-statements
+ async def refresh(
self, vault_name: str, resource_group_name: str, fabric_name: str, filter: Optional[str] = None, **kwargs: Any
) -> None:
"""Discovers all the containers in the subscription that can be backed up to Recovery Services
@@ -509,7 +515,7 @@ async def refresh( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -533,7 +539,6 @@ async def refresh( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_intent_operations.py
index 2fec0b91b7e9..ac5459c0592f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_intent_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_intent_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,22 +18,23 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protection_intent_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
build_validate_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -152,7 +153,7 @@ async def validate(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.PreValidateEnableBackupResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -185,7 +186,6 @@ async def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -199,7 +199,7 @@ async def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("PreValidateEnableBackupResponse", pipeline_response)
+ deserialized = self._deserialize("PreValidateEnableBackupResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -227,7 +227,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionIntentResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -251,7 +251,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -265,7 +264,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionIntentResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionIntentResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -368,7 +367,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionIntentResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +403,6 @@ async def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -418,7 +416,7 @@ async def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionIntentResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionIntentResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -426,7 +424,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, vault_name: str, resource_group_name: str, fabric_name: str, intent_object_name: str, **kwargs: Any
) -> None:
"""Used to remove intent from an item.
@@ -444,7 +442,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -468,7 +466,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policies_operations.py
index dc7d5c98e738..508e03b5053c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,26 +15,29 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._protection_policies_operations import (
build_create_or_update_request,
build_delete_request,
build_get_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -77,7 +80,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -100,7 +103,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -114,7 +116,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -223,7 +225,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -259,7 +261,6 @@ async def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -275,17 +276,17 @@ async def create_or_update(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- async def _delete_initial( # pylint: disable=inconsistent-return-statements
+ async def _delete_initial(
self, vault_name: str, resource_group_name: str, policy_name: str, **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -297,7 +298,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
vault_name=vault_name,
@@ -308,10 +309,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -319,11 +320,19 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace_async
async def begin_delete(
@@ -353,7 +362,7 @@ async def begin_delete(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._delete_initial( # type: ignore
+ raw_result = await self._delete_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
policy_name=policy_name,
@@ -363,6 +372,7 @@ async def begin_delete(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_results_operations.py
index 33dc696cd5ad..2abd2e0cb124 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protection_policy_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +72,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -95,7 +96,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -109,7 +109,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_statuses_operations.py
index bd4710eccb40..febe335d61a3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_protection_policy_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._protection_policy_operation_statuses_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +76,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -99,7 +100,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -113,7 +113,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_operations.py
index 233eddc1a7dd..20a3e7356607 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,18 +19,19 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._recovery_points_operations import build_get_request, build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -65,6 +66,7 @@ def list(
filter: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.RecoveryPointResource"]:
+ # pylint: disable=line-too-long
"""Lists the backup copies for the backed up item.
:param vault_name: The name of the recovery services vault. Required.
@@ -92,7 +94,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -115,7 +117,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -131,7 +132,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -194,7 +194,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -220,7 +220,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -234,7 +233,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecoveryPointResource", pipeline_response)
+ deserialized = self._deserialize("RecoveryPointResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py
index 863b0e5be037..6ecb59fc6887 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_points_recommended_for_move_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,17 +20,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._recovery_points_recommended_for_move_operations import build_list_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -67,6 +68,7 @@ def list(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncIterable["_models.RecoveryPointResource"]:
+ # pylint: disable=line-too-long
"""Lists the recovery points recommended for move to another tier.
:param vault_name: The name of the recovery services vault. Required.
@@ -106,6 +108,7 @@ def list(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncIterable["_models.RecoveryPointResource"]:
+ # pylint: disable=line-too-long
"""Lists the recovery points recommended for move to another tier.
:param vault_name: The name of the recovery services vault. Required.
@@ -142,6 +145,7 @@ def list(
parameters: Union[_models.ListRecoveryPointsRecommendedForMoveRequest, IO[bytes]],
**kwargs: Any
) -> AsyncIterable["_models.RecoveryPointResource"]:
+ # pylint: disable=line-too-long
"""Lists the recovery points recommended for move to another tier.
:param vault_name: The name of the recovery services vault. Required.
@@ -173,7 +177,7 @@ def list(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -205,7 +209,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -221,7 +224,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_services_backup_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_services_backup_client_operations.py
index 47f4f5b713c3..307ca1e7a0bf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_services_backup_client_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_recovery_services_backup_client_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,19 +15,19 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._recovery_services_backup_client_operations import (
build_bms_prepare_data_move_request,
build_bms_trigger_data_move_request,
@@ -36,6 +36,10 @@
)
from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -43,6 +47,7 @@
class RecoveryServicesBackupClientOperationsMixin( # pylint: disable=name-too-long
RecoveryServicesBackupClientMixinABC
):
+
@distributed_trace_async
async def get_operation_status(
self, vault_name: str, resource_group_name: str, operation_id: str, **kwargs: Any
@@ -60,7 +65,7 @@ async def get_operation_status(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -83,7 +88,6 @@ async def get_operation_status(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -98,21 +102,21 @@ async def get_operation_status(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- async def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return-statements
+ async def _bms_prepare_data_move_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.PrepareDataMoveRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -125,7 +129,7 @@ async def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -146,10 +150,10 @@ async def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -157,12 +161,20 @@ async def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_bms_prepare_data_move(
@@ -251,7 +263,7 @@ async def begin_bms_prepare_data_move(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._bms_prepare_data_move_initial( # type: ignore
+ raw_result = await self._bms_prepare_data_move_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -262,6 +274,7 @@ async def begin_bms_prepare_data_move(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
@@ -283,14 +296,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
- async def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return-statements
+ async def _bms_trigger_data_move_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.TriggerDataMoveRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -303,7 +316,7 @@ async def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -324,10 +337,10 @@ async def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -335,12 +348,20 @@ async def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_bms_trigger_data_move(
@@ -429,7 +450,7 @@ async def begin_bms_trigger_data_move(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._bms_trigger_data_move_initial( # type: ignore
+ raw_result = await self._bms_trigger_data_move_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -440,6 +461,7 @@ async def begin_bms_trigger_data_move(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
@@ -461,7 +483,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
)
return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
- async def _move_recovery_point_initial( # pylint: disable=inconsistent-return-statements
+ async def _move_recovery_point_initial(
self,
vault_name: str,
resource_group_name: str,
@@ -471,8 +493,8 @@ async def _move_recovery_point_initial( # pylint: disable=inconsistent-return-s
recovery_point_id: str,
parameters: Union[_models.MoveRPAcrossTiersRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -485,7 +507,7 @@ async def _move_recovery_point_initial( # pylint: disable=inconsistent-return-s
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -510,10 +532,10 @@ async def _move_recovery_point_initial( # pylint: disable=inconsistent-return-s
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -521,11 +543,19 @@ async def _move_recovery_point_initial( # pylint: disable=inconsistent-return-s
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_move_recovery_point(
@@ -657,7 +687,7 @@ async def begin_move_recovery_point(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._move_recovery_point_initial( # type: ignore
+ raw_result = await self._move_recovery_point_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
fabric_name=fabric_name,
@@ -672,6 +702,7 @@ async def begin_move_recovery_point(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxies_operations.py
index 85cdaa43437d..99444ea8a00a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._resource_guard_proxies_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -57,6 +58,7 @@ def __init__(self, *args, **kwargs) -> None:
def get(
self, vault_name: str, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.ResourceGuardProxyBaseResource"]:
+ # pylint: disable=line-too-long
"""List the ResourceGuardProxies under vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -76,7 +78,7 @@ def get(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ResourceGuardProxyBaseResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -95,7 +97,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -111,7 +112,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxy_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxy_operations.py
index 294512bb6ae4..57ffc7c5ab45 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxy_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_resource_guard_proxy_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,22 +18,23 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._resource_guard_proxy_operations import (
build_delete_request,
build_get_request,
build_put_request,
build_unlock_delete_request,
)
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,7 +75,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ResourceGuardProxyBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -97,7 +98,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -111,7 +111,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response)
+ deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -209,7 +209,7 @@ async def put(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ResourceGuardProxyBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -244,7 +244,6 @@ async def put(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -258,7 +257,7 @@ async def put(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response)
+ deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -266,7 +265,7 @@ async def put(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, vault_name: str, resource_group_name: str, resource_guard_proxy_name: str, **kwargs: Any
) -> None:
"""Delete ResourceGuardProxy under vault.
@@ -282,7 +281,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -305,7 +304,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -408,7 +406,7 @@ async def unlock_delete(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.UnlockDeleteResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -443,7 +441,6 @@ async def unlock_delete(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -457,7 +454,7 @@ async def unlock_delete(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("UnlockDeleteResponse", pipeline_response)
+ deserialized = self._deserialize("UnlockDeleteResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_restores_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_restores_operations.py
index 09f88215b58b..a890c2e0af6e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_restores_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_restores_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,22 +15,25 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._restores_operations import build_trigger_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -54,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- async def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ async def _trigger_initial(
self,
vault_name: str,
resource_group_name: str,
@@ -65,8 +68,8 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
parameters: Union[_models.RestoreRequestResource, IO[bytes]],
x_ms_authorization_auxiliary: Optional[str] = None,
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -79,7 +82,7 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -105,10 +108,10 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -116,11 +119,19 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_trigger(
@@ -263,7 +274,7 @@ async def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._trigger_initial( # type: ignore
+ raw_result = await self._trigger_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
fabric_name=fabric_name,
@@ -279,6 +290,7 @@ async def begin_trigger(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_security_pins_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_security_pins_operations.py
index 62035c853990..532b37a4ce89 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_security_pins_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_security_pins_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,17 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._security_pins_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -138,7 +139,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TokenInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -176,7 +177,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -190,7 +190,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("TokenInformation", pipeline_response)
+ deserialized = self._deserialize("TokenInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_tiering_cost_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_tiering_cost_operation_status_operations.py
index 06ba4bf90dec..eb14512d3f2f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_tiering_cost_operation_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_tiering_cost_operation_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._tiering_cost_operation_status_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -68,7 +69,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -91,7 +92,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -105,7 +105,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_operations.py
index 5169b40f3c46..0afafd9c4056 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,22 +15,25 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._validate_operation_operations import build_trigger_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -54,14 +57,14 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- async def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ async def _trigger_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.ValidateOperationRequestResource, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -74,7 +77,7 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -95,10 +98,10 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -106,11 +109,19 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_trigger(
@@ -204,7 +215,7 @@ async def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._trigger_initial( # type: ignore
+ raw_result = await self._trigger_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -215,6 +226,7 @@ async def begin_trigger(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_results_operations.py
index 50721e2d7724..9de83963803c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._validate_operation_results_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -70,7 +71,7 @@ async def get(
None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -93,7 +94,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -109,7 +109,7 @@ async def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response)
+ deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_statuses_operations.py
index e81957266b3a..64af23ad960f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/aio/operations/_validate_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,17 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._validate_operation_statuses_operations import build_get_request
-from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -73,7 +74,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -96,7 +97,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -110,7 +110,7 @@ async def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/__init__.py
index 3f5044b6d508..b215733b81ce 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/__init__.py
@@ -5,393 +5,409 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import AzureBackupGoalFeatureSupportRequest
-from ._models_py3 import AzureBackupServerContainer
-from ._models_py3 import AzureBackupServerEngine
-from ._models_py3 import AzureFileShareBackupRequest
-from ._models_py3 import AzureFileShareProtectableItem
-from ._models_py3 import AzureFileShareProtectionPolicy
-from ._models_py3 import AzureFileShareProvisionILRRequest
-from ._models_py3 import AzureFileShareRecoveryPoint
-from ._models_py3 import AzureFileShareRestoreRequest
-from ._models_py3 import AzureFileshareProtectedItem
-from ._models_py3 import AzureFileshareProtectedItemExtendedInfo
-from ._models_py3 import AzureIaaSClassicComputeVMContainer
-from ._models_py3 import AzureIaaSClassicComputeVMProtectableItem
-from ._models_py3 import AzureIaaSClassicComputeVMProtectedItem
-from ._models_py3 import AzureIaaSComputeVMContainer
-from ._models_py3 import AzureIaaSComputeVMProtectableItem
-from ._models_py3 import AzureIaaSComputeVMProtectedItem
-from ._models_py3 import AzureIaaSVMErrorInfo
-from ._models_py3 import AzureIaaSVMHealthDetails
-from ._models_py3 import AzureIaaSVMJob
-from ._models_py3 import AzureIaaSVMJobExtendedInfo
-from ._models_py3 import AzureIaaSVMJobTaskDetails
-from ._models_py3 import AzureIaaSVMJobV2
-from ._models_py3 import AzureIaaSVMProtectedItem
-from ._models_py3 import AzureIaaSVMProtectedItemExtendedInfo
-from ._models_py3 import AzureIaaSVMProtectionPolicy
-from ._models_py3 import AzureRecoveryServiceVaultProtectionIntent
-from ._models_py3 import AzureResourceProtectionIntent
-from ._models_py3 import AzureSQLAGWorkloadContainerProtectionContainer
-from ._models_py3 import AzureSqlContainer
-from ._models_py3 import AzureSqlProtectedItem
-from ._models_py3 import AzureSqlProtectedItemExtendedInfo
-from ._models_py3 import AzureSqlProtectionPolicy
-from ._models_py3 import AzureStorageContainer
-from ._models_py3 import AzureStorageErrorInfo
-from ._models_py3 import AzureStorageJob
-from ._models_py3 import AzureStorageJobExtendedInfo
-from ._models_py3 import AzureStorageJobTaskDetails
-from ._models_py3 import AzureStorageProtectableContainer
-from ._models_py3 import AzureVMAppContainerProtectableContainer
-from ._models_py3 import AzureVMAppContainerProtectionContainer
-from ._models_py3 import AzureVMResourceFeatureSupportRequest
-from ._models_py3 import AzureVMResourceFeatureSupportResponse
-from ._models_py3 import AzureVmWorkloadItem
-from ._models_py3 import AzureVmWorkloadProtectableItem
-from ._models_py3 import AzureVmWorkloadProtectedItem
-from ._models_py3 import AzureVmWorkloadProtectedItemExtendedInfo
-from ._models_py3 import AzureVmWorkloadProtectionPolicy
-from ._models_py3 import AzureVmWorkloadSAPAseDatabaseProtectedItem
-from ._models_py3 import AzureVmWorkloadSAPAseDatabaseWorkloadItem
-from ._models_py3 import AzureVmWorkloadSAPAseSystemProtectableItem
-from ._models_py3 import AzureVmWorkloadSAPAseSystemWorkloadItem
-from ._models_py3 import AzureVmWorkloadSAPHanaDBInstance
-from ._models_py3 import AzureVmWorkloadSAPHanaDBInstanceProtectedItem
-from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseProtectableItem
-from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseProtectedItem
-from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseWorkloadItem
-from ._models_py3 import AzureVmWorkloadSAPHanaHSRProtectableItem
-from ._models_py3 import AzureVmWorkloadSAPHanaSystemProtectableItem
-from ._models_py3 import AzureVmWorkloadSAPHanaSystemWorkloadItem
-from ._models_py3 import AzureVmWorkloadSQLAvailabilityGroupProtectableItem
-from ._models_py3 import AzureVmWorkloadSQLDatabaseProtectableItem
-from ._models_py3 import AzureVmWorkloadSQLDatabaseProtectedItem
-from ._models_py3 import AzureVmWorkloadSQLDatabaseWorkloadItem
-from ._models_py3 import AzureVmWorkloadSQLInstanceProtectableItem
-from ._models_py3 import AzureVmWorkloadSQLInstanceWorkloadItem
-from ._models_py3 import AzureWorkloadAutoProtectionIntent
-from ._models_py3 import AzureWorkloadBackupRequest
-from ._models_py3 import AzureWorkloadContainer
-from ._models_py3 import AzureWorkloadContainerAutoProtectionIntent
-from ._models_py3 import AzureWorkloadContainerExtendedInfo
-from ._models_py3 import AzureWorkloadErrorInfo
-from ._models_py3 import AzureWorkloadJob
-from ._models_py3 import AzureWorkloadJobExtendedInfo
-from ._models_py3 import AzureWorkloadJobTaskDetails
-from ._models_py3 import AzureWorkloadPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadRecoveryPoint
-from ._models_py3 import AzureWorkloadRestoreRequest
-from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest
-from ._models_py3 import AzureWorkloadSAPHanaRecoveryPoint
-from ._models_py3 import AzureWorkloadSAPHanaRestoreRequest
-from ._models_py3 import AzureWorkloadSAPHanaRestoreWithRehydrateRequest
-from ._models_py3 import AzureWorkloadSQLAutoProtectionIntent
-from ._models_py3 import AzureWorkloadSQLPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadSQLPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest
-from ._models_py3 import AzureWorkloadSQLRecoveryPoint
-from ._models_py3 import AzureWorkloadSQLRecoveryPointExtendedInfo
-from ._models_py3 import AzureWorkloadSQLRestoreRequest
-from ._models_py3 import AzureWorkloadSQLRestoreWithRehydrateRequest
-from ._models_py3 import BEKDetails
-from ._models_py3 import BMSBackupEngineQueryObject
-from ._models_py3 import BMSBackupEnginesQueryObject
-from ._models_py3 import BMSBackupSummariesQueryObject
-from ._models_py3 import BMSContainerQueryObject
-from ._models_py3 import BMSContainersInquiryQueryObject
-from ._models_py3 import BMSPOQueryObject
-from ._models_py3 import BMSRPQueryObject
-from ._models_py3 import BMSRefreshContainersQueryObject
-from ._models_py3 import BMSWorkloadItemQueryObject
-from ._models_py3 import BackupEngineBase
-from ._models_py3 import BackupEngineBaseResource
-from ._models_py3 import BackupEngineBaseResourceList
-from ._models_py3 import BackupEngineExtendedInfo
-from ._models_py3 import BackupManagementUsage
-from ._models_py3 import BackupManagementUsageList
-from ._models_py3 import BackupRequest
-from ._models_py3 import BackupRequestResource
-from ._models_py3 import BackupResourceConfig
-from ._models_py3 import BackupResourceConfigResource
-from ._models_py3 import BackupResourceEncryptionConfig
-from ._models_py3 import BackupResourceEncryptionConfigExtended
-from ._models_py3 import BackupResourceEncryptionConfigExtendedResource
-from ._models_py3 import BackupResourceEncryptionConfigResource
-from ._models_py3 import BackupResourceVaultConfig
-from ._models_py3 import BackupResourceVaultConfigResource
-from ._models_py3 import BackupStatusRequest
-from ._models_py3 import BackupStatusResponse
-from ._models_py3 import ClientDiscoveryDisplay
-from ._models_py3 import ClientDiscoveryForLogSpecification
-from ._models_py3 import ClientDiscoveryForProperties
-from ._models_py3 import ClientDiscoveryForServiceSpecification
-from ._models_py3 import ClientDiscoveryResponse
-from ._models_py3 import ClientDiscoveryValueForSingleApi
-from ._models_py3 import ClientScriptForConnect
-from ._models_py3 import CloudErrorBody
-from ._models_py3 import ContainerIdentityInfo
-from ._models_py3 import DPMContainerExtendedInfo
-from ._models_py3 import DPMProtectedItem
-from ._models_py3 import DPMProtectedItemExtendedInfo
-from ._models_py3 import DailyRetentionFormat
-from ._models_py3 import DailyRetentionSchedule
-from ._models_py3 import DailySchedule
-from ._models_py3 import Day
-from ._models_py3 import DiskExclusionProperties
-from ._models_py3 import DiskInformation
-from ._models_py3 import DistributedNodesInfo
-from ._models_py3 import DpmBackupEngine
-from ._models_py3 import DpmContainer
-from ._models_py3 import DpmErrorInfo
-from ._models_py3 import DpmJob
-from ._models_py3 import DpmJobExtendedInfo
-from ._models_py3 import DpmJobTaskDetails
-from ._models_py3 import EncryptionDetails
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ExportJobsOperationResultInfo
-from ._models_py3 import ExtendedLocation
-from ._models_py3 import ExtendedProperties
-from ._models_py3 import FeatureSupportRequest
-from ._models_py3 import FetchTieringCostInfoForRehydrationRequest
-from ._models_py3 import FetchTieringCostInfoRequest
-from ._models_py3 import FetchTieringCostSavingsInfoForPolicyRequest
-from ._models_py3 import FetchTieringCostSavingsInfoForProtectedItemRequest
-from ._models_py3 import FetchTieringCostSavingsInfoForVaultRequest
-from ._models_py3 import GenericContainer
-from ._models_py3 import GenericContainerExtendedInfo
-from ._models_py3 import GenericProtectedItem
-from ._models_py3 import GenericProtectionPolicy
-from ._models_py3 import GenericRecoveryPoint
-from ._models_py3 import GetProtectedItemQueryObject
-from ._models_py3 import HourlySchedule
-from ._models_py3 import ILRRequest
-from ._models_py3 import ILRRequestResource
-from ._models_py3 import IaaSVMContainer
-from ._models_py3 import IaaSVMProtectableItem
-from ._models_py3 import IaasVMBackupRequest
-from ._models_py3 import IaasVMILRRegistrationRequest
-from ._models_py3 import IaasVMRecoveryPoint
-from ._models_py3 import IaasVMRestoreRequest
-from ._models_py3 import IaasVMRestoreWithRehydrationRequest
-from ._models_py3 import IdentityBasedRestoreDetails
-from ._models_py3 import IdentityInfo
-from ._models_py3 import InquiryInfo
-from ._models_py3 import InquiryValidation
-from ._models_py3 import InstantItemRecoveryTarget
-from ._models_py3 import InstantRPAdditionalDetails
-from ._models_py3 import Job
-from ._models_py3 import JobQueryObject
-from ._models_py3 import JobResource
-from ._models_py3 import JobResourceList
-from ._models_py3 import KEKDetails
-from ._models_py3 import KPIResourceHealthDetails
-from ._models_py3 import KeyAndSecretDetails
-from ._models_py3 import ListRecoveryPointsRecommendedForMoveRequest
-from ._models_py3 import LogSchedulePolicy
-from ._models_py3 import LongTermRetentionPolicy
-from ._models_py3 import LongTermSchedulePolicy
-from ._models_py3 import MABContainerHealthDetails
-from ._models_py3 import MabContainer
-from ._models_py3 import MabContainerExtendedInfo
-from ._models_py3 import MabErrorInfo
-from ._models_py3 import MabFileFolderProtectedItem
-from ._models_py3 import MabFileFolderProtectedItemExtendedInfo
-from ._models_py3 import MabJob
-from ._models_py3 import MabJobExtendedInfo
-from ._models_py3 import MabJobTaskDetails
-from ._models_py3 import MabProtectionPolicy
-from ._models_py3 import MonthlyRetentionSchedule
-from ._models_py3 import MoveRPAcrossTiersRequest
-from ._models_py3 import NameInfo
-from ._models_py3 import NewErrorResponse
-from ._models_py3 import NewErrorResponseError
-from ._models_py3 import OperationResultInfo
-from ._models_py3 import OperationResultInfoBase
-from ._models_py3 import OperationResultInfoBaseResource
-from ._models_py3 import OperationStatus
-from ._models_py3 import OperationStatusError
-from ._models_py3 import OperationStatusExtendedInfo
-from ._models_py3 import OperationStatusJobExtendedInfo
-from ._models_py3 import OperationStatusJobsExtendedInfo
-from ._models_py3 import OperationStatusProvisionILRExtendedInfo
-from ._models_py3 import OperationStatusValidateOperationExtendedInfo
-from ._models_py3 import OperationWorkerResponse
-from ._models_py3 import PointInTimeRange
-from ._models_py3 import PreBackupValidation
-from ._models_py3 import PreValidateEnableBackupRequest
-from ._models_py3 import PreValidateEnableBackupResponse
-from ._models_py3 import PrepareDataMoveRequest
-from ._models_py3 import PrepareDataMoveResponse
-from ._models_py3 import PrivateEndpoint
-from ._models_py3 import PrivateEndpointConnection
-from ._models_py3 import PrivateEndpointConnectionResource
-from ._models_py3 import PrivateLinkServiceConnectionState
-from ._models_py3 import ProtectableContainer
-from ._models_py3 import ProtectableContainerResource
-from ._models_py3 import ProtectableContainerResourceList
-from ._models_py3 import ProtectedItem
-from ._models_py3 import ProtectedItemQueryObject
-from ._models_py3 import ProtectedItemResource
-from ._models_py3 import ProtectedItemResourceList
-from ._models_py3 import ProtectionContainer
-from ._models_py3 import ProtectionContainerResource
-from ._models_py3 import ProtectionContainerResourceList
-from ._models_py3 import ProtectionIntent
-from ._models_py3 import ProtectionIntentQueryObject
-from ._models_py3 import ProtectionIntentResource
-from ._models_py3 import ProtectionIntentResourceList
-from ._models_py3 import ProtectionPolicy
-from ._models_py3 import ProtectionPolicyQueryObject
-from ._models_py3 import ProtectionPolicyResource
-from ._models_py3 import ProtectionPolicyResourceList
-from ._models_py3 import RecoveryPoint
-from ._models_py3 import RecoveryPointDiskConfiguration
-from ._models_py3 import RecoveryPointMoveReadinessInfo
-from ._models_py3 import RecoveryPointProperties
-from ._models_py3 import RecoveryPointRehydrationInfo
-from ._models_py3 import RecoveryPointResource
-from ._models_py3 import RecoveryPointResourceList
-from ._models_py3 import RecoveryPointTierInformation
-from ._models_py3 import RecoveryPointTierInformationV2
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGuardOperationDetail
-from ._models_py3 import ResourceGuardProxyBase
-from ._models_py3 import ResourceGuardProxyBaseResource
-from ._models_py3 import ResourceGuardProxyBaseResourceList
-from ._models_py3 import ResourceHealthDetails
-from ._models_py3 import ResourceList
-from ._models_py3 import RestoreFileSpecs
-from ._models_py3 import RestoreRequest
-from ._models_py3 import RestoreRequestResource
-from ._models_py3 import RetentionDuration
-from ._models_py3 import RetentionPolicy
-from ._models_py3 import SQLDataDirectory
-from ._models_py3 import SQLDataDirectoryMapping
-from ._models_py3 import SchedulePolicy
-from ._models_py3 import SecuredVMDetails
-from ._models_py3 import SecurityPinBase
-from ._models_py3 import Settings
-from ._models_py3 import SimpleRetentionPolicy
-from ._models_py3 import SimpleSchedulePolicy
-from ._models_py3 import SimpleSchedulePolicyV2
-from ._models_py3 import SnapshotBackupAdditionalDetails
-from ._models_py3 import SnapshotRestoreParameters
-from ._models_py3 import SubProtectionPolicy
-from ._models_py3 import TargetAFSRestoreInfo
-from ._models_py3 import TargetDiskNetworkAccessSettings
-from ._models_py3 import TargetRestoreInfo
-from ._models_py3 import TieringCostInfo
-from ._models_py3 import TieringCostRehydrationInfo
-from ._models_py3 import TieringCostSavingInfo
-from ._models_py3 import TieringPolicy
-from ._models_py3 import TokenInformation
-from ._models_py3 import TriggerDataMoveRequest
-from ._models_py3 import UnlockDeleteRequest
-from ._models_py3 import UnlockDeleteResponse
-from ._models_py3 import UserAssignedIdentityProperties
-from ._models_py3 import UserAssignedManagedIdentityDetails
-from ._models_py3 import ValidateIaasVMRestoreOperationRequest
-from ._models_py3 import ValidateOperationRequest
-from ._models_py3 import ValidateOperationRequestResource
-from ._models_py3 import ValidateOperationResponse
-from ._models_py3 import ValidateOperationsResponse
-from ._models_py3 import ValidateRestoreOperationRequest
-from ._models_py3 import VaultJob
-from ._models_py3 import VaultJobErrorInfo
-from ._models_py3 import VaultJobExtendedInfo
-from ._models_py3 import VaultRetentionPolicy
-from ._models_py3 import VaultStorageConfigOperationResultResponse
-from ._models_py3 import WeeklyRetentionFormat
-from ._models_py3 import WeeklyRetentionSchedule
-from ._models_py3 import WeeklySchedule
-from ._models_py3 import WorkloadInquiryDetails
-from ._models_py3 import WorkloadItem
-from ._models_py3 import WorkloadItemResource
-from ._models_py3 import WorkloadItemResourceList
-from ._models_py3 import WorkloadProtectableItem
-from ._models_py3 import WorkloadProtectableItemResource
-from ._models_py3 import WorkloadProtectableItemResourceList
-from ._models_py3 import YearlyRetentionSchedule
+from typing import TYPE_CHECKING
-from ._recovery_services_backup_client_enums import AcquireStorageAccountLock
-from ._recovery_services_backup_client_enums import AzureFileShareType
-from ._recovery_services_backup_client_enums import BackupEngineType
-from ._recovery_services_backup_client_enums import BackupItemType
-from ._recovery_services_backup_client_enums import BackupManagementType
-from ._recovery_services_backup_client_enums import BackupType
-from ._recovery_services_backup_client_enums import ContainerType
-from ._recovery_services_backup_client_enums import CopyOptions
-from ._recovery_services_backup_client_enums import CreateMode
-from ._recovery_services_backup_client_enums import DataMoveLevel
-from ._recovery_services_backup_client_enums import DataSourceType
-from ._recovery_services_backup_client_enums import DayOfWeek
-from ._recovery_services_backup_client_enums import DedupState
-from ._recovery_services_backup_client_enums import EncryptionAtRestType
-from ._recovery_services_backup_client_enums import EnhancedSecurityState
-from ._recovery_services_backup_client_enums import FabricName
-from ._recovery_services_backup_client_enums import HealthState
-from ._recovery_services_backup_client_enums import HealthStatus
-from ._recovery_services_backup_client_enums import HttpStatusCode
-from ._recovery_services_backup_client_enums import IAASVMPolicyType
-from ._recovery_services_backup_client_enums import IaasVMSnapshotConsistencyType
-from ._recovery_services_backup_client_enums import InfrastructureEncryptionState
-from ._recovery_services_backup_client_enums import InquiryStatus
-from ._recovery_services_backup_client_enums import IntentItemType
-from ._recovery_services_backup_client_enums import JobOperationType
-from ._recovery_services_backup_client_enums import JobStatus
-from ._recovery_services_backup_client_enums import JobSupportedAction
-from ._recovery_services_backup_client_enums import LastBackupStatus
-from ._recovery_services_backup_client_enums import LastUpdateStatus
-from ._recovery_services_backup_client_enums import MabServerType
-from ._recovery_services_backup_client_enums import MonthOfYear
-from ._recovery_services_backup_client_enums import OperationStatusValues
-from ._recovery_services_backup_client_enums import OperationType
-from ._recovery_services_backup_client_enums import OverwriteOptions
-from ._recovery_services_backup_client_enums import PolicyType
-from ._recovery_services_backup_client_enums import PrivateEndpointConnectionStatus
-from ._recovery_services_backup_client_enums import ProtectableContainerType
-from ._recovery_services_backup_client_enums import ProtectedItemHealthStatus
-from ._recovery_services_backup_client_enums import ProtectedItemState
-from ._recovery_services_backup_client_enums import ProtectionIntentItemType
-from ._recovery_services_backup_client_enums import ProtectionState
-from ._recovery_services_backup_client_enums import ProtectionStatus
-from ._recovery_services_backup_client_enums import ProvisioningState
-from ._recovery_services_backup_client_enums import RecoveryMode
-from ._recovery_services_backup_client_enums import RecoveryPointTierStatus
-from ._recovery_services_backup_client_enums import RecoveryPointTierType
-from ._recovery_services_backup_client_enums import RecoveryType
-from ._recovery_services_backup_client_enums import RehydrationPriority
-from ._recovery_services_backup_client_enums import ResourceHealthStatus
-from ._recovery_services_backup_client_enums import RestorePointQueryType
-from ._recovery_services_backup_client_enums import RestorePointType
-from ._recovery_services_backup_client_enums import RestoreRequestType
-from ._recovery_services_backup_client_enums import RetentionDurationType
-from ._recovery_services_backup_client_enums import RetentionScheduleFormat
-from ._recovery_services_backup_client_enums import SQLDataDirectoryType
-from ._recovery_services_backup_client_enums import ScheduleRunType
-from ._recovery_services_backup_client_enums import SoftDeleteFeatureState
-from ._recovery_services_backup_client_enums import StorageType
-from ._recovery_services_backup_client_enums import StorageTypeState
-from ._recovery_services_backup_client_enums import SupportStatus
-from ._recovery_services_backup_client_enums import TargetDiskNetworkAccessOption
-from ._recovery_services_backup_client_enums import TieringMode
-from ._recovery_services_backup_client_enums import Type
-from ._recovery_services_backup_client_enums import UsagesUnit
-from ._recovery_services_backup_client_enums import ValidationStatus
-from ._recovery_services_backup_client_enums import VaultSubResourceType
-from ._recovery_services_backup_client_enums import WeekOfMonth
-from ._recovery_services_backup_client_enums import WorkloadItemType
-from ._recovery_services_backup_client_enums import WorkloadType
-from ._recovery_services_backup_client_enums import XcoolState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureBackupGoalFeatureSupportRequest,
+ AzureBackupServerContainer,
+ AzureBackupServerEngine,
+ AzureFileShareBackupRequest,
+ AzureFileShareProtectableItem,
+ AzureFileShareProtectionPolicy,
+ AzureFileShareProvisionILRRequest,
+ AzureFileShareRecoveryPoint,
+ AzureFileShareRestoreRequest,
+ AzureFileshareProtectedItem,
+ AzureFileshareProtectedItemExtendedInfo,
+ AzureIaaSClassicComputeVMContainer,
+ AzureIaaSClassicComputeVMProtectableItem,
+ AzureIaaSClassicComputeVMProtectedItem,
+ AzureIaaSComputeVMContainer,
+ AzureIaaSComputeVMProtectableItem,
+ AzureIaaSComputeVMProtectedItem,
+ AzureIaaSVMErrorInfo,
+ AzureIaaSVMHealthDetails,
+ AzureIaaSVMJob,
+ AzureIaaSVMJobExtendedInfo,
+ AzureIaaSVMJobTaskDetails,
+ AzureIaaSVMJobV2,
+ AzureIaaSVMProtectedItem,
+ AzureIaaSVMProtectedItemExtendedInfo,
+ AzureIaaSVMProtectionPolicy,
+ AzureRecoveryServiceVaultProtectionIntent,
+ AzureResourceProtectionIntent,
+ AzureSQLAGWorkloadContainerProtectionContainer,
+ AzureSqlContainer,
+ AzureSqlProtectedItem,
+ AzureSqlProtectedItemExtendedInfo,
+ AzureSqlProtectionPolicy,
+ AzureStorageContainer,
+ AzureStorageErrorInfo,
+ AzureStorageJob,
+ AzureStorageJobExtendedInfo,
+ AzureStorageJobTaskDetails,
+ AzureStorageProtectableContainer,
+ AzureVMAppContainerProtectableContainer,
+ AzureVMAppContainerProtectionContainer,
+ AzureVMResourceFeatureSupportRequest,
+ AzureVMResourceFeatureSupportResponse,
+ AzureVmWorkloadItem,
+ AzureVmWorkloadProtectableItem,
+ AzureVmWorkloadProtectedItem,
+ AzureVmWorkloadProtectedItemExtendedInfo,
+ AzureVmWorkloadProtectionPolicy,
+ AzureVmWorkloadSAPAseDatabaseProtectableItem,
+ AzureVmWorkloadSAPAseDatabaseProtectedItem,
+ AzureVmWorkloadSAPAseDatabaseWorkloadItem,
+ AzureVmWorkloadSAPAseSystemProtectableItem,
+ AzureVmWorkloadSAPAseSystemWorkloadItem,
+ AzureVmWorkloadSAPHanaDBInstance,
+ AzureVmWorkloadSAPHanaDBInstanceProtectedItem,
+ AzureVmWorkloadSAPHanaDatabaseProtectableItem,
+ AzureVmWorkloadSAPHanaDatabaseProtectedItem,
+ AzureVmWorkloadSAPHanaDatabaseWorkloadItem,
+ AzureVmWorkloadSAPHanaHSRProtectableItem,
+ AzureVmWorkloadSAPHanaSystemProtectableItem,
+ AzureVmWorkloadSAPHanaSystemWorkloadItem,
+ AzureVmWorkloadSQLAvailabilityGroupProtectableItem,
+ AzureVmWorkloadSQLDatabaseProtectableItem,
+ AzureVmWorkloadSQLDatabaseProtectedItem,
+ AzureVmWorkloadSQLDatabaseWorkloadItem,
+ AzureVmWorkloadSQLInstanceProtectableItem,
+ AzureVmWorkloadSQLInstanceWorkloadItem,
+ AzureWorkloadAutoProtectionIntent,
+ AzureWorkloadBackupRequest,
+ AzureWorkloadContainer,
+ AzureWorkloadContainerAutoProtectionIntent,
+ AzureWorkloadContainerExtendedInfo,
+ AzureWorkloadErrorInfo,
+ AzureWorkloadJob,
+ AzureWorkloadJobExtendedInfo,
+ AzureWorkloadJobTaskDetails,
+ AzureWorkloadPointInTimeRecoveryPoint,
+ AzureWorkloadPointInTimeRestoreRequest,
+ AzureWorkloadRecoveryPoint,
+ AzureWorkloadRestoreRequest,
+ AzureWorkloadSAPAsePointInTimeRecoveryPoint,
+ AzureWorkloadSAPAsePointInTimeRestoreRequest,
+ AzureWorkloadSAPAseRecoveryPoint,
+ AzureWorkloadSAPAseRestoreRequest,
+ AzureWorkloadSAPHanaPointInTimeRecoveryPoint,
+ AzureWorkloadSAPHanaPointInTimeRestoreRequest,
+ AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest,
+ AzureWorkloadSAPHanaRecoveryPoint,
+ AzureWorkloadSAPHanaRestoreRequest,
+ AzureWorkloadSAPHanaRestoreWithRehydrateRequest,
+ AzureWorkloadSQLAutoProtectionIntent,
+ AzureWorkloadSQLPointInTimeRecoveryPoint,
+ AzureWorkloadSQLPointInTimeRestoreRequest,
+ AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest,
+ AzureWorkloadSQLRecoveryPoint,
+ AzureWorkloadSQLRecoveryPointExtendedInfo,
+ AzureWorkloadSQLRestoreRequest,
+ AzureWorkloadSQLRestoreWithRehydrateRequest,
+ BEKDetails,
+ BMSBackupEngineQueryObject,
+ BMSBackupEnginesQueryObject,
+ BMSBackupSummariesQueryObject,
+ BMSContainerQueryObject,
+ BMSContainersInquiryQueryObject,
+ BMSPOQueryObject,
+ BMSRPQueryObject,
+ BMSRefreshContainersQueryObject,
+ BMSWorkloadItemQueryObject,
+ BackupEngineBase,
+ BackupEngineBaseResource,
+ BackupEngineBaseResourceList,
+ BackupEngineExtendedInfo,
+ BackupManagementUsage,
+ BackupManagementUsageList,
+ BackupRequest,
+ BackupRequestResource,
+ BackupResourceConfig,
+ BackupResourceConfigResource,
+ BackupResourceEncryptionConfig,
+ BackupResourceEncryptionConfigExtended,
+ BackupResourceEncryptionConfigExtendedResource,
+ BackupResourceEncryptionConfigResource,
+ BackupResourceVaultConfig,
+ BackupResourceVaultConfigResource,
+ BackupStatusRequest,
+ BackupStatusResponse,
+ ClientDiscoveryDisplay,
+ ClientDiscoveryForLogSpecification,
+ ClientDiscoveryForProperties,
+ ClientDiscoveryForServiceSpecification,
+ ClientDiscoveryResponse,
+ ClientDiscoveryValueForSingleApi,
+ ClientScriptForConnect,
+ CloudErrorBody,
+ ContainerIdentityInfo,
+ DPMContainerExtendedInfo,
+ DPMProtectedItem,
+ DPMProtectedItemExtendedInfo,
+ DailyRetentionFormat,
+ DailyRetentionSchedule,
+ DailySchedule,
+ Day,
+ DiskExclusionProperties,
+ DiskInformation,
+ DistributedNodesInfo,
+ DpmBackupEngine,
+ DpmContainer,
+ DpmErrorInfo,
+ DpmJob,
+ DpmJobExtendedInfo,
+ DpmJobTaskDetails,
+ EncryptionDetails,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ExportJobsOperationResultInfo,
+ ExtendedLocation,
+ ExtendedProperties,
+ FeatureSupportRequest,
+ FetchTieringCostInfoForRehydrationRequest,
+ FetchTieringCostInfoRequest,
+ FetchTieringCostSavingsInfoForPolicyRequest,
+ FetchTieringCostSavingsInfoForProtectedItemRequest,
+ FetchTieringCostSavingsInfoForVaultRequest,
+ GenericContainer,
+ GenericContainerExtendedInfo,
+ GenericProtectedItem,
+ GenericProtectionPolicy,
+ GenericRecoveryPoint,
+ GetProtectedItemQueryObject,
+ HourlySchedule,
+ ILRRequest,
+ ILRRequestResource,
+ IaaSVMContainer,
+ IaaSVMProtectableItem,
+ IaasVMBackupRequest,
+ IaasVMILRRegistrationRequest,
+ IaasVMRecoveryPoint,
+ IaasVMRestoreRequest,
+ IaasVMRestoreWithRehydrationRequest,
+ IdentityBasedRestoreDetails,
+ IdentityInfo,
+ InquiryInfo,
+ InquiryValidation,
+ InstantItemRecoveryTarget,
+ InstantRPAdditionalDetails,
+ Job,
+ JobQueryObject,
+ JobResource,
+ JobResourceList,
+ KEKDetails,
+ KPIResourceHealthDetails,
+ KeyAndSecretDetails,
+ ListRecoveryPointsRecommendedForMoveRequest,
+ LogSchedulePolicy,
+ LongTermRetentionPolicy,
+ LongTermSchedulePolicy,
+ MABContainerHealthDetails,
+ MabContainer,
+ MabContainerExtendedInfo,
+ MabErrorInfo,
+ MabFileFolderProtectedItem,
+ MabFileFolderProtectedItemExtendedInfo,
+ MabJob,
+ MabJobExtendedInfo,
+ MabJobTaskDetails,
+ MabProtectionPolicy,
+ MonthlyRetentionSchedule,
+ MoveRPAcrossTiersRequest,
+ NameInfo,
+ NewErrorResponse,
+ NewErrorResponseError,
+ OperationResultInfo,
+ OperationResultInfoBase,
+ OperationResultInfoBaseResource,
+ OperationStatus,
+ OperationStatusError,
+ OperationStatusExtendedInfo,
+ OperationStatusJobExtendedInfo,
+ OperationStatusJobsExtendedInfo,
+ OperationStatusProvisionILRExtendedInfo,
+ OperationStatusValidateOperationExtendedInfo,
+ OperationWorkerResponse,
+ PointInTimeRange,
+ PreBackupValidation,
+ PreValidateEnableBackupRequest,
+ PreValidateEnableBackupResponse,
+ PrepareDataMoveRequest,
+ PrepareDataMoveResponse,
+ PrivateEndpoint,
+ PrivateEndpointConnection,
+ PrivateEndpointConnectionResource,
+ PrivateLinkServiceConnectionState,
+ ProtectableContainer,
+ ProtectableContainerResource,
+ ProtectableContainerResourceList,
+ ProtectedItem,
+ ProtectedItemQueryObject,
+ ProtectedItemResource,
+ ProtectedItemResourceList,
+ ProtectionContainer,
+ ProtectionContainerResource,
+ ProtectionContainerResourceList,
+ ProtectionIntent,
+ ProtectionIntentQueryObject,
+ ProtectionIntentResource,
+ ProtectionIntentResourceList,
+ ProtectionPolicy,
+ ProtectionPolicyQueryObject,
+ ProtectionPolicyResource,
+ ProtectionPolicyResourceList,
+ RecoveryPoint,
+ RecoveryPointDiskConfiguration,
+ RecoveryPointMoveReadinessInfo,
+ RecoveryPointProperties,
+ RecoveryPointRehydrationInfo,
+ RecoveryPointResource,
+ RecoveryPointResourceList,
+ RecoveryPointTierInformation,
+ RecoveryPointTierInformationV2,
+ Resource,
+ ResourceGuardOperationDetail,
+ ResourceGuardProxyBase,
+ ResourceGuardProxyBaseResource,
+ ResourceGuardProxyBaseResourceList,
+ ResourceHealthDetails,
+ ResourceList,
+ RestoreFileSpecs,
+ RestoreRequest,
+ RestoreRequestResource,
+ RetentionDuration,
+ RetentionPolicy,
+ SQLDataDirectory,
+ SQLDataDirectoryMapping,
+ SchedulePolicy,
+ SecuredVMDetails,
+ SecurityPinBase,
+ Settings,
+ SimpleRetentionPolicy,
+ SimpleSchedulePolicy,
+ SimpleSchedulePolicyV2,
+ SnapshotBackupAdditionalDetails,
+ SnapshotRestoreParameters,
+ SubProtectionPolicy,
+ TargetAFSRestoreInfo,
+ TargetDiskNetworkAccessSettings,
+ TargetRestoreInfo,
+ TieringCostInfo,
+ TieringCostRehydrationInfo,
+ TieringCostSavingInfo,
+ TieringPolicy,
+ TokenInformation,
+ TriggerDataMoveRequest,
+ UnlockDeleteRequest,
+ UnlockDeleteResponse,
+ UserAssignedIdentityProperties,
+ UserAssignedManagedIdentityDetails,
+ ValidateIaasVMRestoreOperationRequest,
+ ValidateOperationRequest,
+ ValidateOperationRequestResource,
+ ValidateOperationResponse,
+ ValidateOperationsResponse,
+ ValidateRestoreOperationRequest,
+ VaultJob,
+ VaultJobErrorInfo,
+ VaultJobExtendedInfo,
+ VaultRetentionPolicy,
+ VaultStorageConfigOperationResultResponse,
+ WeeklyRetentionFormat,
+ WeeklyRetentionSchedule,
+ WeeklySchedule,
+ WorkloadInquiryDetails,
+ WorkloadItem,
+ WorkloadItemResource,
+ WorkloadItemResourceList,
+ WorkloadProtectableItem,
+ WorkloadProtectableItemResource,
+ WorkloadProtectableItemResourceList,
+ YearlyRetentionSchedule,
+)
+
+from ._recovery_services_backup_client_enums import ( # type: ignore
+ AcquireStorageAccountLock,
+ AzureFileShareType,
+ BackupEngineType,
+ BackupItemType,
+ BackupManagementType,
+ BackupType,
+ ContainerType,
+ CopyOptions,
+ CreateMode,
+ DataMoveLevel,
+ DataSourceType,
+ DayOfWeek,
+ DedupState,
+ EncryptionAtRestType,
+ EnhancedSecurityState,
+ FabricName,
+ HealthState,
+ HealthStatus,
+ HttpStatusCode,
+ IAASVMPolicyType,
+ IaasVMSnapshotConsistencyType,
+ InfrastructureEncryptionState,
+ InquiryStatus,
+ IntentItemType,
+ JobOperationType,
+ JobStatus,
+ JobSupportedAction,
+ LastBackupStatus,
+ LastUpdateStatus,
+ MabServerType,
+ MonthOfYear,
+ OperationStatusValues,
+ OperationType,
+ OverwriteOptions,
+ PolicyType,
+ PrivateEndpointConnectionStatus,
+ ProtectableContainerType,
+ ProtectedItemHealthStatus,
+ ProtectedItemState,
+ ProtectionIntentItemType,
+ ProtectionState,
+ ProtectionStatus,
+ ProvisioningState,
+ RecoveryMode,
+ RecoveryPointTierStatus,
+ RecoveryPointTierType,
+ RecoveryType,
+ RehydrationPriority,
+ ResourceHealthStatus,
+ RestorePointQueryType,
+ RestorePointType,
+ RestoreRequestType,
+ RetentionDurationType,
+ RetentionScheduleFormat,
+ SQLDataDirectoryType,
+ ScheduleRunType,
+ SoftDeleteFeatureState,
+ StorageType,
+ StorageTypeState,
+ SupportStatus,
+ TargetDiskNetworkAccessOption,
+ TieringMode,
+ Type,
+ UsagesUnit,
+ ValidationStatus,
+ VaultSubResourceType,
+ WeekOfMonth,
+ WorkloadItemType,
+ WorkloadType,
+ XcoolState,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -443,6 +459,7 @@
"AzureVmWorkloadProtectedItem",
"AzureVmWorkloadProtectedItemExtendedInfo",
"AzureVmWorkloadProtectionPolicy",
+ "AzureVmWorkloadSAPAseDatabaseProtectableItem",
"AzureVmWorkloadSAPAseDatabaseProtectedItem",
"AzureVmWorkloadSAPAseDatabaseWorkloadItem",
"AzureVmWorkloadSAPAseSystemProtectableItem",
@@ -474,6 +491,10 @@
"AzureWorkloadPointInTimeRestoreRequest",
"AzureWorkloadRecoveryPoint",
"AzureWorkloadRestoreRequest",
+ "AzureWorkloadSAPAsePointInTimeRecoveryPoint",
+ "AzureWorkloadSAPAsePointInTimeRestoreRequest",
+ "AzureWorkloadSAPAseRecoveryPoint",
+ "AzureWorkloadSAPAseRestoreRequest",
"AzureWorkloadSAPHanaPointInTimeRecoveryPoint",
"AzureWorkloadSAPHanaPointInTimeRestoreRequest",
"AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest",
@@ -779,5 +800,5 @@
"WorkloadType",
"XcoolState",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_models_py3.py
index 991551d8e9ed..fc3b8c241f62 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_models_py3.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -13,7 +13,6 @@
from .. import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -174,7 +173,7 @@ def __init__(
self.protectable_object_type = protectable_object_type
-class DpmContainer(ProtectionContainer): # pylint: disable=too-many-instance-attributes
+class DpmContainer(ProtectionContainer):
"""DPM workload-specific protection container.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -323,7 +322,7 @@ def __init__(
self.extended_info = extended_info
-class AzureBackupServerContainer(DpmContainer): # pylint: disable=too-many-instance-attributes
+class AzureBackupServerContainer(DpmContainer):
"""AzureBackupServer (DPMVenus) workload-specific protection container.
All required parameters must be populated in order to send to server.
@@ -467,7 +466,7 @@ def __init__(
self.container_type: str = "AzureBackupServerContainer"
-class BackupEngineBase(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class BackupEngineBase(_serialization.Model):
"""The base backup engine class. All workload specific backup engines derive from this class.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -605,7 +604,7 @@ def __init__(
self.extended_info = extended_info
-class AzureBackupServerEngine(BackupEngineBase): # pylint: disable=too-many-instance-attributes
+class AzureBackupServerEngine(BackupEngineBase):
"""Backup engine type when Azure Backup Server is used to manage the backups.
All required parameters must be populated in order to send to server.
@@ -965,7 +964,7 @@ def __init__(
self.azure_file_share_type = azure_file_share_type
-class ProtectedItem(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ProtectedItem(_serialization.Model):
"""Base class for backup items.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -1151,7 +1150,7 @@ def __init__(
self.vault_id = None
-class AzureFileshareProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureFileshareProtectedItem(ProtectedItem):
"""Azure File Share workload-specific backup item.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1722,6 +1721,9 @@ class AzureFileShareRecoveryPoint(RecoveryPoint):
:ivar recovery_point_properties: Properties of Recovery Point.
:vartype recovery_point_properties:
~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
+ :ivar recovery_point_tier_details: Recovery point tier information.
+ :vartype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformation]
"""
_validation = {
@@ -1735,6 +1737,7 @@ class AzureFileShareRecoveryPoint(RecoveryPoint):
"file_share_snapshot_uri": {"key": "fileShareSnapshotUri", "type": "str"},
"recovery_point_size_in_gb": {"key": "recoveryPointSizeInGB", "type": "int"},
"recovery_point_properties": {"key": "recoveryPointProperties", "type": "RecoveryPointProperties"},
+ "recovery_point_tier_details": {"key": "recoveryPointTierDetails", "type": "[RecoveryPointTierInformation]"},
}
def __init__(
@@ -1745,6 +1748,7 @@ def __init__(
file_share_snapshot_uri: Optional[str] = None,
recovery_point_size_in_gb: Optional[int] = None,
recovery_point_properties: Optional["_models.RecoveryPointProperties"] = None,
+ recovery_point_tier_details: Optional[List["_models.RecoveryPointTierInformation"]] = None,
**kwargs: Any
) -> None:
"""
@@ -1760,6 +1764,9 @@ def __init__(
:keyword recovery_point_properties: Properties of Recovery Point.
:paramtype recovery_point_properties:
~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
+ :keyword recovery_point_tier_details: Recovery point tier information.
+ :paramtype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformation]
"""
super().__init__(**kwargs)
self.object_type: str = "AzureFileShareRecoveryPoint"
@@ -1768,6 +1775,7 @@ def __init__(
self.file_share_snapshot_uri = file_share_snapshot_uri
self.recovery_point_size_in_gb = recovery_point_size_in_gb
self.recovery_point_properties = recovery_point_properties
+ self.recovery_point_tier_details = recovery_point_tier_details
class RestoreRequest(_serialization.Model):
@@ -2322,7 +2330,7 @@ def __init__(
self.protectable_item_type: str = "Microsoft.ClassicCompute/virtualMachines"
-class AzureIaaSVMProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMProtectedItem(ProtectedItem):
"""IaaS VM workload-specific backup item.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -2417,6 +2425,8 @@ class AzureIaaSVMProtectedItem(ProtectedItem): # pylint: disable=too-many-insta
:ivar extended_properties: Extended Properties for Azure IaasVM Backup.
:vartype extended_properties:
~azure.mgmt.recoveryservicesbackup.activestamp.models.ExtendedProperties
+ :ivar policy_type: Type of the policy used for protection.
+ :vartype policy_type: str
"""
_validation = {
@@ -2429,6 +2439,7 @@ class AzureIaaSVMProtectedItem(ProtectedItem): # pylint: disable=too-many-insta
"health_status": {"readonly": True},
"last_backup_time": {"readonly": True},
"protected_item_data_id": {"readonly": True},
+ "policy_type": {"readonly": True},
}
_attribute_map = {
@@ -2463,6 +2474,7 @@ class AzureIaaSVMProtectedItem(ProtectedItem): # pylint: disable=too-many-insta
"protected_item_data_id": {"key": "protectedItemDataId", "type": "str"},
"extended_info": {"key": "extendedInfo", "type": "AzureIaaSVMProtectedItemExtendedInfo"},
"extended_properties": {"key": "extendedProperties", "type": "ExtendedProperties"},
+ "policy_type": {"key": "policyType", "type": "str"},
}
_subtype_map = {
@@ -2590,9 +2602,10 @@ def __init__( # pylint: disable=too-many-locals
self.protected_item_data_id = None
self.extended_info = extended_info
self.extended_properties = extended_properties
+ self.policy_type = None
-class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem):
"""IaaS VM workload-specific backup item representing the Classic Compute VM.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -2684,6 +2697,8 @@ class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylin
:ivar extended_properties: Extended Properties for Azure IaasVM Backup.
:vartype extended_properties:
~azure.mgmt.recoveryservicesbackup.activestamp.models.ExtendedProperties
+ :ivar policy_type: Type of the policy used for protection.
+ :vartype policy_type: str
"""
_validation = {
@@ -2696,6 +2711,7 @@ class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylin
"health_status": {"readonly": True},
"last_backup_time": {"readonly": True},
"protected_item_data_id": {"readonly": True},
+ "policy_type": {"readonly": True},
}
_attribute_map = {
@@ -2730,6 +2746,7 @@ class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylin
"protected_item_data_id": {"key": "protectedItemDataId", "type": "str"},
"extended_info": {"key": "extendedInfo", "type": "AzureIaaSVMProtectedItemExtendedInfo"},
"extended_properties": {"key": "extendedProperties", "type": "ExtendedProperties"},
+ "policy_type": {"key": "policyType", "type": "str"},
}
def __init__( # pylint: disable=too-many-locals
@@ -3043,7 +3060,7 @@ def __init__(
self.protectable_item_type: str = "Microsoft.Compute/virtualMachines"
-class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem):
"""IaaS VM workload-specific backup item representing the Azure Resource Manager VM.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -3135,6 +3152,8 @@ class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disa
:ivar extended_properties: Extended Properties for Azure IaasVM Backup.
:vartype extended_properties:
~azure.mgmt.recoveryservicesbackup.activestamp.models.ExtendedProperties
+ :ivar policy_type: Type of the policy used for protection.
+ :vartype policy_type: str
"""
_validation = {
@@ -3147,6 +3166,7 @@ class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disa
"health_status": {"readonly": True},
"last_backup_time": {"readonly": True},
"protected_item_data_id": {"readonly": True},
+ "policy_type": {"readonly": True},
}
_attribute_map = {
@@ -3181,6 +3201,7 @@ class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disa
"protected_item_data_id": {"key": "protectedItemDataId", "type": "str"},
"extended_info": {"key": "extendedInfo", "type": "AzureIaaSVMProtectedItemExtendedInfo"},
"extended_properties": {"key": "extendedProperties", "type": "ExtendedProperties"},
+ "policy_type": {"key": "policyType", "type": "str"},
}
def __init__( # pylint: disable=too-many-locals
@@ -3490,7 +3511,7 @@ def __init__(
self.job_type: Optional[str] = None
-class AzureIaaSVMJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMJob(Job):
"""Azure IaaS VM workload-specific job object.
All required parameters must be populated in order to send to server.
@@ -3774,7 +3795,7 @@ def __init__(
self.task_execution_details = task_execution_details
-class AzureIaaSVMJobV2(Job): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMJobV2(Job):
"""Azure IaaS VM workload-specific job object.
All required parameters must be populated in order to send to server.
@@ -3981,7 +4002,7 @@ def __init__(
self.policy_inconsistent = policy_inconsistent
-class AzureIaaSVMProtectionPolicy(ProtectionPolicy): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMProtectionPolicy(ProtectionPolicy):
"""IaaS VM workload-specific backup policy.
All required parameters must be populated in order to send to server.
@@ -4366,7 +4387,7 @@ def __init__(
self.friendly_name = friendly_name
-class AzureWorkloadContainer(ProtectionContainer): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadContainer(ProtectionContainer):
"""Container for the workloads running inside Azure Compute or Classic Compute.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -4416,8 +4437,8 @@ class AzureWorkloadContainer(ProtectionContainer): # pylint: disable=too-many-i
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:vartype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", "Reregister",
+ and "Rehydrate".
:vartype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -4492,8 +4513,8 @@ def __init__(
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:paramtype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register",
+ "Reregister", and "Rehydrate".
:paramtype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -4513,9 +4534,7 @@ def __init__(
self.operation_type = operation_type
-class AzureSQLAGWorkloadContainerProtectionContainer(
- AzureWorkloadContainer
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureSQLAGWorkloadContainerProtectionContainer(AzureWorkloadContainer): # pylint: disable=name-too-long
"""Container for SQL workloads under SQL Availability Group.
All required parameters must be populated in order to send to server.
@@ -4562,8 +4581,8 @@ class AzureSQLAGWorkloadContainerProtectionContainer(
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:vartype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", "Reregister",
+ and "Rehydrate".
:vartype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -4631,8 +4650,8 @@ def __init__(
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:paramtype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register",
+ "Reregister", and "Rehydrate".
:paramtype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -4738,7 +4757,7 @@ def __init__(
self.container_type: str = "AzureSqlContainer"
-class AzureSqlProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureSqlProtectedItem(ProtectedItem):
"""Azure SQL workload-specific backup item.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -5032,7 +5051,7 @@ def __init__(
self.retention_policy = retention_policy
-class AzureStorageContainer(ProtectionContainer): # pylint: disable=too-many-instance-attributes
+class AzureStorageContainer(ProtectionContainer):
"""Azure Storage Account workload-specific container.
All required parameters must be populated in order to send to server.
@@ -5077,6 +5096,10 @@ class AzureStorageContainer(ProtectionContainer): # pylint: disable=too-many-in
container or not. Known values are: "Acquire" and "NotAcquire".
:vartype acquire_storage_account_lock: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.AcquireStorageAccountLock
+ :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", "Reregister",
+ and "Rehydrate".
+ :vartype operation_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
_validation = {
@@ -5095,6 +5118,7 @@ class AzureStorageContainer(ProtectionContainer): # pylint: disable=too-many-in
"resource_group": {"key": "resourceGroup", "type": "str"},
"protected_item_count": {"key": "protectedItemCount", "type": "int"},
"acquire_storage_account_lock": {"key": "acquireStorageAccountLock", "type": "str"},
+ "operation_type": {"key": "operationType", "type": "str"},
}
def __init__(
@@ -5110,6 +5134,7 @@ def __init__(
resource_group: Optional[str] = None,
protected_item_count: Optional[int] = None,
acquire_storage_account_lock: Optional[Union[str, "_models.AcquireStorageAccountLock"]] = None,
+ operation_type: Optional[Union[str, "_models.OperationType"]] = None,
**kwargs: Any
) -> None:
"""
@@ -5140,6 +5165,10 @@ def __init__(
container or not. Known values are: "Acquire" and "NotAcquire".
:paramtype acquire_storage_account_lock: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.AcquireStorageAccountLock
+ :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register",
+ "Reregister", and "Rehydrate".
+ :paramtype operation_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
super().__init__(
friendly_name=friendly_name,
@@ -5155,6 +5184,7 @@ def __init__(
self.resource_group = resource_group
self.protected_item_count = protected_item_count
self.acquire_storage_account_lock = acquire_storage_account_lock
+ self.operation_type = operation_type
class AzureStorageErrorInfo(_serialization.Model):
@@ -5196,7 +5226,7 @@ def __init__(
self.recommendations = recommendations
-class AzureStorageJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureStorageJob(Job):
"""Azure storage specific job.
All required parameters must be populated in order to send to server.
@@ -5637,7 +5667,7 @@ def __init__(
self.protectable_container_type: str = "VMAppContainer"
-class AzureVMAppContainerProtectionContainer(AzureWorkloadContainer): # pylint: disable=too-many-instance-attributes
+class AzureVMAppContainerProtectionContainer(AzureWorkloadContainer):
"""Container for SQL workloads under Azure Virtual Machines.
All required parameters must be populated in order to send to server.
@@ -5684,8 +5714,8 @@ class AzureVMAppContainerProtectionContainer(AzureWorkloadContainer): # pylint:
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:vartype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :ivar operation_type: Re-Do Operation. Known values are: "Invalid", "Register", "Reregister",
+ and "Rehydrate".
:vartype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -5753,8 +5783,8 @@ def __init__(
"SAPHanaDatabase", "SAPAseDatabase", and "SAPHanaDBInstance".
:paramtype workload_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.WorkloadType
- :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register", and
- "Reregister".
+ :keyword operation_type: Re-Do Operation. Known values are: "Invalid", "Register",
+ "Reregister", and "Rehydrate".
:paramtype operation_type: str or
~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationType
"""
@@ -6012,13 +6042,13 @@ def __init__(
self.sub_workload_item_count = sub_workload_item_count
-class AzureVmWorkloadProtectableItem(WorkloadProtectableItem): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadProtectableItem(WorkloadProtectableItem):
"""Azure VM workload-specific protectable item.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureVmWorkloadSAPHanaHSRProtectableItem, AzureVmWorkloadSAPAseSystemProtectableItem,
- AzureVmWorkloadSAPHanaDBInstance, AzureVmWorkloadSAPHanaDatabaseProtectableItem,
- AzureVmWorkloadSAPHanaSystemProtectableItem,
+ AzureVmWorkloadSAPHanaHSRProtectableItem, AzureVmWorkloadSAPAseDatabaseProtectableItem,
+ AzureVmWorkloadSAPAseSystemProtectableItem, AzureVmWorkloadSAPHanaDBInstance,
+ AzureVmWorkloadSAPHanaDatabaseProtectableItem, AzureVmWorkloadSAPHanaSystemProtectableItem,
AzureVmWorkloadSQLAvailabilityGroupProtectableItem, AzureVmWorkloadSQLDatabaseProtectableItem,
AzureVmWorkloadSQLInstanceProtectableItem
@@ -6083,6 +6113,7 @@ class AzureVmWorkloadProtectableItem(WorkloadProtectableItem): # pylint: disabl
_subtype_map = {
"protectable_item_type": {
"HanaHSRContainer": "AzureVmWorkloadSAPHanaHSRProtectableItem",
+ "SAPAseDatabase": "AzureVmWorkloadSAPAseDatabaseProtectableItem",
"SAPAseSystem": "AzureVmWorkloadSAPAseSystemProtectableItem",
"SAPHanaDBInstance": "AzureVmWorkloadSAPHanaDBInstance",
"SAPHanaDatabase": "AzureVmWorkloadSAPHanaDatabaseProtectableItem",
@@ -6163,7 +6194,7 @@ def __init__(
self.is_protectable = is_protectable
-class AzureVmWorkloadProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadProtectedItem(ProtectedItem):
"""Azure VM workload-specific protected item.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -6629,9 +6660,138 @@ def __init__(
self.make_policy_consistent = make_policy_consistent
-class AzureVmWorkloadSAPAseDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPAseDatabaseProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
+ """Azure VM workload-specific protectable item representing SAP ASE Database.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar backup_management_type: Type of backup management to backup an item.
+ :vartype backup_management_type: str
+ :ivar workload_type: Type of workload for the backup management.
+ :vartype workload_type: str
+ :ivar protectable_item_type: Type of the backup item. Required.
+ :vartype protectable_item_type: str
+ :ivar friendly_name: Friendly name of the backup item.
+ :vartype friendly_name: str
+ :ivar protection_state: State of the back up item. Known values are: "Invalid", "NotProtected",
+ "Protecting", "Protected", and "ProtectionFailed".
+ :vartype protection_state: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionStatus
+ :ivar parent_name: Name for instance or AG.
+ :vartype parent_name: str
+ :ivar parent_unique_name: Parent Unique Name is added to provide the service formatted URI Name
+ of the Parent
+ Only Applicable for data bases where the parent would be either Instance or a SQL AG.
+ :vartype parent_unique_name: str
+ :ivar server_name: Host/Cluster Name for instance or AG.
+ :vartype server_name: str
+ :ivar is_auto_protectable: Indicates if protectable item is auto-protectable.
+ :vartype is_auto_protectable: bool
+ :ivar is_auto_protected: Indicates if protectable item is auto-protected.
+ :vartype is_auto_protected: bool
+ :ivar subinquireditemcount: For instance or AG, indicates number of DB's present.
+ :vartype subinquireditemcount: int
+ :ivar subprotectableitemcount: For instance or AG, indicates number of DB's to be protected.
+ :vartype subprotectableitemcount: int
+ :ivar prebackupvalidation: Pre-backup validation for protectable objects.
+ :vartype prebackupvalidation:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.PreBackupValidation
+ :ivar is_protectable: Indicates if item is protectable.
+ :vartype is_protectable: bool
+ """
+
+ _validation = {
+ "protectable_item_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "backup_management_type": {"key": "backupManagementType", "type": "str"},
+ "workload_type": {"key": "workloadType", "type": "str"},
+ "protectable_item_type": {"key": "protectableItemType", "type": "str"},
+ "friendly_name": {"key": "friendlyName", "type": "str"},
+ "protection_state": {"key": "protectionState", "type": "str"},
+ "parent_name": {"key": "parentName", "type": "str"},
+ "parent_unique_name": {"key": "parentUniqueName", "type": "str"},
+ "server_name": {"key": "serverName", "type": "str"},
+ "is_auto_protectable": {"key": "isAutoProtectable", "type": "bool"},
+ "is_auto_protected": {"key": "isAutoProtected", "type": "bool"},
+ "subinquireditemcount": {"key": "subinquireditemcount", "type": "int"},
+ "subprotectableitemcount": {"key": "subprotectableitemcount", "type": "int"},
+ "prebackupvalidation": {"key": "prebackupvalidation", "type": "PreBackupValidation"},
+ "is_protectable": {"key": "isProtectable", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ backup_management_type: Optional[str] = None,
+ workload_type: Optional[str] = None,
+ friendly_name: Optional[str] = None,
+ protection_state: Optional[Union[str, "_models.ProtectionStatus"]] = None,
+ parent_name: Optional[str] = None,
+ parent_unique_name: Optional[str] = None,
+ server_name: Optional[str] = None,
+ is_auto_protectable: Optional[bool] = None,
+ is_auto_protected: Optional[bool] = None,
+ subinquireditemcount: Optional[int] = None,
+ subprotectableitemcount: Optional[int] = None,
+ prebackupvalidation: Optional["_models.PreBackupValidation"] = None,
+ is_protectable: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword backup_management_type: Type of backup management to backup an item.
+ :paramtype backup_management_type: str
+ :keyword workload_type: Type of workload for the backup management.
+ :paramtype workload_type: str
+ :keyword friendly_name: Friendly name of the backup item.
+ :paramtype friendly_name: str
+ :keyword protection_state: State of the back up item. Known values are: "Invalid",
+ "NotProtected", "Protecting", "Protected", and "ProtectionFailed".
+ :paramtype protection_state: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionStatus
+ :keyword parent_name: Name for instance or AG.
+ :paramtype parent_name: str
+ :keyword parent_unique_name: Parent Unique Name is added to provide the service formatted URI
+ Name of the Parent
+ Only Applicable for data bases where the parent would be either Instance or a SQL AG.
+ :paramtype parent_unique_name: str
+ :keyword server_name: Host/Cluster Name for instance or AG.
+ :paramtype server_name: str
+ :keyword is_auto_protectable: Indicates if protectable item is auto-protectable.
+ :paramtype is_auto_protectable: bool
+ :keyword is_auto_protected: Indicates if protectable item is auto-protected.
+ :paramtype is_auto_protected: bool
+ :keyword subinquireditemcount: For instance or AG, indicates number of DB's present.
+ :paramtype subinquireditemcount: int
+ :keyword subprotectableitemcount: For instance or AG, indicates number of DB's to be protected.
+ :paramtype subprotectableitemcount: int
+ :keyword prebackupvalidation: Pre-backup validation for protectable objects.
+ :paramtype prebackupvalidation:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.PreBackupValidation
+ :keyword is_protectable: Indicates if item is protectable.
+ :paramtype is_protectable: bool
+ """
+ super().__init__(
+ backup_management_type=backup_management_type,
+ workload_type=workload_type,
+ friendly_name=friendly_name,
+ protection_state=protection_state,
+ parent_name=parent_name,
+ parent_unique_name=parent_unique_name,
+ server_name=server_name,
+ is_auto_protectable=is_auto_protectable,
+ is_auto_protected=is_auto_protected,
+ subinquireditemcount=subinquireditemcount,
+ subprotectableitemcount=subprotectableitemcount,
+ prebackupvalidation=prebackupvalidation,
+ is_protectable=is_protectable,
+ **kwargs
+ )
+ self.protectable_item_type: str = "SAPAseDatabase"
+
+
+class AzureVmWorkloadSAPAseDatabaseProtectedItem(AzureVmWorkloadProtectedItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protected item representing SAP ASE Database.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -7015,9 +7175,7 @@ def __init__(
self.workload_item_type: str = "SAPAseDatabase"
-class AzureVmWorkloadSAPAseSystemProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPAseSystemProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SAP ASE System.
All required parameters must be populated in order to send to server.
@@ -7245,9 +7403,7 @@ def __init__(
self.workload_item_type: str = "SAPAseSystem"
-class AzureVmWorkloadSAPHanaDatabaseProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPHanaDatabaseProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SAP HANA Database.
All required parameters must be populated in order to send to server.
@@ -7378,9 +7534,7 @@ def __init__(
self.protectable_item_type: str = "SAPHanaDatabase"
-class AzureVmWorkloadSAPHanaDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPHanaDatabaseProtectedItem(AzureVmWorkloadProtectedItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protected item representing SAP HANA Database.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -7764,7 +7918,7 @@ def __init__(
self.workload_item_type: str = "SAPHanaDatabase"
-class AzureVmWorkloadSAPHanaDBInstance(AzureVmWorkloadProtectableItem): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadSAPHanaDBInstance(AzureVmWorkloadProtectableItem):
"""Azure VM workload-specific protectable item representing SAP HANA Dbinstance.
All required parameters must be populated in order to send to server.
@@ -7895,9 +8049,7 @@ def __init__(
self.protectable_item_type: str = "SAPHanaDBInstance"
-class AzureVmWorkloadSAPHanaDBInstanceProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPHanaDBInstanceProtectedItem(AzureVmWorkloadProtectedItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protected item representing SAP HANA DBInstance.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -8184,9 +8336,7 @@ def __init__( # pylint: disable=too-many-locals
self.protected_item_type: str = "AzureVmWorkloadSAPHanaDBInstance"
-class AzureVmWorkloadSAPHanaHSRProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadSAPHanaHSRProtectableItem(AzureVmWorkloadProtectableItem):
"""Azure VM workload-specific protectable item representing HANA HSR.
All required parameters must be populated in order to send to server.
@@ -8317,9 +8467,7 @@ def __init__(
self.protectable_item_type: str = "HanaHSRContainer"
-class AzureVmWorkloadSAPHanaSystemProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPHanaSystemProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SAP HANA System.
All required parameters must be populated in order to send to server.
@@ -8549,7 +8697,7 @@ def __init__(
class AzureVmWorkloadSQLAvailabilityGroupProtectableItem(
AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SQL Availability Group.
All required parameters must be populated in order to send to server.
@@ -8689,9 +8837,7 @@ def __init__(
self.nodes_list = nodes_list
-class AzureVmWorkloadSQLDatabaseProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSQLDatabaseProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SQL Database.
All required parameters must be populated in order to send to server.
@@ -8822,9 +8968,7 @@ def __init__(
self.protectable_item_type: str = "SQLDataBase"
-class AzureVmWorkloadSQLDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadSQLDatabaseProtectedItem(AzureVmWorkloadProtectedItem):
"""Azure VM workload-specific protected item representing SQL Database.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -9208,9 +9352,7 @@ def __init__(
self.workload_item_type: str = "SQLDataBase"
-class AzureVmWorkloadSQLInstanceProtectableItem(
- AzureVmWorkloadProtectableItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSQLInstanceProtectableItem(AzureVmWorkloadProtectableItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protectable item representing SQL Instance.
All required parameters must be populated in order to send to server.
@@ -9341,7 +9483,7 @@ def __init__(
self.protectable_item_type: str = "SQLInstance"
-class AzureVmWorkloadSQLInstanceWorkloadItem(AzureVmWorkloadItem): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadSQLInstanceWorkloadItem(AzureVmWorkloadItem):
"""Azure VM workload-specific workload item representing SQL Instance.
All required parameters must be populated in order to send to server.
@@ -9768,7 +9910,7 @@ def __init__(
self.additional_details = additional_details
-class AzureWorkloadJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadJob(Job):
"""Azure storage specific job.
All required parameters must be populated in order to send to server.
@@ -9967,8 +10109,8 @@ class AzureWorkloadRecoveryPoint(RecoveryPoint):
"""Workload specific recovery point, specifically encapsulates full/diff recovery point.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureWorkloadPointInTimeRecoveryPoint, AzureWorkloadSAPHanaRecoveryPoint,
- AzureWorkloadSQLRecoveryPoint
+ AzureWorkloadPointInTimeRecoveryPoint, AzureWorkloadSAPAseRecoveryPoint,
+ AzureWorkloadSAPHanaRecoveryPoint, AzureWorkloadSQLRecoveryPoint
All required parameters must be populated in order to send to server.
@@ -10010,6 +10152,7 @@ class AzureWorkloadRecoveryPoint(RecoveryPoint):
_subtype_map = {
"object_type": {
"AzureWorkloadPointInTimeRecoveryPoint": "AzureWorkloadPointInTimeRecoveryPoint",
+ "AzureWorkloadSAPAseRecoveryPoint": "AzureWorkloadSAPAseRecoveryPoint",
"AzureWorkloadSAPHanaRecoveryPoint": "AzureWorkloadSAPHanaRecoveryPoint",
"AzureWorkloadSQLRecoveryPoint": "AzureWorkloadSQLRecoveryPoint",
}
@@ -10054,7 +10197,7 @@ class AzureWorkloadPointInTimeRecoveryPoint(AzureWorkloadRecoveryPoint):
"""Recovery point specific to PointInTime.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureWorkloadSAPHanaPointInTimeRecoveryPoint
+ AzureWorkloadSAPAsePointInTimeRecoveryPoint, AzureWorkloadSAPHanaPointInTimeRecoveryPoint
All required parameters must be populated in order to send to server.
@@ -10098,7 +10241,10 @@ class AzureWorkloadPointInTimeRecoveryPoint(AzureWorkloadRecoveryPoint):
}
_subtype_map = {
- "object_type": {"AzureWorkloadSAPHanaPointInTimeRecoveryPoint": "AzureWorkloadSAPHanaPointInTimeRecoveryPoint"}
+ "object_type": {
+ "AzureWorkloadSAPAsePointInTimeRecoveryPoint": "AzureWorkloadSAPAsePointInTimeRecoveryPoint",
+ "AzureWorkloadSAPHanaPointInTimeRecoveryPoint": "AzureWorkloadSAPHanaPointInTimeRecoveryPoint",
+ }
}
def __init__(
@@ -10143,12 +10289,12 @@ def __init__(
self.time_ranges = time_ranges
-class AzureWorkloadRestoreRequest(RestoreRequest): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadRestoreRequest(RestoreRequest):
"""AzureWorkload-specific restore.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureWorkloadPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreRequest,
- AzureWorkloadSQLRestoreRequest
+ AzureWorkloadPointInTimeRestoreRequest, AzureWorkloadSAPAseRestoreRequest,
+ AzureWorkloadSAPHanaRestoreRequest, AzureWorkloadSQLRestoreRequest
All required parameters must be populated in order to send to server.
@@ -10214,6 +10360,7 @@ class AzureWorkloadRestoreRequest(RestoreRequest): # pylint: disable=too-many-i
_subtype_map = {
"object_type": {
"AzureWorkloadPointInTimeRestoreRequest": "AzureWorkloadPointInTimeRestoreRequest",
+ "AzureWorkloadSAPAseRestoreRequest": "AzureWorkloadSAPAseRestoreRequest",
"AzureWorkloadSAPHanaRestoreRequest": "AzureWorkloadSAPHanaRestoreRequest",
"AzureWorkloadSQLRestoreRequest": "AzureWorkloadSQLRestoreRequest",
}
@@ -10282,9 +10429,7 @@ def __init__(
self.target_virtual_machine_id = target_virtual_machine_id
-class AzureWorkloadPointInTimeRestoreRequest(
- AzureWorkloadRestoreRequest
-): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadPointInTimeRestoreRequest(AzureWorkloadRestoreRequest):
"""AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore.
All required parameters must be populated in order to send to server.
@@ -10421,10 +10566,10 @@ def __init__(
self.point_in_time = point_in_time
-class AzureWorkloadSAPHanaPointInTimeRecoveryPoint(
+class AzureWorkloadSAPAsePointInTimeRecoveryPoint(
AzureWorkloadPointInTimeRecoveryPoint
): # pylint: disable=name-too-long
- """Recovery point specific to PointInTime in SAPHana.
+ """Recovery point specific to PointInTime in SAPAse.
All required parameters must be populated in order to send to server.
@@ -10506,14 +10651,14 @@ def __init__(
time_ranges=time_ranges,
**kwargs
)
- self.object_type: str = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint"
+ self.object_type: str = "AzureWorkloadSAPAsePointInTimeRecoveryPoint"
-class AzureWorkloadSAPHanaRestoreRequest(AzureWorkloadRestoreRequest): # pylint: disable=too-many-instance-attributes
- """AzureWorkload SAP Hana-specific restore.
+class AzureWorkloadSAPAseRestoreRequest(AzureWorkloadRestoreRequest):
+ """AzureWorkload SAP Ase-specific restore.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureWorkloadSAPHanaPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreWithRehydrateRequest
+ AzureWorkloadSAPAsePointInTimeRestoreRequest
All required parameters must be populated in order to send to server.
@@ -10577,10 +10722,7 @@ class AzureWorkloadSAPHanaRestoreRequest(AzureWorkloadRestoreRequest): # pylint
}
_subtype_map = {
- "object_type": {
- "AzureWorkloadSAPHanaPointInTimeRestoreRequest": "AzureWorkloadSAPHanaPointInTimeRestoreRequest",
- "AzureWorkloadSAPHanaRestoreWithRehydrateRequest": "AzureWorkloadSAPHanaRestoreWithRehydrateRequest",
- }
+ "object_type": {"AzureWorkloadSAPAsePointInTimeRestoreRequest": "AzureWorkloadSAPAsePointInTimeRestoreRequest"}
}
def __init__(
@@ -10646,16 +10788,11 @@ def __init__(
target_virtual_machine_id=target_virtual_machine_id,
**kwargs
)
- self.object_type: str = "AzureWorkloadSAPHanaRestoreRequest"
+ self.object_type: str = "AzureWorkloadSAPAseRestoreRequest"
-class AzureWorkloadSAPHanaPointInTimeRestoreRequest(
- AzureWorkloadSAPHanaRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
- """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore.
-
- You probably want to use the sub-classes and not this class directly. Known sub-classes are:
- AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest
+class AzureWorkloadSAPAsePointInTimeRestoreRequest(AzureWorkloadSAPAseRestoreRequest): # pylint: disable=name-too-long
+ """AzureWorkload SAP Ase-specific restore. Specifically for PointInTime/Log restore.
All required parameters must be populated in order to send to server.
@@ -10721,12 +10858,6 @@ class AzureWorkloadSAPHanaPointInTimeRestoreRequest(
"point_in_time": {"key": "pointInTime", "type": "iso-8601"},
}
- _subtype_map = {
- "object_type": {
- "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest": "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest"
- }
- }
-
def __init__(
self,
*,
@@ -10793,58 +10924,32 @@ def __init__(
target_virtual_machine_id=target_virtual_machine_id,
**kwargs
)
- self.object_type: str = "AzureWorkloadSAPHanaPointInTimeRestoreRequest"
+ self.object_type: str = "AzureWorkloadSAPAsePointInTimeRestoreRequest"
self.point_in_time = point_in_time
-class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(
- AzureWorkloadSAPHanaPointInTimeRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
- """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point.
+class AzureWorkloadSAPAseRecoveryPoint(AzureWorkloadRecoveryPoint):
+ """SAPAse specific recoverypoint, specifically encapsulates full/diff recoverypoints.
All required parameters must be populated in order to send to server.
:ivar object_type: This property will be used as the discriminator for deciding the specific
types in the polymorphic chain of types. Required.
:vartype object_type: str
- :ivar resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check will
- be performed.
- :vartype resource_guard_operation_requests: list[str]
- :ivar recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
- "AlternateLocation", "RestoreDisks", and "Offline".
- :vartype recovery_type: str or
- ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
- :ivar source_resource_id: Fully qualified ARM ID of the VM on which workload that was running
- is being recovered.
- :vartype source_resource_id: str
- :ivar property_bag: Workload specific property bag.
- :vartype property_bag: dict[str, str]
- :ivar target_info: Details of target database.
- :vartype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
- :ivar recovery_mode: Defines whether the current recovery mode is file restore or database
- restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
- "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
- :vartype recovery_mode: str or
- ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
- :ivar target_resource_group_name: Defines the Resource group of the Target VM.
- :vartype target_resource_group_name: str
- :ivar user_assigned_managed_identity_details: User Assigned managed identity details
- Currently used for snapshot.
- :vartype user_assigned_managed_identity_details:
- ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
- :ivar snapshot_restore_parameters: Additional details for snapshot recovery
- Currently used for snapshot for SAP Hana.
- :vartype snapshot_restore_parameters:
- ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
- :ivar target_virtual_machine_id: This is the complete ARM Id of the target VM
- For e.g.
- /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
- :vartype target_virtual_machine_id: str
- :ivar point_in_time: PointInTime value.
- :vartype point_in_time: ~datetime.datetime
- :ivar recovery_point_rehydration_info: RP Rehydration Info.
- :vartype recovery_point_rehydration_info:
- ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointRehydrationInfo
+ :ivar recovery_point_time_in_utc: UTC time at which recovery point was created.
+ :vartype recovery_point_time_in_utc: ~datetime.datetime
+ :ivar type: Type of restore point. Known values are: "Invalid", "Full", "Log", "Differential",
+ "Incremental", "SnapshotFull", and "SnapshotCopyOnlyFull".
+ :vartype type: str or ~azure.mgmt.recoveryservicesbackup.activestamp.models.RestorePointType
+ :ivar recovery_point_tier_details: Recovery point tier information.
+ :vartype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformationV2]
+ :ivar recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier.
+ :vartype recovery_point_move_readiness_info: dict[str,
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointMoveReadinessInfo]
+ :ivar recovery_point_properties: Properties of Recovery Point.
+ :vartype recovery_point_properties:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
"""
_validation = {
@@ -10853,23 +10958,502 @@ class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(
_attribute_map = {
"object_type": {"key": "objectType", "type": "str"},
- "resource_guard_operation_requests": {"key": "resourceGuardOperationRequests", "type": "[str]"},
- "recovery_type": {"key": "recoveryType", "type": "str"},
- "source_resource_id": {"key": "sourceResourceId", "type": "str"},
- "property_bag": {"key": "propertyBag", "type": "{str}"},
- "target_info": {"key": "targetInfo", "type": "TargetRestoreInfo"},
- "recovery_mode": {"key": "recoveryMode", "type": "str"},
- "target_resource_group_name": {"key": "targetResourceGroupName", "type": "str"},
- "user_assigned_managed_identity_details": {
- "key": "userAssignedManagedIdentityDetails",
- "type": "UserAssignedManagedIdentityDetails",
- },
- "snapshot_restore_parameters": {"key": "snapshotRestoreParameters", "type": "SnapshotRestoreParameters"},
- "target_virtual_machine_id": {"key": "targetVirtualMachineId", "type": "str"},
- "point_in_time": {"key": "pointInTime", "type": "iso-8601"},
- "recovery_point_rehydration_info": {
- "key": "recoveryPointRehydrationInfo",
- "type": "RecoveryPointRehydrationInfo",
+ "recovery_point_time_in_utc": {"key": "recoveryPointTimeInUTC", "type": "iso-8601"},
+ "type": {"key": "type", "type": "str"},
+ "recovery_point_tier_details": {"key": "recoveryPointTierDetails", "type": "[RecoveryPointTierInformationV2]"},
+ "recovery_point_move_readiness_info": {
+ "key": "recoveryPointMoveReadinessInfo",
+ "type": "{RecoveryPointMoveReadinessInfo}",
+ },
+ "recovery_point_properties": {"key": "recoveryPointProperties", "type": "RecoveryPointProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ recovery_point_time_in_utc: Optional[datetime.datetime] = None,
+ type: Optional[Union[str, "_models.RestorePointType"]] = None,
+ recovery_point_tier_details: Optional[List["_models.RecoveryPointTierInformationV2"]] = None,
+ recovery_point_move_readiness_info: Optional[Dict[str, "_models.RecoveryPointMoveReadinessInfo"]] = None,
+ recovery_point_properties: Optional["_models.RecoveryPointProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword recovery_point_time_in_utc: UTC time at which recovery point was created.
+ :paramtype recovery_point_time_in_utc: ~datetime.datetime
+ :keyword type: Type of restore point. Known values are: "Invalid", "Full", "Log",
+ "Differential", "Incremental", "SnapshotFull", and "SnapshotCopyOnlyFull".
+ :paramtype type: str or ~azure.mgmt.recoveryservicesbackup.activestamp.models.RestorePointType
+ :keyword recovery_point_tier_details: Recovery point tier information.
+ :paramtype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformationV2]
+ :keyword recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier.
+ :paramtype recovery_point_move_readiness_info: dict[str,
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointMoveReadinessInfo]
+ :keyword recovery_point_properties: Properties of Recovery Point.
+ :paramtype recovery_point_properties:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
+ """
+ super().__init__(
+ recovery_point_time_in_utc=recovery_point_time_in_utc,
+ type=type,
+ recovery_point_tier_details=recovery_point_tier_details,
+ recovery_point_move_readiness_info=recovery_point_move_readiness_info,
+ recovery_point_properties=recovery_point_properties,
+ **kwargs
+ )
+ self.object_type: str = "AzureWorkloadSAPAseRecoveryPoint"
+
+
+class AzureWorkloadSAPHanaPointInTimeRecoveryPoint(
+ AzureWorkloadPointInTimeRecoveryPoint
+): # pylint: disable=name-too-long
+ """Recovery point specific to PointInTime in SAPHana.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar object_type: This property will be used as the discriminator for deciding the specific
+ types in the polymorphic chain of types. Required.
+ :vartype object_type: str
+ :ivar recovery_point_time_in_utc: UTC time at which recovery point was created.
+ :vartype recovery_point_time_in_utc: ~datetime.datetime
+ :ivar type: Type of restore point. Known values are: "Invalid", "Full", "Log", "Differential",
+ "Incremental", "SnapshotFull", and "SnapshotCopyOnlyFull".
+ :vartype type: str or ~azure.mgmt.recoveryservicesbackup.activestamp.models.RestorePointType
+ :ivar recovery_point_tier_details: Recovery point tier information.
+ :vartype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformationV2]
+ :ivar recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier.
+ :vartype recovery_point_move_readiness_info: dict[str,
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointMoveReadinessInfo]
+ :ivar recovery_point_properties: Properties of Recovery Point.
+ :vartype recovery_point_properties:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
+ :ivar time_ranges: List of log ranges.
+ :vartype time_ranges:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.PointInTimeRange]
+ """
+
+ _validation = {
+ "object_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "object_type": {"key": "objectType", "type": "str"},
+ "recovery_point_time_in_utc": {"key": "recoveryPointTimeInUTC", "type": "iso-8601"},
+ "type": {"key": "type", "type": "str"},
+ "recovery_point_tier_details": {"key": "recoveryPointTierDetails", "type": "[RecoveryPointTierInformationV2]"},
+ "recovery_point_move_readiness_info": {
+ "key": "recoveryPointMoveReadinessInfo",
+ "type": "{RecoveryPointMoveReadinessInfo}",
+ },
+ "recovery_point_properties": {"key": "recoveryPointProperties", "type": "RecoveryPointProperties"},
+ "time_ranges": {"key": "timeRanges", "type": "[PointInTimeRange]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ recovery_point_time_in_utc: Optional[datetime.datetime] = None,
+ type: Optional[Union[str, "_models.RestorePointType"]] = None,
+ recovery_point_tier_details: Optional[List["_models.RecoveryPointTierInformationV2"]] = None,
+ recovery_point_move_readiness_info: Optional[Dict[str, "_models.RecoveryPointMoveReadinessInfo"]] = None,
+ recovery_point_properties: Optional["_models.RecoveryPointProperties"] = None,
+ time_ranges: Optional[List["_models.PointInTimeRange"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword recovery_point_time_in_utc: UTC time at which recovery point was created.
+ :paramtype recovery_point_time_in_utc: ~datetime.datetime
+ :keyword type: Type of restore point. Known values are: "Invalid", "Full", "Log",
+ "Differential", "Incremental", "SnapshotFull", and "SnapshotCopyOnlyFull".
+ :paramtype type: str or ~azure.mgmt.recoveryservicesbackup.activestamp.models.RestorePointType
+ :keyword recovery_point_tier_details: Recovery point tier information.
+ :paramtype recovery_point_tier_details:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointTierInformationV2]
+ :keyword recovery_point_move_readiness_info: Eligibility of RP to be moved to another tier.
+ :paramtype recovery_point_move_readiness_info: dict[str,
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointMoveReadinessInfo]
+ :keyword recovery_point_properties: Properties of Recovery Point.
+ :paramtype recovery_point_properties:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointProperties
+ :keyword time_ranges: List of log ranges.
+ :paramtype time_ranges:
+ list[~azure.mgmt.recoveryservicesbackup.activestamp.models.PointInTimeRange]
+ """
+ super().__init__(
+ recovery_point_time_in_utc=recovery_point_time_in_utc,
+ type=type,
+ recovery_point_tier_details=recovery_point_tier_details,
+ recovery_point_move_readiness_info=recovery_point_move_readiness_info,
+ recovery_point_properties=recovery_point_properties,
+ time_ranges=time_ranges,
+ **kwargs
+ )
+ self.object_type: str = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint"
+
+
+class AzureWorkloadSAPHanaRestoreRequest(AzureWorkloadRestoreRequest):
+ """AzureWorkload SAP Hana-specific restore.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ AzureWorkloadSAPHanaPointInTimeRestoreRequest, AzureWorkloadSAPHanaRestoreWithRehydrateRequest
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar object_type: This property will be used as the discriminator for deciding the specific
+ types in the polymorphic chain of types. Required.
+ :vartype object_type: str
+ :ivar resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check will
+ be performed.
+ :vartype resource_guard_operation_requests: list[str]
+ :ivar recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
+ "AlternateLocation", "RestoreDisks", and "Offline".
+ :vartype recovery_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
+ :ivar source_resource_id: Fully qualified ARM ID of the VM on which workload that was running
+ is being recovered.
+ :vartype source_resource_id: str
+ :ivar property_bag: Workload specific property bag.
+ :vartype property_bag: dict[str, str]
+ :ivar target_info: Details of target database.
+ :vartype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
+ :ivar recovery_mode: Defines whether the current recovery mode is file restore or database
+ restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
+ "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
+ :vartype recovery_mode: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
+ :ivar target_resource_group_name: Defines the Resource group of the Target VM.
+ :vartype target_resource_group_name: str
+ :ivar user_assigned_managed_identity_details: User Assigned managed identity details
+ Currently used for snapshot.
+ :vartype user_assigned_managed_identity_details:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
+ :ivar snapshot_restore_parameters: Additional details for snapshot recovery
+ Currently used for snapshot for SAP Hana.
+ :vartype snapshot_restore_parameters:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
+ :ivar target_virtual_machine_id: This is the complete ARM Id of the target VM
+ For e.g.
+ /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
+ :vartype target_virtual_machine_id: str
+ """
+
+ _validation = {
+ "object_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "object_type": {"key": "objectType", "type": "str"},
+ "resource_guard_operation_requests": {"key": "resourceGuardOperationRequests", "type": "[str]"},
+ "recovery_type": {"key": "recoveryType", "type": "str"},
+ "source_resource_id": {"key": "sourceResourceId", "type": "str"},
+ "property_bag": {"key": "propertyBag", "type": "{str}"},
+ "target_info": {"key": "targetInfo", "type": "TargetRestoreInfo"},
+ "recovery_mode": {"key": "recoveryMode", "type": "str"},
+ "target_resource_group_name": {"key": "targetResourceGroupName", "type": "str"},
+ "user_assigned_managed_identity_details": {
+ "key": "userAssignedManagedIdentityDetails",
+ "type": "UserAssignedManagedIdentityDetails",
+ },
+ "snapshot_restore_parameters": {"key": "snapshotRestoreParameters", "type": "SnapshotRestoreParameters"},
+ "target_virtual_machine_id": {"key": "targetVirtualMachineId", "type": "str"},
+ }
+
+ _subtype_map = {
+ "object_type": {
+ "AzureWorkloadSAPHanaPointInTimeRestoreRequest": "AzureWorkloadSAPHanaPointInTimeRestoreRequest",
+ "AzureWorkloadSAPHanaRestoreWithRehydrateRequest": "AzureWorkloadSAPHanaRestoreWithRehydrateRequest",
+ }
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_guard_operation_requests: Optional[List[str]] = None,
+ recovery_type: Optional[Union[str, "_models.RecoveryType"]] = None,
+ source_resource_id: Optional[str] = None,
+ property_bag: Optional[Dict[str, str]] = None,
+ target_info: Optional["_models.TargetRestoreInfo"] = None,
+ recovery_mode: Optional[Union[str, "_models.RecoveryMode"]] = None,
+ target_resource_group_name: Optional[str] = None,
+ user_assigned_managed_identity_details: Optional["_models.UserAssignedManagedIdentityDetails"] = None,
+ snapshot_restore_parameters: Optional["_models.SnapshotRestoreParameters"] = None,
+ target_virtual_machine_id: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check
+ will be performed.
+ :paramtype resource_guard_operation_requests: list[str]
+ :keyword recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
+ "AlternateLocation", "RestoreDisks", and "Offline".
+ :paramtype recovery_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
+ :keyword source_resource_id: Fully qualified ARM ID of the VM on which workload that was
+ running is being recovered.
+ :paramtype source_resource_id: str
+ :keyword property_bag: Workload specific property bag.
+ :paramtype property_bag: dict[str, str]
+ :keyword target_info: Details of target database.
+ :paramtype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
+ :keyword recovery_mode: Defines whether the current recovery mode is file restore or database
+ restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
+ "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
+ :paramtype recovery_mode: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
+ :keyword target_resource_group_name: Defines the Resource group of the Target VM.
+ :paramtype target_resource_group_name: str
+ :keyword user_assigned_managed_identity_details: User Assigned managed identity details
+ Currently used for snapshot.
+ :paramtype user_assigned_managed_identity_details:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
+ :keyword snapshot_restore_parameters: Additional details for snapshot recovery
+ Currently used for snapshot for SAP Hana.
+ :paramtype snapshot_restore_parameters:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
+ :keyword target_virtual_machine_id: This is the complete ARM Id of the target VM
+ For e.g.
+ /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
+ :paramtype target_virtual_machine_id: str
+ """
+ super().__init__(
+ resource_guard_operation_requests=resource_guard_operation_requests,
+ recovery_type=recovery_type,
+ source_resource_id=source_resource_id,
+ property_bag=property_bag,
+ target_info=target_info,
+ recovery_mode=recovery_mode,
+ target_resource_group_name=target_resource_group_name,
+ user_assigned_managed_identity_details=user_assigned_managed_identity_details,
+ snapshot_restore_parameters=snapshot_restore_parameters,
+ target_virtual_machine_id=target_virtual_machine_id,
+ **kwargs
+ )
+ self.object_type: str = "AzureWorkloadSAPHanaRestoreRequest"
+
+
+class AzureWorkloadSAPHanaPointInTimeRestoreRequest(
+ AzureWorkloadSAPHanaRestoreRequest
+): # pylint: disable=name-too-long
+ """AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore.
+
+ You probably want to use the sub-classes and not this class directly. Known sub-classes are:
+ AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar object_type: This property will be used as the discriminator for deciding the specific
+ types in the polymorphic chain of types. Required.
+ :vartype object_type: str
+ :ivar resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check will
+ be performed.
+ :vartype resource_guard_operation_requests: list[str]
+ :ivar recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
+ "AlternateLocation", "RestoreDisks", and "Offline".
+ :vartype recovery_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
+ :ivar source_resource_id: Fully qualified ARM ID of the VM on which workload that was running
+ is being recovered.
+ :vartype source_resource_id: str
+ :ivar property_bag: Workload specific property bag.
+ :vartype property_bag: dict[str, str]
+ :ivar target_info: Details of target database.
+ :vartype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
+ :ivar recovery_mode: Defines whether the current recovery mode is file restore or database
+ restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
+ "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
+ :vartype recovery_mode: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
+ :ivar target_resource_group_name: Defines the Resource group of the Target VM.
+ :vartype target_resource_group_name: str
+ :ivar user_assigned_managed_identity_details: User Assigned managed identity details
+ Currently used for snapshot.
+ :vartype user_assigned_managed_identity_details:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
+ :ivar snapshot_restore_parameters: Additional details for snapshot recovery
+ Currently used for snapshot for SAP Hana.
+ :vartype snapshot_restore_parameters:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
+ :ivar target_virtual_machine_id: This is the complete ARM Id of the target VM
+ For e.g.
+ /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
+ :vartype target_virtual_machine_id: str
+ :ivar point_in_time: PointInTime value.
+ :vartype point_in_time: ~datetime.datetime
+ """
+
+ _validation = {
+ "object_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "object_type": {"key": "objectType", "type": "str"},
+ "resource_guard_operation_requests": {"key": "resourceGuardOperationRequests", "type": "[str]"},
+ "recovery_type": {"key": "recoveryType", "type": "str"},
+ "source_resource_id": {"key": "sourceResourceId", "type": "str"},
+ "property_bag": {"key": "propertyBag", "type": "{str}"},
+ "target_info": {"key": "targetInfo", "type": "TargetRestoreInfo"},
+ "recovery_mode": {"key": "recoveryMode", "type": "str"},
+ "target_resource_group_name": {"key": "targetResourceGroupName", "type": "str"},
+ "user_assigned_managed_identity_details": {
+ "key": "userAssignedManagedIdentityDetails",
+ "type": "UserAssignedManagedIdentityDetails",
+ },
+ "snapshot_restore_parameters": {"key": "snapshotRestoreParameters", "type": "SnapshotRestoreParameters"},
+ "target_virtual_machine_id": {"key": "targetVirtualMachineId", "type": "str"},
+ "point_in_time": {"key": "pointInTime", "type": "iso-8601"},
+ }
+
+ _subtype_map = {
+ "object_type": {
+ "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest": "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest"
+ }
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_guard_operation_requests: Optional[List[str]] = None,
+ recovery_type: Optional[Union[str, "_models.RecoveryType"]] = None,
+ source_resource_id: Optional[str] = None,
+ property_bag: Optional[Dict[str, str]] = None,
+ target_info: Optional["_models.TargetRestoreInfo"] = None,
+ recovery_mode: Optional[Union[str, "_models.RecoveryMode"]] = None,
+ target_resource_group_name: Optional[str] = None,
+ user_assigned_managed_identity_details: Optional["_models.UserAssignedManagedIdentityDetails"] = None,
+ snapshot_restore_parameters: Optional["_models.SnapshotRestoreParameters"] = None,
+ target_virtual_machine_id: Optional[str] = None,
+ point_in_time: Optional[datetime.datetime] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check
+ will be performed.
+ :paramtype resource_guard_operation_requests: list[str]
+ :keyword recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
+ "AlternateLocation", "RestoreDisks", and "Offline".
+ :paramtype recovery_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
+ :keyword source_resource_id: Fully qualified ARM ID of the VM on which workload that was
+ running is being recovered.
+ :paramtype source_resource_id: str
+ :keyword property_bag: Workload specific property bag.
+ :paramtype property_bag: dict[str, str]
+ :keyword target_info: Details of target database.
+ :paramtype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
+ :keyword recovery_mode: Defines whether the current recovery mode is file restore or database
+ restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
+ "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
+ :paramtype recovery_mode: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
+ :keyword target_resource_group_name: Defines the Resource group of the Target VM.
+ :paramtype target_resource_group_name: str
+ :keyword user_assigned_managed_identity_details: User Assigned managed identity details
+ Currently used for snapshot.
+ :paramtype user_assigned_managed_identity_details:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
+ :keyword snapshot_restore_parameters: Additional details for snapshot recovery
+ Currently used for snapshot for SAP Hana.
+ :paramtype snapshot_restore_parameters:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
+ :keyword target_virtual_machine_id: This is the complete ARM Id of the target VM
+ For e.g.
+ /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
+ :paramtype target_virtual_machine_id: str
+ :keyword point_in_time: PointInTime value.
+ :paramtype point_in_time: ~datetime.datetime
+ """
+ super().__init__(
+ resource_guard_operation_requests=resource_guard_operation_requests,
+ recovery_type=recovery_type,
+ source_resource_id=source_resource_id,
+ property_bag=property_bag,
+ target_info=target_info,
+ recovery_mode=recovery_mode,
+ target_resource_group_name=target_resource_group_name,
+ user_assigned_managed_identity_details=user_assigned_managed_identity_details,
+ snapshot_restore_parameters=snapshot_restore_parameters,
+ target_virtual_machine_id=target_virtual_machine_id,
+ **kwargs
+ )
+ self.object_type: str = "AzureWorkloadSAPHanaPointInTimeRestoreRequest"
+ self.point_in_time = point_in_time
+
+
+class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(
+ AzureWorkloadSAPHanaPointInTimeRestoreRequest
+): # pylint: disable=name-too-long
+ """AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar object_type: This property will be used as the discriminator for deciding the specific
+ types in the polymorphic chain of types. Required.
+ :vartype object_type: str
+ :ivar resource_guard_operation_requests: ResourceGuardOperationRequests on which LAC check will
+ be performed.
+ :vartype resource_guard_operation_requests: list[str]
+ :ivar recovery_type: Type of this recovery. Known values are: "Invalid", "OriginalLocation",
+ "AlternateLocation", "RestoreDisks", and "Offline".
+ :vartype recovery_type: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryType
+ :ivar source_resource_id: Fully qualified ARM ID of the VM on which workload that was running
+ is being recovered.
+ :vartype source_resource_id: str
+ :ivar property_bag: Workload specific property bag.
+ :vartype property_bag: dict[str, str]
+ :ivar target_info: Details of target database.
+ :vartype target_info: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TargetRestoreInfo
+ :ivar recovery_mode: Defines whether the current recovery mode is file restore or database
+ restore. Known values are: "Invalid", "FileRecovery", "WorkloadRecovery", "SnapshotAttach",
+ "RecoveryUsingSnapshot", and "SnapshotAttachAndRecover".
+ :vartype recovery_mode: str or
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryMode
+ :ivar target_resource_group_name: Defines the Resource group of the Target VM.
+ :vartype target_resource_group_name: str
+ :ivar user_assigned_managed_identity_details: User Assigned managed identity details
+ Currently used for snapshot.
+ :vartype user_assigned_managed_identity_details:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.UserAssignedManagedIdentityDetails
+ :ivar snapshot_restore_parameters: Additional details for snapshot recovery
+ Currently used for snapshot for SAP Hana.
+ :vartype snapshot_restore_parameters:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.SnapshotRestoreParameters
+ :ivar target_virtual_machine_id: This is the complete ARM Id of the target VM
+ For e.g.
+ /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}.
+ :vartype target_virtual_machine_id: str
+ :ivar point_in_time: PointInTime value.
+ :vartype point_in_time: ~datetime.datetime
+ :ivar recovery_point_rehydration_info: RP Rehydration Info.
+ :vartype recovery_point_rehydration_info:
+ ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointRehydrationInfo
+ """
+
+ _validation = {
+ "object_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "object_type": {"key": "objectType", "type": "str"},
+ "resource_guard_operation_requests": {"key": "resourceGuardOperationRequests", "type": "[str]"},
+ "recovery_type": {"key": "recoveryType", "type": "str"},
+ "source_resource_id": {"key": "sourceResourceId", "type": "str"},
+ "property_bag": {"key": "propertyBag", "type": "{str}"},
+ "target_info": {"key": "targetInfo", "type": "TargetRestoreInfo"},
+ "recovery_mode": {"key": "recoveryMode", "type": "str"},
+ "target_resource_group_name": {"key": "targetResourceGroupName", "type": "str"},
+ "user_assigned_managed_identity_details": {
+ "key": "userAssignedManagedIdentityDetails",
+ "type": "UserAssignedManagedIdentityDetails",
+ },
+ "snapshot_restore_parameters": {"key": "snapshotRestoreParameters", "type": "SnapshotRestoreParameters"},
+ "target_virtual_machine_id": {"key": "targetVirtualMachineId", "type": "str"},
+ "point_in_time": {"key": "pointInTime", "type": "iso-8601"},
+ "recovery_point_rehydration_info": {
+ "key": "recoveryPointRehydrationInfo",
+ "type": "RecoveryPointRehydrationInfo",
},
}
@@ -11027,7 +11611,7 @@ def __init__(
class AzureWorkloadSAPHanaRestoreWithRehydrateRequest(
AzureWorkloadSAPHanaRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
+): # pylint: disable=name-too-long
"""AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point.
All required parameters must be populated in order to send to server.
@@ -11464,7 +12048,7 @@ def __init__(
self.time_ranges = time_ranges
-class AzureWorkloadSQLRestoreRequest(AzureWorkloadRestoreRequest): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadSQLRestoreRequest(AzureWorkloadRestoreRequest):
"""AzureWorkload SQL -specific restore. Specifically for full/diff restore.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -11631,9 +12215,7 @@ def __init__(
self.alternate_directory_paths = alternate_directory_paths
-class AzureWorkloadSQLPointInTimeRestoreRequest(
- AzureWorkloadSQLRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureWorkloadSQLPointInTimeRestoreRequest(AzureWorkloadSQLRestoreRequest): # pylint: disable=name-too-long
"""AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -11808,7 +12390,7 @@ def __init__(
class AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest(
AzureWorkloadSQLPointInTimeRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
+): # pylint: disable=name-too-long
"""AzureWorkload SQL-specific restore with integrated rehydration of recovery point.
All required parameters must be populated in order to send to server.
@@ -12018,9 +12600,7 @@ def __init__(
self.data_directory_paths = data_directory_paths
-class AzureWorkloadSQLRestoreWithRehydrateRequest(
- AzureWorkloadSQLRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureWorkloadSQLRestoreWithRehydrateRequest(AzureWorkloadSQLRestoreRequest): # pylint: disable=name-too-long
"""AzureWorkload SQL-specific restore with integrated rehydration of recovery point.
All required parameters must be populated in order to send to server.
@@ -12313,8 +12893,9 @@ def __init__(
class ResourceList(_serialization.Model):
"""Base for all lists of resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
"""
@@ -12324,8 +12905,9 @@ class ResourceList(_serialization.Model):
def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
"""
super().__init__(**kwargs)
@@ -12335,8 +12917,9 @@ def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None:
class BackupEngineBaseResourceList(ResourceList):
"""List of BackupEngineBase resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -12356,8 +12939,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -13200,7 +13784,7 @@ def __init__(
self.po_logical_name = po_logical_name
-class BackupStatusResponse(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class BackupStatusResponse(_serialization.Model):
"""BackupStatus response.
:ivar protection_status: Specifies whether the container is registered or not. Known values
@@ -14375,7 +14959,7 @@ def __init__(
self.source_resource_id = source_resource_id
-class DpmBackupEngine(BackupEngineBase): # pylint: disable=too-many-instance-attributes
+class DpmBackupEngine(BackupEngineBase):
"""Data Protection Manager (DPM) specific backup engine.
All required parameters must be populated in order to send to server.
@@ -14553,7 +15137,7 @@ def __init__(
self.recommendations = recommendations
-class DpmJob(Job): # pylint: disable=too-many-instance-attributes
+class DpmJob(Job):
"""DPM workload-specific job object.
All required parameters must be populated in order to send to server.
@@ -14796,7 +15380,7 @@ def __init__(
self.status = status
-class DPMProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class DPMProtectedItem(ProtectedItem):
"""Additional information on Backup engine specific backup item.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -15001,7 +15585,7 @@ def __init__(
self.extended_info = extended_info
-class DPMProtectedItemExtendedInfo(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DPMProtectedItemExtendedInfo(_serialization.Model):
"""Additional information of DPM Protected item.
:ivar protectable_object_load_path: Attribute to provide information on various DBs.
@@ -15863,7 +16447,7 @@ def __init__(
self.service_endpoints = service_endpoints
-class GenericProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class GenericProtectedItem(ProtectedItem):
"""Base class for backup items.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -16380,7 +16964,7 @@ def __init__(
self.renew_existing_registration = renew_existing_registration
-class IaasVMRecoveryPoint(RecoveryPoint): # pylint: disable=too-many-instance-attributes
+class IaasVMRecoveryPoint(RecoveryPoint):
"""IaaS VM workload specific backup copy.
All required parameters must be populated in order to send to server.
@@ -16573,7 +17157,7 @@ def __init__(
self.extended_location = extended_location
-class IaasVMRestoreRequest(RestoreRequest): # pylint: disable=too-many-instance-attributes
+class IaasVMRestoreRequest(RestoreRequest):
"""IaaS VM workload-specific restore.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -16836,7 +17420,7 @@ def __init__( # pylint: disable=too-many-locals
self.target_disk_network_access_settings = target_disk_network_access_settings
-class IaasVMRestoreWithRehydrationRequest(IaasVMRestoreRequest): # pylint: disable=too-many-instance-attributes
+class IaasVMRestoreWithRehydrationRequest(IaasVMRestoreRequest):
"""IaaS VM workload-specific restore with integrated rehydration of recovery point.
All required parameters must be populated in order to send to server.
@@ -17517,8 +18101,9 @@ def __init__(
class JobResourceList(ResourceList):
"""List of Job resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value: list[~azure.mgmt.recoveryservicesbackup.activestamp.models.JobResource]
@@ -17533,8 +18118,9 @@ def __init__(
self, *, next_link: Optional[str] = None, value: Optional[List["_models.JobResource"]] = None, **kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value: list[~azure.mgmt.recoveryservicesbackup.activestamp.models.JobResource]
@@ -17889,7 +18475,7 @@ def __init__(self, **kwargs: Any) -> None:
self.schedule_policy_type: str = "LongTermSchedulePolicy"
-class MabContainer(ProtectionContainer): # pylint: disable=too-many-instance-attributes
+class MabContainer(ProtectionContainer):
"""Container with items backed up using MAB backup engine.
All required parameters must be populated in order to send to server.
@@ -18163,7 +18749,7 @@ def __init__(self, **kwargs: Any) -> None:
self.recommendations = None
-class MabFileFolderProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class MabFileFolderProtectedItem(ProtectedItem):
"""MAB workload-specific backup item.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -18422,7 +19008,7 @@ def __init__(
self.recovery_point_count = recovery_point_count
-class MabJob(Job): # pylint: disable=too-many-instance-attributes
+class MabJob(Job):
"""MAB workload-specific job.
All required parameters must be populated in order to send to server.
@@ -19951,8 +20537,9 @@ def __init__(
class ProtectableContainerResourceList(ResourceList):
"""List of ProtectableContainer resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -19972,8 +20559,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -20144,8 +20732,9 @@ def __init__(
class ProtectedItemResourceList(ResourceList):
"""List of ProtectedItem resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -20165,8 +20754,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -20242,8 +20832,9 @@ def __init__(
class ProtectionContainerResourceList(ResourceList):
"""List of ProtectionContainer resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -20263,8 +20854,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -20393,8 +20985,9 @@ def __init__(
class ProtectionIntentResourceList(ResourceList):
"""List of ProtectionIntent resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -20414,8 +21007,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -20542,8 +21136,9 @@ def __init__(
class ProtectionPolicyResourceList(ResourceList):
"""List of ProtectionPolicy resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -20563,8 +21158,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -20791,8 +21387,9 @@ def __init__(
class RecoveryPointResourceList(ResourceList):
"""List of RecoveryPoint resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -20812,8 +21409,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -21041,8 +21639,9 @@ def __init__(
class ResourceGuardProxyBaseResourceList(ResourceList):
"""List of ResourceGuardProxyBase resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -21062,8 +21661,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -22458,7 +23058,7 @@ def __init__(
self.validate_operation_response = validate_operation_response
-class VaultJob(Job): # pylint: disable=too-many-instance-attributes
+class VaultJob(Job):
"""Vault level Job.
All required parameters must be populated in order to send to server.
@@ -22893,8 +23493,9 @@ def __init__(
class WorkloadItemResourceList(ResourceList):
"""List of WorkloadItem resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -22914,8 +23515,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
@@ -22991,8 +23593,9 @@ def __init__(
class WorkloadProtectableItemResourceList(ResourceList):
"""List of WorkloadProtectableItem resources.
- :ivar next_link: The uri to fetch the next page of resources. Call ListNext() fetches next page
- of resources.
+ :ivar next_link: The URI to fetch the next page of resources, with each API call returning up
+ to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:vartype next_link: str
:ivar value: List of resources.
:vartype value:
@@ -23012,8 +23615,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword next_link: The uri to fetch the next page of resources. Call ListNext() fetches next
- page of resources.
+ :keyword next_link: The URI to fetch the next page of resources, with each API call returning
+ up to 200 resources per page. Use ListNext() to fetch the next page if the total number of
+ resources exceeds 200.
:paramtype next_link: str
:keyword value: List of resources.
:paramtype value:
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_recovery_services_backup_client_enums.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_recovery_services_backup_client_enums.py
index ec410a08f81d..8bfe2968a8fa 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_recovery_services_backup_client_enums.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/models/_recovery_services_backup_client_enums.py
@@ -414,6 +414,7 @@ class OperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
INVALID = "Invalid"
REGISTER = "Register"
REREGISTER = "Reregister"
+ REHYDRATE = "Rehydrate"
class OverwriteOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta):
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/__init__.py
index 29071c5cf960..634b1b06bf96 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/__init__.py
@@ -5,65 +5,69 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._backup_resource_storage_configs_non_crr_operations import BackupResourceStorageConfigsNonCRROperations
-from ._protection_intent_operations import ProtectionIntentOperations
-from ._backup_status_operations import BackupStatusOperations
-from ._feature_support_operations import FeatureSupportOperations
-from ._backup_protection_intent_operations import BackupProtectionIntentOperations
-from ._backup_usage_summaries_operations import BackupUsageSummariesOperations
-from ._operations import Operations
-from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations
-from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations
-from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations
-from ._private_endpoint_operations import PrivateEndpointOperations
-from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin
-from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations
-from ._protected_items_operations import ProtectedItemsOperations
-from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations
-from ._recovery_points_operations import RecoveryPointsOperations
-from ._restores_operations import RestoresOperations
-from ._backup_policies_operations import BackupPoliciesOperations
-from ._protection_policies_operations import ProtectionPoliciesOperations
-from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations
-from ._backup_jobs_operations import BackupJobsOperations
-from ._job_details_operations import JobDetailsOperations
-from ._job_cancellations_operations import JobCancellationsOperations
-from ._job_operation_results_operations import JobOperationResultsOperations
-from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations
-from ._jobs_operations import JobsOperations
-from ._backup_protected_items_operations import BackupProtectedItemsOperations
-from ._operation_operations import OperationOperations
-from ._validate_operation_operations import ValidateOperationOperations
-from ._validate_operation_results_operations import ValidateOperationResultsOperations
-from ._validate_operation_statuses_operations import ValidateOperationStatusesOperations
-from ._backup_engines_operations import BackupEnginesOperations
-from ._protection_container_refresh_operation_results_operations import (
- ProtectionContainerRefreshOperationResultsOperations,
-)
-from ._protectable_containers_operations import ProtectableContainersOperations
-from ._protection_containers_operations import ProtectionContainersOperations
-from ._backup_workload_items_operations import BackupWorkloadItemsOperations
-from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations
-from ._backups_operations import BackupsOperations
-from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations
-from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations
-from ._backup_operation_results_operations import BackupOperationResultsOperations
-from ._backup_operation_statuses_operations import BackupOperationStatusesOperations
-from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations
-from ._backup_protectable_items_operations import BackupProtectableItemsOperations
-from ._backup_protection_containers_operations import BackupProtectionContainersOperations
-from ._deleted_protection_containers_operations import DeletedProtectionContainersOperations
-from ._security_pins_operations import SecurityPINsOperations
-from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations
-from ._resource_guard_proxies_operations import ResourceGuardProxiesOperations
-from ._resource_guard_proxy_operations import ResourceGuardProxyOperations
-from ._fetch_tiering_cost_operations import FetchTieringCostOperations
-from ._get_tiering_cost_operation_result_operations import GetTieringCostOperationResultOperations
-from ._tiering_cost_operation_status_operations import TieringCostOperationStatusOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._backup_resource_storage_configs_non_crr_operations import BackupResourceStorageConfigsNonCRROperations # type: ignore
+from ._protection_intent_operations import ProtectionIntentOperations # type: ignore
+from ._backup_status_operations import BackupStatusOperations # type: ignore
+from ._feature_support_operations import FeatureSupportOperations # type: ignore
+from ._backup_protection_intent_operations import BackupProtectionIntentOperations # type: ignore
+from ._backup_usage_summaries_operations import BackupUsageSummariesOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._backup_resource_vault_configs_operations import BackupResourceVaultConfigsOperations # type: ignore
+from ._backup_resource_encryption_configs_operations import BackupResourceEncryptionConfigsOperations # type: ignore
+from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations # type: ignore
+from ._private_endpoint_operations import PrivateEndpointOperations # type: ignore
+from ._recovery_services_backup_client_operations import RecoveryServicesBackupClientOperationsMixin # type: ignore
+from ._bms_prepare_data_move_operation_result_operations import BMSPrepareDataMoveOperationResultOperations # type: ignore
+from ._protected_items_operations import ProtectedItemsOperations # type: ignore
+from ._protected_item_operation_results_operations import ProtectedItemOperationResultsOperations # type: ignore
+from ._recovery_points_operations import RecoveryPointsOperations # type: ignore
+from ._restores_operations import RestoresOperations # type: ignore
+from ._backup_policies_operations import BackupPoliciesOperations # type: ignore
+from ._protection_policies_operations import ProtectionPoliciesOperations # type: ignore
+from ._protection_policy_operation_results_operations import ProtectionPolicyOperationResultsOperations # type: ignore
+from ._backup_jobs_operations import BackupJobsOperations # type: ignore
+from ._job_details_operations import JobDetailsOperations # type: ignore
+from ._job_cancellations_operations import JobCancellationsOperations # type: ignore
+from ._job_operation_results_operations import JobOperationResultsOperations # type: ignore
+from ._export_jobs_operation_results_operations import ExportJobsOperationResultsOperations # type: ignore
+from ._jobs_operations import JobsOperations # type: ignore
+from ._backup_protected_items_operations import BackupProtectedItemsOperations # type: ignore
+from ._operation_operations import OperationOperations # type: ignore
+from ._validate_operation_operations import ValidateOperationOperations # type: ignore
+from ._validate_operation_results_operations import ValidateOperationResultsOperations # type: ignore
+from ._validate_operation_statuses_operations import ValidateOperationStatusesOperations # type: ignore
+from ._backup_engines_operations import BackupEnginesOperations # type: ignore
+from ._protection_container_refresh_operation_results_operations import ProtectionContainerRefreshOperationResultsOperations # type: ignore
+from ._protectable_containers_operations import ProtectableContainersOperations # type: ignore
+from ._protection_containers_operations import ProtectionContainersOperations # type: ignore
+from ._backup_workload_items_operations import BackupWorkloadItemsOperations # type: ignore
+from ._protection_container_operation_results_operations import ProtectionContainerOperationResultsOperations # type: ignore
+from ._backups_operations import BackupsOperations # type: ignore
+from ._protected_item_operation_statuses_operations import ProtectedItemOperationStatusesOperations # type: ignore
+from ._item_level_recovery_connections_operations import ItemLevelRecoveryConnectionsOperations # type: ignore
+from ._backup_operation_results_operations import BackupOperationResultsOperations # type: ignore
+from ._backup_operation_statuses_operations import BackupOperationStatusesOperations # type: ignore
+from ._protection_policy_operation_statuses_operations import ProtectionPolicyOperationStatusesOperations # type: ignore
+from ._backup_protectable_items_operations import BackupProtectableItemsOperations # type: ignore
+from ._backup_protection_containers_operations import BackupProtectionContainersOperations # type: ignore
+from ._deleted_protection_containers_operations import DeletedProtectionContainersOperations # type: ignore
+from ._security_pins_operations import SecurityPINsOperations # type: ignore
+from ._recovery_points_recommended_for_move_operations import RecoveryPointsRecommendedForMoveOperations # type: ignore
+from ._resource_guard_proxies_operations import ResourceGuardProxiesOperations # type: ignore
+from ._resource_guard_proxy_operations import ResourceGuardProxyOperations # type: ignore
+from ._fetch_tiering_cost_operations import FetchTieringCostOperations # type: ignore
+from ._get_tiering_cost_operation_result_operations import GetTieringCostOperationResultOperations # type: ignore
+from ._tiering_cost_operation_status_operations import TieringCostOperationStatusOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -121,5 +125,5 @@
"GetTieringCostOperationResultOperations",
"TieringCostOperationStatusOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_engines_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_engines_operations.py
index 750ef85acbee..f94f5c1a2d29 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_engines_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_engines_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -90,7 +92,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -172,7 +174,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupEngineBaseResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -193,7 +195,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -209,7 +210,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -265,7 +265,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupEngineBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -290,7 +290,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -304,7 +303,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupEngineBaseResource", pipeline_response)
+ deserialized = self._deserialize("BackupEngineBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_jobs_operations.py
index 53353aeef9fb..c3936bc13ad9 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -127,7 +129,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -148,7 +150,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -164,7 +165,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_results_operations.py
index 932b77ad5aba..322fb6299f3a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -108,7 +110,7 @@ def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -131,7 +133,6 @@ def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_statuses_operations.py
index 6f6e1dbd1d49..0620d34cf312 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +108,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -129,7 +131,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -143,7 +144,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_policies_operations.py
index 0baae2b242ec..7ffe613afd79 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_policies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_policies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,7 +44,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -115,7 +117,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionPolicyResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -135,7 +137,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -151,7 +152,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protectable_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protectable_items_operations.py
index c4c07f759b72..ba12a7cc8acb 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protectable_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protectable_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -105,6 +107,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.WorkloadProtectableItemResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of protectable objects within your subscription according to the query
filter and the
pagination parameters.
@@ -130,7 +133,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkloadProtectableItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -151,7 +154,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -167,7 +169,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protected_items_operations.py
index 215d714e7f7c..d9b418daa878 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protected_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protected_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -128,7 +130,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectedItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -149,7 +151,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -165,7 +166,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_containers_operations.py
index afdd97cfc5fe..f537909aa3f0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,7 +44,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -113,7 +115,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -133,7 +135,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -149,7 +150,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_intent_operations.py
index 03f4d4303bc8..17c0432f57f8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_intent_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_protection_intent_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -128,7 +130,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionIntentResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -149,7 +151,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -165,7 +166,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_encryption_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_encryption_configs_operations.py
index 037cf9834897..14616a76863f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_encryption_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_encryption_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_get_request(vault_name: str, resource_group_name: str, subscription_id
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -68,7 +70,7 @@ def build_update_request(vault_name: str, resource_group_name: str, subscription
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -131,7 +133,7 @@ def get(
~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceEncryptionConfigExtendedResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -153,7 +155,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -168,7 +169,9 @@ def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceEncryptionConfigExtendedResource", pipeline_response)
+ deserialized = self._deserialize(
+ "BackupResourceEncryptionConfigExtendedResource", pipeline_response.http_response
+ )
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -176,7 +179,7 @@ def get(
return deserialized # type: ignore
@overload
- def update( # pylint: disable=inconsistent-return-statements
+ def update(
self,
vault_name: str,
resource_group_name: str,
@@ -204,7 +207,7 @@ def update( # pylint: disable=inconsistent-return-statements
"""
@overload
- def update( # pylint: disable=inconsistent-return-statements
+ def update(
self,
vault_name: str,
resource_group_name: str,
@@ -254,7 +257,7 @@ def update( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -288,7 +291,6 @@ def update( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_storage_configs_non_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_storage_configs_non_crr_operations.py
index e876cdc129a0..0d038cd4624c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_storage_configs_non_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_storage_configs_non_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_get_request(vault_name: str, resource_group_name: str, subscription_id
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -68,7 +70,7 @@ def build_update_request(vault_name: str, resource_group_name: str, subscription
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -100,7 +102,7 @@ def build_patch_request(vault_name: str, resource_group_name: str, subscription_
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -160,7 +162,7 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +184,6 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -197,7 +198,7 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -282,7 +283,7 @@ def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -316,7 +317,6 @@ def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -331,7 +331,7 @@ def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -339,7 +339,7 @@ def update(
return deserialized # type: ignore
@overload
- def patch( # pylint: disable=inconsistent-return-statements
+ def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -367,7 +367,7 @@ def patch( # pylint: disable=inconsistent-return-statements
"""
@overload
- def patch( # pylint: disable=inconsistent-return-statements
+ def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -416,7 +416,7 @@ def patch( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -450,7 +450,6 @@ def patch( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_vault_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_vault_configs_operations.py
index 1db13506d133..6eb56bf11c2d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_vault_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_resource_vault_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_get_request(vault_name: str, resource_group_name: str, subscription_id
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -75,7 +77,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -118,7 +120,7 @@ def build_put_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -184,7 +186,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -206,7 +208,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -221,7 +222,7 @@ def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -316,7 +317,7 @@ def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -351,7 +352,6 @@ def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -366,7 +366,7 @@ def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -461,7 +461,7 @@ def put(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupResourceVaultConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -496,7 +496,6 @@ def put(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -511,7 +510,7 @@ def put(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceVaultConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_status_operations.py
index 5666d806acb6..de037e340606 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_get_request(azure_region: str, subscription_id: str, **kwargs: Any) ->
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -148,7 +150,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.BackupStatusResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -181,7 +183,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -195,7 +196,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupStatusResponse", pipeline_response)
+ deserialized = self._deserialize("BackupStatusResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_usage_summaries_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_usage_summaries_operations.py
index 88cd9bf85652..e1906c23af47 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_usage_summaries_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_usage_summaries_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -128,7 +130,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupManagementUsageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -149,7 +151,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -165,7 +166,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_workload_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_workload_items_operations.py
index a3f4dc9a9a74..6d5a7ad0755c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_workload_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_workload_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -50,7 +52,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -140,7 +142,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkloadItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -163,7 +165,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -179,7 +180,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backups_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backups_operations.py
index ba7db2e2db89..e4ba1fbcaa7c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backups_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backups_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +49,7 @@ def build_trigger_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -98,7 +100,7 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@overload
- def trigger( # pylint: disable=inconsistent-return-statements
+ def trigger(
self,
vault_name: str,
resource_group_name: str,
@@ -136,7 +138,7 @@ def trigger( # pylint: disable=inconsistent-return-statements
"""
@overload
- def trigger( # pylint: disable=inconsistent-return-statements
+ def trigger(
self,
vault_name: str,
resource_group_name: str,
@@ -207,7 +209,7 @@ def trigger( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -244,7 +246,6 @@ def trigger( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_bms_prepare_data_move_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_bms_prepare_data_move_operation_result_operations.py
index 4810cef7e426..dcaf361c3827 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_bms_prepare_data_move_operation_result_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_bms_prepare_data_move_operation_result_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +106,7 @@ def get(
or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -127,7 +129,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -144,7 +145,9 @@ def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("VaultStorageConfigOperationResultResponse", pipeline_response)
+ deserialized = self._deserialize(
+ "VaultStorageConfigOperationResultResponse", pipeline_response.http_response
+ )
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_deleted_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_deleted_protection_containers_operations.py
index 90ec88821a6a..629f5e398431 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_deleted_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_deleted_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -42,7 +44,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -113,7 +115,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectionContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -133,7 +135,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -149,7 +150,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_export_jobs_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_export_jobs_operation_results_operations.py
index 8cb9ad9809d3..c247f28b67ca 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_export_jobs_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_export_jobs_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -105,7 +107,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationResultInfoBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -128,7 +130,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -142,11 +143,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response)
-
- if response.status_code == 202:
- deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response)
+ deserialized = self._deserialize("OperationResultInfoBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_feature_support_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_feature_support_operations.py
index df213878578f..a51d72c8e956 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_feature_support_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_feature_support_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_validate_request(azure_region: str, subscription_id: str, **kwargs: An
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -151,7 +153,7 @@ def validate(
~azure.mgmt.recoveryservicesbackup.activestamp.models.AzureVMResourceFeatureSupportResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -184,7 +186,6 @@ def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -198,7 +199,7 @@ def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AzureVMResourceFeatureSupportResponse", pipeline_response)
+ deserialized = self._deserialize("AzureVMResourceFeatureSupportResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_fetch_tiering_cost_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_fetch_tiering_cost_operations.py
index c9cb1c5cf751..ed0c4e2a5d68 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_fetch_tiering_cost_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_fetch_tiering_cost_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +45,7 @@ def build_post_request(resource_group_name: str, vault_name: str, subscription_i
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -96,8 +100,8 @@ def _post_initial(
vault_name: str,
parameters: Union[_models.FetchTieringCostInfoRequest, IO[bytes]],
**kwargs: Any
- ) -> Optional[_models.TieringCostInfo]:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -110,7 +114,7 @@ def _post_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[Optional[_models.TieringCostInfo]] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -131,10 +135,10 @@ def _post_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -142,17 +146,19 @@ def _post_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = None
response_headers = {}
- if response.status_code == 200:
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
-
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -269,10 +275,11 @@ def begin_post(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
+ deserialized = self._deserialize("TieringCostInfo", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_get_tiering_cost_operation_result_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_get_tiering_cost_operation_result_operations.py
index 07762149a561..88a442894851 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_get_tiering_cost_operation_result_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_get_tiering_cost_operation_result_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +106,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TieringCostInfo
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -127,7 +129,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -141,7 +142,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("TieringCostInfo", pipeline_response)
+ deserialized = self._deserialize("TieringCostInfo", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_item_level_recovery_connections_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_item_level_recovery_connections_operations.py
index 85afb8cdb6eb..dcf33a7af291 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_item_level_recovery_connections_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_item_level_recovery_connections_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_provision_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -93,7 +95,7 @@ def build_revoke_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -142,7 +144,7 @@ def __init__(self, *args, **kwargs):
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@overload
- def provision( # pylint: disable=inconsistent-return-statements
+ def provision(
self,
vault_name: str,
resource_group_name: str,
@@ -188,7 +190,7 @@ def provision( # pylint: disable=inconsistent-return-statements
"""
@overload
- def provision( # pylint: disable=inconsistent-return-statements
+ def provision(
self,
vault_name: str,
resource_group_name: str,
@@ -275,7 +277,7 @@ def provision( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -313,7 +315,6 @@ def provision( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -365,7 +366,7 @@ def revoke( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -391,7 +392,6 @@ def revoke( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_cancellations_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_cancellations_operations.py
index ab0a45d18b10..31a6ecef1c22 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_cancellations_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_cancellations_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_trigger_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -103,7 +105,7 @@ def trigger( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -126,7 +128,6 @@ def trigger( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_details_operations.py
index 0f929846240a..b76966b3a837 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_details_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_details_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -100,7 +102,7 @@ def get(self, vault_name: str, resource_group_name: str, job_name: str, **kwargs
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.JobResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -123,7 +125,6 @@ def get(self, vault_name: str, resource_group_name: str, job_name: str, **kwargs
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -137,7 +138,7 @@ def get(self, vault_name: str, resource_group_name: str, job_name: str, **kwargs
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("JobResource", pipeline_response)
+ deserialized = self._deserialize("JobResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_operation_results_operations.py
index f1c2f35a0569..bda002661ce1 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_job_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +108,7 @@ def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -130,7 +132,6 @@ def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_jobs_operations.py
index ffa3b532e8e6..18768b09638c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_export_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -103,7 +105,7 @@ def export( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -126,7 +128,6 @@ def export( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operation_operations.py
index 927bfaa04ebf..7345c264fe50 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operation_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operation_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +43,7 @@ def build_validate_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -167,7 +169,7 @@ def validate(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ValidateOperationsResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -201,7 +203,6 @@ def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -215,7 +216,7 @@ def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response)
+ deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operations.py
index 2f3b18ea399c..8ef5e1340d17 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -76,6 +78,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.ClientDiscoveryValueForSingleApi"]:
+ # pylint: disable=line-too-long
"""Returns the list of available operations.
:return: An iterator like instance of either ClientDiscoveryValueForSingleApi or the result of
@@ -90,7 +93,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ClientDiscoveryValueForSingle
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ClientDiscoveryResponse] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -106,7 +109,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -122,7 +124,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_connection_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_connection_operations.py
index daa9309a0568..58c7c0f4513b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_connection_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_connection_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +51,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -85,7 +89,7 @@ def build_put_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -126,7 +130,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -190,7 +194,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.PrivateEndpointConnectionResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -213,7 +217,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -228,7 +231,7 @@ def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -242,8 +245,8 @@ def _put_initial(
private_endpoint_connection_name: str,
parameters: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
- ) -> _models.PrivateEndpointConnectionResource:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -256,7 +259,7 @@ def _put_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -278,10 +281,10 @@ def _put_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -289,14 +292,14 @@ def _put_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- if response.status_code == 200:
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
-
- if response.status_code == 201:
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -314,6 +317,7 @@ def begin_put(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -347,6 +351,7 @@ def begin_put(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -377,6 +382,7 @@ def begin_put(
parameters: Union[_models.PrivateEndpointConnectionResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.PrivateEndpointConnectionResource]:
+ # pylint: disable=line-too-long
"""Approve or Reject Private Endpoint requests. This call is made by Backup Admin.
:param vault_name: The name of the recovery services vault. Required.
@@ -419,10 +425,11 @@ def begin_put(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response)
+ deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
@@ -444,10 +451,10 @@ def get_long_running_output(pipeline_response):
self._client, raw_result, get_long_running_output, polling_method # type: ignore
)
- def _delete_initial( # pylint: disable=inconsistent-return-statements
+ def _delete_initial(
self, vault_name: str, resource_group_name: str, private_endpoint_connection_name: str, **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -459,7 +466,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
vault_name=vault_name,
@@ -470,10 +477,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -481,11 +488,19 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace
def begin_delete(
@@ -513,7 +528,7 @@ def begin_delete(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._delete_initial( # type: ignore
+ raw_result = self._delete_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
private_endpoint_connection_name=private_endpoint_connection_name,
@@ -523,6 +538,7 @@ def begin_delete(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_operations.py
index 6a8a7f8566e3..bcba6d5e514b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_private_endpoint_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -45,7 +47,7 @@ def build_get_operation_status_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -119,7 +121,7 @@ def get_operation_status(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -143,7 +145,6 @@ def get_operation_status(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -158,7 +159,7 @@ def get_operation_status(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protectable_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protectable_containers_operations.py
index 93a6e870e2de..3fc28f9dcbde 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protectable_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protectable_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +50,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -99,6 +101,7 @@ def __init__(self, *args, **kwargs):
def list(
self, vault_name: str, resource_group_name: str, fabric_name: str, filter: Optional[str] = None, **kwargs: Any
) -> Iterable["_models.ProtectableContainerResource"]:
+ # pylint: disable=line-too-long
"""Lists the containers that can be registered to Recovery Services Vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -122,7 +125,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectableContainerResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -143,7 +146,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -159,7 +161,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_results_operations.py
index 517d26429386..616b3db708ad 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +49,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -126,7 +128,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -152,7 +154,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -168,7 +169,7 @@ def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_statuses_operations.py
index 9e622bbd83e8..fc079ccd4025 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_item_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -47,7 +49,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -130,7 +132,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -156,7 +158,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -170,7 +171,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_items_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_items_operations.py
index 9fef0bf4c059..5a9aa0394a3a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_items_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protected_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -49,7 +51,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -93,7 +95,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -140,7 +142,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -219,7 +221,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -245,7 +247,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -259,7 +260,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -388,7 +389,7 @@ def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectedItemResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -426,7 +427,6 @@ def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -442,7 +442,7 @@ def create_or_update(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectedItemResource", pipeline_response)
+ deserialized = self._deserialize("ProtectedItemResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -478,7 +478,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -503,7 +503,6 @@ def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py
index 4cfad234d35b..e7a0f1b7f933 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +48,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -122,7 +124,7 @@ def get(
None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -147,7 +149,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -163,7 +164,7 @@ def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_refresh_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_refresh_operation_results_operations.py
index 535ad26414a1..0b0e8267bdac 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_refresh_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_container_refresh_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +108,7 @@ def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -130,7 +132,6 @@ def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_containers_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_containers_operations.py
index 889258ba88db..d4b56c4b1074 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_containers_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_containers_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -48,7 +52,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -86,7 +90,7 @@ def build_register_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -127,7 +131,7 @@ def build_unregister_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -167,7 +171,7 @@ def build_inquire_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -208,7 +212,7 @@ def build_refresh_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -274,7 +278,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionContainerResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -298,7 +302,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -312,7 +315,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -327,8 +330,8 @@ def _register_initial(
container_name: str,
parameters: Union[_models.ProtectionContainerResource, IO[bytes]],
**kwargs: Any
- ) -> Optional[_models.ProtectionContainerResource]:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -341,7 +344,7 @@ def _register_initial(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[Optional[_models.ProtectionContainerResource]] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -364,10 +367,10 @@ def _register_initial(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -375,12 +378,14 @@ def _register_initial(
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = None
- if response.status_code == 200:
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -399,6 +404,7 @@ def begin_register(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -438,6 +444,7 @@ def begin_register(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -474,6 +481,7 @@ def begin_register(
parameters: Union[_models.ProtectionContainerResource, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ProtectionContainerResource]:
+ # pylint: disable=line-too-long
"""Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use location header to call
get latest status of
@@ -521,10 +529,11 @@ def begin_register(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response):
- deserialized = self._deserialize("ProtectionContainerResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionContainerResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized
@@ -569,7 +578,7 @@ def unregister( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -593,7 +602,6 @@ def unregister( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -640,7 +648,7 @@ def inquire( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -665,7 +673,6 @@ def inquire( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -704,7 +711,7 @@ def refresh( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -728,7 +735,6 @@ def refresh( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py
index 206f0a98fff3..b462068dad20 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_intent_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -39,7 +41,7 @@ def build_validate_request(azure_region: str, subscription_id: str, **kwargs: An
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -77,7 +79,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -115,7 +117,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -155,7 +157,7 @@ def build_delete_request(
) -> HttpRequest:
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
# Construct URL
_url = kwargs.pop(
"template_url",
@@ -291,7 +293,7 @@ def validate(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.PreValidateEnableBackupResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -324,7 +326,6 @@ def validate(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -338,7 +339,7 @@ def validate(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("PreValidateEnableBackupResponse", pipeline_response)
+ deserialized = self._deserialize("PreValidateEnableBackupResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -366,7 +367,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionIntentResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -390,7 +391,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -404,7 +404,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionIntentResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionIntentResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -507,7 +507,7 @@ def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionIntentResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -543,7 +543,6 @@ def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -557,7 +556,7 @@ def create_or_update(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionIntentResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionIntentResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -583,7 +582,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -607,7 +606,6 @@ def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policies_operations.py
index 040b1df45c96..e8090fc93956 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +47,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -81,7 +85,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -120,7 +124,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -184,7 +188,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -207,7 +211,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -221,7 +224,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -330,7 +333,7 @@ def create_or_update(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -366,7 +369,6 @@ def create_or_update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -382,17 +384,17 @@ def create_or_update(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- def _delete_initial( # pylint: disable=inconsistent-return-statements
+ def _delete_initial(
self, vault_name: str, resource_group_name: str, policy_name: str, **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +406,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
_request = build_delete_request(
vault_name=vault_name,
@@ -415,10 +417,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -426,11 +428,19 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@distributed_trace
def begin_delete(
@@ -460,7 +470,7 @@ def begin_delete(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._delete_initial( # type: ignore
+ raw_result = self._delete_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
policy_name=policy_name,
@@ -470,6 +480,7 @@ def begin_delete(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_results_operations.py
index 749e560d652d..4cf8dc5a2446 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -106,7 +108,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ProtectionPolicyResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -130,7 +132,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -144,7 +145,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response)
+ deserialized = self._deserialize("ProtectionPolicyResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_statuses_operations.py
index 24f85cc9799f..e38a69fbfdd7 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_protection_policy_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -110,7 +112,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -134,7 +136,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -148,7 +149,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_operations.py
index 4dc98569c676..07942fffbdc8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -50,7 +52,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -93,7 +95,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -179,7 +181,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -202,7 +204,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -218,7 +219,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -281,7 +281,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.RecoveryPointResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,7 +307,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -321,7 +320,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecoveryPointResource", pipeline_response)
+ deserialized = self._deserialize("RecoveryPointResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_recommended_for_move_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_recommended_for_move_operations.py
index f3687b3e6ed2..4f5eb3f627d8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_recommended_for_move_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_points_recommended_for_move_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,16 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -49,7 +51,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -218,7 +220,7 @@ def list(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -250,7 +252,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -266,7 +267,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_services_backup_client_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_services_backup_client_operations.py
index 25f497783d64..1238776f244b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_services_backup_client_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_recovery_services_backup_client_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,12 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+from .._vendor import RecoveryServicesBackupClientMixinABC
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +48,7 @@ def build_get_operation_status_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -75,7 +80,7 @@ def build_bms_prepare_data_move_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -109,7 +114,7 @@ def build_bms_trigger_data_move_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -150,7 +155,7 @@ def build_move_recovery_point_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -185,6 +190,7 @@ def build_move_recovery_point_request(
class RecoveryServicesBackupClientOperationsMixin( # pylint: disable=name-too-long
RecoveryServicesBackupClientMixinABC
):
+
@distributed_trace
def get_operation_status(
self, vault_name: str, resource_group_name: str, operation_id: str, **kwargs: Any
@@ -202,7 +208,7 @@ def get_operation_status(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -225,7 +231,6 @@ def get_operation_status(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -240,21 +245,21 @@ def get_operation_status(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
return deserialized # type: ignore
- def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return-statements
+ def _bms_prepare_data_move_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.PrepareDataMoveRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,7 +272,7 @@ def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return-state
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -288,10 +293,10 @@ def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return-state
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -299,12 +304,20 @@ def _bms_prepare_data_move_initial( # pylint: disable=inconsistent-return-state
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_bms_prepare_data_move(
@@ -393,7 +406,7 @@ def begin_bms_prepare_data_move(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._bms_prepare_data_move_initial( # type: ignore
+ raw_result = self._bms_prepare_data_move_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -404,6 +417,7 @@ def begin_bms_prepare_data_move(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
@@ -425,14 +439,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
- def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return-statements
+ def _bms_trigger_data_move_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.TriggerDataMoveRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -445,7 +459,7 @@ def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return-state
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -466,10 +480,10 @@ def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return-state
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -477,12 +491,20 @@ def _bms_trigger_data_move_initial( # pylint: disable=inconsistent-return-state
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_bms_trigger_data_move(
@@ -571,7 +593,7 @@ def begin_bms_trigger_data_move(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._bms_trigger_data_move_initial( # type: ignore
+ raw_result = self._bms_trigger_data_move_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -582,6 +604,7 @@ def begin_bms_trigger_data_move(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
@@ -603,7 +626,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
)
return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
- def _move_recovery_point_initial( # pylint: disable=inconsistent-return-statements
+ def _move_recovery_point_initial(
self,
vault_name: str,
resource_group_name: str,
@@ -613,8 +636,8 @@ def _move_recovery_point_initial( # pylint: disable=inconsistent-return-stateme
recovery_point_id: str,
parameters: Union[_models.MoveRPAcrossTiersRequest, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -627,7 +650,7 @@ def _move_recovery_point_initial( # pylint: disable=inconsistent-return-stateme
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -652,10 +675,10 @@ def _move_recovery_point_initial( # pylint: disable=inconsistent-return-stateme
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -663,11 +686,19 @@ def _move_recovery_point_initial( # pylint: disable=inconsistent-return-stateme
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_move_recovery_point(
@@ -799,7 +830,7 @@ def begin_move_recovery_point(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._move_recovery_point_initial( # type: ignore
+ raw_result = self._move_recovery_point_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
fabric_name=fabric_name,
@@ -814,6 +845,7 @@ def begin_move_recovery_point(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxies_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxies_operations.py
index 566aee59c897..47e2c660b54f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxies_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxies_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(vault_name: str, resource_group_name: str, subscription_id
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -88,6 +90,7 @@ def __init__(self, *args, **kwargs):
def get(
self, vault_name: str, resource_group_name: str, **kwargs: Any
) -> Iterable["_models.ResourceGuardProxyBaseResource"]:
+ # pylint: disable=line-too-long
"""List the ResourceGuardProxies under vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -107,7 +110,7 @@ def get(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ResourceGuardProxyBaseResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -126,7 +129,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -142,7 +144,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxy_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxy_operations.py
index 094ea7c810d5..fd11eb9eae82 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxy_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_resource_guard_proxy_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -41,7 +43,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -73,7 +75,7 @@ def build_put_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -108,7 +110,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -140,7 +142,7 @@ def build_unlock_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -205,7 +207,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ResourceGuardProxyBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -228,7 +230,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -242,7 +243,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response)
+ deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -340,7 +341,7 @@ def put(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.ResourceGuardProxyBaseResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -375,7 +376,6 @@ def put(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -389,7 +389,7 @@ def put(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response)
+ deserialized = self._deserialize("ResourceGuardProxyBaseResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -413,7 +413,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -436,7 +436,6 @@ def delete( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -539,7 +538,7 @@ def unlock_delete(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.UnlockDeleteResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -574,7 +573,6 @@ def unlock_delete(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -588,7 +586,7 @@ def unlock_delete(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("UnlockDeleteResponse", pipeline_response)
+ deserialized = self._deserialize("UnlockDeleteResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_restores_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_restores_operations.py
index d6dd9a3916fe..5b5b7b84274c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_restores_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_restores_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +56,7 @@ def build_trigger_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -107,7 +111,7 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ def _trigger_initial(
self,
vault_name: str,
resource_group_name: str,
@@ -118,8 +122,8 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
parameters: Union[_models.RestoreRequestResource, IO[bytes]],
x_ms_authorization_auxiliary: Optional[str] = None,
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -132,7 +136,7 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -158,10 +162,10 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -169,11 +173,19 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_trigger(
@@ -316,7 +328,7 @@ def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._trigger_initial( # type: ignore
+ raw_result = self._trigger_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
fabric_name=fabric_name,
@@ -332,6 +344,7 @@ def begin_trigger(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_security_pins_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_security_pins_operations.py
index 8f7d14949201..9d86d00a49df 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_security_pins_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_security_pins_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +48,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -183,7 +185,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.TokenInformation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -221,7 +223,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -235,7 +236,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("TokenInformation", pipeline_response)
+ deserialized = self._deserialize("TokenInformation", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_tiering_cost_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_tiering_cost_operation_status_operations.py
index 85abf747013e..e0fbf73bf5b6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_tiering_cost_operation_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_tiering_cost_operation_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +106,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -127,7 +129,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -141,7 +142,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_operations.py
index 8a51dde3ce9b..a15b9f683c0a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +47,7 @@ def build_trigger_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -90,14 +94,14 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ def _trigger_initial(
self,
vault_name: str,
resource_group_name: str,
parameters: Union[_models.ValidateOperationRequestResource, IO[bytes]],
**kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -110,7 +114,7 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -131,10 +135,10 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -142,11 +146,19 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_trigger(
@@ -240,7 +252,7 @@ def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._trigger_initial( # type: ignore
+ raw_result = self._trigger_initial(
vault_name=vault_name,
resource_group_name=resource_group_name,
parameters=parameters,
@@ -251,6 +263,7 @@ def begin_trigger(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_results_operations.py
index 54ca992353c3..8de9f96ac8f4 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +106,7 @@ def get(
None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -127,7 +129,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -143,7 +144,7 @@ def get(
deserialized = None
if response.status_code == 200:
- deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response)
+ deserialized = self._deserialize("ValidateOperationsResponse", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_statuses_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_statuses_operations.py
index bf89337ce172..b0ec56311342 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_statuses_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_validate_operation_statuses_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import RecoveryServicesBackupClientMixinABC, _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -40,7 +42,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -107,7 +109,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.activestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -130,7 +132,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -144,7 +145,7 @@ def get(
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/__init__.py
index afc47936376d..a067ea121371 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/__init__.py
@@ -5,15 +5,21 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._recovery_services_backup_passive_client import RecoveryServicesBackupPassiveClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._recovery_services_backup_passive_client import RecoveryServicesBackupPassiveClient # type: ignore
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -21,6 +27,6 @@
__all__ = [
"RecoveryServicesBackupPassiveClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_configuration.py
index 92abb37b5d09..0f88a14190a5 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_configuration.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_recovery_services_backup_passive_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_recovery_services_backup_passive_client.py
index 92c227931469..047afd817175 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_recovery_services_backup_passive_client.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_recovery_services_backup_passive_client.py
@@ -8,6 +8,7 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
+from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
@@ -32,11 +33,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class RecoveryServicesBackupPassiveClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class RecoveryServicesBackupPassiveClient: # pylint: disable=too-many-instance-attributes
"""Open API 2.0 Specs for Azure RecoveryServices Backup service.
:ivar backup_usage_summaries_crr: BackupUsageSummariesCRROperations operations
@@ -172,7 +172,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()
- def __enter__(self) -> "RecoveryServicesBackupPassiveClient":
+ def __enter__(self) -> Self:
self._client.__enter__()
return self
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_serialization.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_serialization.py
index 2f781d740827..b24ab2885450 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_serialization.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_serialization.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +52,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
:param data: Input, could be bytes or stream (will be decoded with UTF8) or text
:type data: str or bytes or IO
:param str content_type: The content type.
+ :return: The deserialized data.
+ :rtype: object
"""
if hasattr(data, "read"):
# Assume a stream
@@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
try:
return json.loads(data_as_str)
except ValueError as err:
- raise DeserializationError("JSON is invalid: {}".format(err), err)
+ raise DeserializationError("JSON is invalid: {}".format(err), err) from err
elif "xml" in (content_type or []):
try:
@@ -144,6 +145,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
+ elif content_type.startswith("text/"):
+ return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
@classmethod
@@ -153,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -182,15 +190,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -204,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -233,24 +256,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -298,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None:
setattr(self, k, kwargs[k])
def __eq__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are equal
+ :rtype: bool
+ """
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
def __ne__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are not equal
+ :rtype: bool
+ """
return not self.__eq__(other)
def __str__(self) -> str:
@@ -324,7 +366,11 @@ def is_xml_model(cls) -> bool:
@classmethod
def _create_xml_node(cls):
- """Create XML node."""
+ """Create XML node.
+
+ :returns: The XML node
+ :rtype: xml.etree.ElementTree.Element
+ """
try:
xml_map = cls._xml_map # type: ignore
except AttributeError:
@@ -344,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, keep_readonly=keep_readonly, **kwargs
+ )
def as_dict(
self,
@@ -378,12 +426,15 @@ def my_key_transformer(key, attr_desc, value):
If you want XML serialization, you can pass the kwargs is_xml=True.
+ :param bool keep_readonly: If you want to serialize the readonly attributes
:param function key_transformer: A key transformer function.
:returns: A dict JSON compatible object
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs
+ )
@classmethod
def _infer_class_models(cls):
@@ -393,7 +444,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -406,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -424,9 +476,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -446,21 +500,25 @@ def _flatten_subtype(cls, key, objects):
return {}
result = dict(cls._subtype_map[key])
for valuetype in cls._subtype_map[key].values():
- result.update(objects[valuetype]._flatten_subtype(key, objects))
+ result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
return result
@classmethod
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
- Remove the polymorphic key from the initial data.
+
+ :param dict response: The initial data
+ :param dict objects: The class objects
+ :returns: The class to be used
+ :rtype: class
"""
for subtype_key in cls.__dict__.get("_subtype_map", {}).keys():
subtype_value = None
if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
if subtype_value:
@@ -499,11 +557,13 @@ def _decode_attribute_map_key(key):
inside the received data.
:param str key: A key string from the generated code
+ :returns: The decoded key
+ :rtype: str
"""
return key.replace("\\.", ".")
-class Serializer(object):
+class Serializer: # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -538,7 +598,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -558,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -590,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
serialized = {}
if is_xml_model_serialization:
- serialized = target_obj._create_xml_node()
+ serialized = target_obj._create_xml_node() # pylint: disable=protected-access
try:
- attributes = target_obj._attribute_map
+ attributes = target_obj._attribute_map # pylint: disable=protected-access
for attr, attr_desc in attributes.items():
attr_name = attr
- if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False):
+ if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access
+ attr_name, {}
+ ).get("readonly", False):
continue
if attr_name == "additional_properties" and attr_desc["key"] == "":
@@ -631,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if isinstance(new_attr, list):
serialized.extend(new_attr) # type: ignore
elif isinstance(new_attr, ET.Element):
- # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces.
+ # If the down XML has no XML/Name,
+ # we MUST replace the tag with the local tag. But keeping the namespaces.
if "name" not in getattr(orig_attr, "_xml_map", {}):
splitted_tag = new_attr.tag.split("}")
if len(splitted_tag) == 2: # Namespace
@@ -662,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -701,7 +767,7 @@ def body(self, data, data_type, **kwargs):
attribute_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
]
- data = deserializer._deserialize(data_type, data)
+ data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access
except DeserializationError as err:
raise SerializationError("Unable to build a model: " + str(err)) from err
@@ -710,9 +776,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -726,21 +794,20 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
@@ -757,19 +824,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -778,21 +846,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -803,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs):
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
- elif data_type in self.serialize_type:
+ if data_type in self.serialize_type:
return self.serialize_type[data_type](data, **kwargs)
# If dependencies is empty, try with current data class
@@ -819,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
raise SerializationError(msg.format(data, data_type)) from err
- else:
- return self._serialize(data, **kwargs)
+ return self._serialize(data, **kwargs)
@classmethod
- def _get_custom_serializers(cls, data_type, **kwargs):
+ def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements
custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type)
if custom_serializer:
return custom_serializer
@@ -839,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs):
- basic_types_serializers dict[str, callable] : If set, use the callable as serializer
- is_xml bool : If set, use xml_basic_types_serializers
- :param data: Object to be serialized.
+ :param obj data: Object to be serialized.
:param str data_type: Type of object in the iterable.
+ :rtype: str, int, float, bool
+ :return: serialized object
"""
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
if custom_serializer:
return custom_serializer(data)
if data_type == "str":
return cls.serialize_unicode(data)
- return eval(data_type)(data) # nosec
+ return eval(data_type)(data) # nosec # pylint: disable=eval-used
@classmethod
def serialize_unicode(cls, data):
"""Special handling for serializing unicode strings in Py2.
Encode to UTF-8 if unicode, otherwise handle as a str.
- :param data: Object to be serialized.
+ :param str data: Object to be serialized.
:rtype: str
+ :return: serialized object
"""
try: # If I received an enum, return its value
return data.value
@@ -869,8 +938,7 @@ def serialize_unicode(cls, data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
def serialize_iter(self, data, iter_type, div=None, **kwargs):
"""Serialize iterable.
@@ -880,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
serialization_ctxt['type'] should be same as data_type.
- is_xml bool : If set, serialize as XML
- :param list attr: Object to be serialized.
+ :param list data: Object to be serialized.
:param str iter_type: Type of object in the iterable.
- :param bool required: Whether the objects in the iterable must
- not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
- :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
+ :return: serialized iterable
"""
if isinstance(data, str):
raise SerializationError("Refuse str type as a valid iter type.")
@@ -943,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs):
:param dict attr: Object to be serialized.
:param str dict_type: Type of object in the dictionary.
- :param bool required: Whether the objects in the dictionary must
- not be None or empty.
:rtype: dict
+ :return: serialized dictionary
"""
serialization_ctxt = kwargs.get("serialization_ctxt", {})
serialized = {}
@@ -969,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs):
return serialized
- def serialize_object(self, attr, **kwargs):
+ def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
@@ -977,6 +1042,7 @@ def serialize_object(self, attr, **kwargs):
:param dict attr: Object to be serialized.
:rtype: dict or str
+ :return: serialized object
"""
if attr is None:
return None
@@ -1001,7 +1067,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_decimal(attr)
# If it's a model or I know this dependency, serialize as a Model
- elif obj_type in self.dependencies.values() or isinstance(attr, Model):
+ if obj_type in self.dependencies.values() or isinstance(attr, Model):
return self._serialize(attr)
if obj_type == dict:
@@ -1032,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None):
try:
enum_obj(result) # type: ignore
return result
- except ValueError:
+ except ValueError as exc:
for enum_value in enum_obj: # type: ignore
if enum_value.value.lower() == str(attr).lower():
return enum_value.value
error = "{!r} is not valid value for enum {!r}"
- raise SerializationError(error.format(attr, enum_obj))
+ raise SerializationError(error.format(attr, enum_obj)) from exc
@staticmethod
- def serialize_bytearray(attr, **kwargs):
+ def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize bytearray into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
return b64encode(attr).decode()
@staticmethod
- def serialize_base64(attr, **kwargs):
+ def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize str into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
encoded = b64encode(attr).decode("ascii")
return encoded.strip("=").replace("+", "-").replace("/", "_")
@staticmethod
- def serialize_decimal(attr, **kwargs):
+ def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Decimal object to float.
- :param attr: Object to be serialized.
+ :param decimal attr: Object to be serialized.
:rtype: float
+ :return: serialized decimal
"""
return float(attr)
@staticmethod
- def serialize_long(attr, **kwargs):
+ def serialize_long(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize long (Py2) or int (Py3).
- :param attr: Object to be serialized.
+ :param int attr: Object to be serialized.
:rtype: int/long
+ :return: serialized long
"""
return _long_type(attr)
@staticmethod
- def serialize_date(attr, **kwargs):
+ def serialize_date(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Date object into ISO-8601 formatted string.
:param Date attr: Object to be serialized.
:rtype: str
+ :return: serialized date
"""
if isinstance(attr, str):
attr = isodate.parse_date(attr)
@@ -1089,11 +1160,12 @@ def serialize_date(attr, **kwargs):
return t
@staticmethod
- def serialize_time(attr, **kwargs):
+ def serialize_time(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Time object into ISO-8601 formatted string.
:param datetime.time attr: Object to be serialized.
:rtype: str
+ :return: serialized time
"""
if isinstance(attr, str):
attr = isodate.parse_time(attr)
@@ -1103,30 +1175,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1139,12 +1213,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1170,13 +1245,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1184,11 +1260,11 @@ def serialize_unix(attr, **kwargs):
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
return int(calendar.timegm(attr.utctimetuple()))
- except AttributeError:
- raise TypeError("Unix time object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("Unix time object must be valid Datetime object.") from exc
-def rest_key_extractor(attr, attr_desc, data):
+def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
key = attr_desc["key"]
working_data = data
@@ -1209,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data):
return working_data.get(key)
-def rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements
+ attr, attr_desc, data
+):
key = attr_desc["key"]
working_data = data
@@ -1230,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
return attribute_key_case_insensitive_extractor(key, None, working_data)
-def last_rest_key_extractor(attr, attr_desc, data):
- """Extract the attribute in "data" based on the last part of the JSON path key."""
+def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
+ """Extract the attribute in "data" based on the last part of the JSON path key.
+
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
+ """
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
return attribute_key_extractor(dict_keys[-1], None, data)
-def last_rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
"""Extract the attribute in "data" based on the last part of the JSON path key.
This is the case insensitive version of "last_rest_key_extractor"
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
"""
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
@@ -1277,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type):
return xml_name
-def xml_key_extractor(attr, attr_desc, data):
+def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements
if isinstance(data, dict):
return None
@@ -1329,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1352,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data):
return children[0]
-class Deserializer(object):
+class Deserializer:
"""Response object model deserializer.
:param dict classes: Class type dictionary for deserializing complex types.
@@ -1361,9 +1450,9 @@ class Deserializer(object):
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
- valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
+ valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1401,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1414,12 +1504,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1438,13 +1529,13 @@ def _deserialize(self, target_obj, data):
if isinstance(response, str):
return self.deserialize_data(data, response)
- elif isinstance(response, type) and issubclass(response, Enum):
+ if isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
- if data is None:
+ if data is None or data is CoreNull:
return data
try:
- attributes = response._attribute_map # type: ignore
+ attributes = response._attribute_map # type: ignore # pylint: disable=protected-access
d_attrs = {}
for attr, attr_desc in attributes.items():
# Check empty string. If it's not empty, someone has a real "additionalProperties"...
@@ -1474,9 +1565,8 @@ def _deserialize(self, target_obj, data):
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
raise DeserializationError(msg) from err
- else:
- additional_properties = self._build_additional_properties(attributes, data)
- return self._instantiate_model(response, d_attrs, additional_properties)
+ additional_properties = self._build_additional_properties(attributes, data)
+ return self._instantiate_model(response, d_attrs, additional_properties)
def _build_additional_properties(self, attribute_map, data):
if not self.additional_properties_detection:
@@ -1503,6 +1593,8 @@ def _classify_target(self, target, data):
:param str target: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
+ :return: The classified target object and its class name.
+ :rtype: tuple
"""
if target is None:
return None, None
@@ -1514,7 +1606,7 @@ def _classify_target(self, target, data):
return target, target
try:
- target = target._classify(data, self.dependencies) # type: ignore
+ target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access
except AttributeError:
pass # Target is not a Model, no classify
return target, target.__class__.__name__ # type: ignore
@@ -1529,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
:param str target_obj: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
:param str content_type: Swagger "produces" if available.
+ :return: Deserialized object.
+ :rtype: object
"""
try:
return self(target_obj, data, content_type=content_type)
- except:
+ except: # pylint: disable=bare-except
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
@@ -1550,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None):
If raw_data is something else, bypass all logic and return it directly.
- :param raw_data: Data to be processed.
- :param content_type: How to parse if raw_data is a string/bytes.
+ :param obj raw_data: Data to be processed.
+ :param str content_type: How to parse if raw_data is a string/bytes.
:raises JSONDecodeError: If JSON is requested and parsing is impossible.
:raises UnicodeDecodeError: If bytes is not UTF8
+ :rtype: object
+ :return: Unpacked content.
"""
# Assume this is enough to detect a Pipeline Response without importing it
context = getattr(raw_data, "context", {})
@@ -1577,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None):
def _instantiate_model(self, response, attrs, additional_properties=None):
"""Instantiate a response model passing in deserialized args.
- :param response: The response model class.
- :param d_attrs: The deserialized response attributes.
+ :param Response response: The response model class.
+ :param dict attrs: The deserialized response attributes.
+ :param dict additional_properties: Additional properties to be set.
+ :rtype: Response
+ :return: The instantiated response model.
"""
if callable(response):
subtype = getattr(response, "_subtype_map", {})
try:
- readonly = [k for k, v in response._validation.items() if v.get("readonly")]
- const = [k for k, v in response._validation.items() if v.get("constant")]
+ readonly = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("readonly")
+ ]
+ const = [
+ k
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
+ if v.get("constant")
+ ]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
setattr(response_obj, attr, attrs.get(attr))
if additional_properties:
- response_obj.additional_properties = additional_properties
+ response_obj.additional_properties = additional_properties # type: ignore
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
- raise DeserializationError(msg + str(err))
+ raise DeserializationError(msg + str(err)) from err
else:
try:
for attr, value in attrs.items():
@@ -1603,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1625,7 +1733,11 @@ def deserialize_data(self, data, data_type):
if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())):
return data
- is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"]
+ is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment
+ "object",
+ "[]",
+ r"{}",
+ ]
if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text:
return None
data_val = self.deserialize_type[data_type](data)
@@ -1645,14 +1757,14 @@ def deserialize_data(self, data, data_type):
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
raise DeserializationError(msg) from err
- else:
- return self._deserialize(obj_type, data)
+ return self._deserialize(obj_type, data)
def deserialize_iter(self, attr, iter_type):
"""Deserialize an iterable.
:param list attr: Iterable to be deserialized.
:param str iter_type: The type of object in the iterable.
+ :return: Deserialized iterable.
:rtype: list
"""
if attr is None:
@@ -1669,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type):
:param dict/list attr: Dictionary to be deserialized. Also accepts
a list of key, value pairs.
:param str dict_type: The object type of the items in the dictionary.
+ :return: Deserialized dictionary.
:rtype: dict
"""
if isinstance(attr, list):
@@ -1679,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1718,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs):
pass
return deserialized
- else:
- error = "Cannot deserialize generic object with type: "
- raise TypeError(error + str(obj_type))
+ error = "Cannot deserialize generic object with type: "
+ raise TypeError(error + str(obj_type))
- def deserialize_basic(self, attr, data_type):
+ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements
"""Deserialize basic builtin data type from string.
Will attempt to convert to str, int, float and bool.
This function will also accept '1', '0', 'true' and 'false' as
@@ -1730,6 +1843,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1741,24 +1855,23 @@ def deserialize_basic(self, attr, data_type):
if data_type == "str":
# None or '', node is empty string.
return ""
- else:
- # None or '', node with a strong type is None.
- # Don't try to model "empty bool" or "empty int"
- return None
+ # None or '', node with a strong type is None.
+ # Don't try to model "empty bool" or "empty int"
+ return None
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, str):
+ if isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
- elif attr.lower() in ["false", "0"]:
+ if attr.lower() in ["false", "0"]:
return False
raise TypeError("Invalid boolean value: {}".format(attr))
if data_type == "str":
return self.deserialize_unicode(attr)
- return eval(data_type)(attr) # nosec
+ return eval(data_type)(attr) # nosec # pylint: disable=eval-used
@staticmethod
def deserialize_unicode(data):
@@ -1766,6 +1879,7 @@ def deserialize_unicode(data):
as a string.
:param str data: response string to be deserialized.
+ :return: Deserialized string.
:rtype: str or unicode
"""
# We might be here because we have an enum modeled as string,
@@ -1779,8 +1893,7 @@ def deserialize_unicode(data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
@staticmethod
def deserialize_enum(data, enum_obj):
@@ -1792,6 +1905,7 @@ def deserialize_enum(data, enum_obj):
:param str data: Response string to be deserialized. If this value is
None or invalid it will be returned as-is.
:param Enum enum_obj: Enum object to deserialize to.
+ :return: Deserialized enum object.
:rtype: Enum
"""
if isinstance(data, enum_obj) or data is None:
@@ -1802,9 +1916,9 @@ def deserialize_enum(data, enum_obj):
# Workaround. We might consider remove it in the future.
try:
return list(enum_obj.__members__.values())[data]
- except IndexError:
+ except IndexError as exc:
error = "{!r} is not a valid index for enum {!r}"
- raise DeserializationError(error.format(data, enum_obj))
+ raise DeserializationError(error.format(data, enum_obj)) from exc
try:
return enum_obj(str(data))
except ValueError:
@@ -1820,6 +1934,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1832,6 +1947,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1847,8 +1963,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1863,6 +1980,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1875,6 +1993,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1885,14 +2004,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1908,6 +2027,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1922,6 +2042,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1937,14 +2058,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1974,8 +2095,7 @@ def deserialize_iso(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_unix(attr):
@@ -1983,6 +2103,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -1994,5 +2115,4 @@ def deserialize_unix(attr):
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_vendor.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_vendor.py
deleted file mode 100644
index 0dafe0e287ff..000000000000
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_vendor.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# --------------------------------------------------------------------------
-# 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
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_version.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_version.py
index f89ed38360ab..6b357123854d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_version.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "9.1.0"
+VERSION = "9.2.0"
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/__init__.py
index 839d85e2e381..2f2a87dfd665 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/__init__.py
@@ -5,12 +5,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._recovery_services_backup_passive_client import RecoveryServicesBackupPassiveClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._recovery_services_backup_passive_client import RecoveryServicesBackupPassiveClient # type: ignore
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@
__all__ = [
"RecoveryServicesBackupPassiveClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_configuration.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_configuration.py
index bbe77c7e23cf..d6909da32366 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_configuration.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_recovery_services_backup_passive_client.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_recovery_services_backup_passive_client.py
index c0247092c44e..9791fde57f88 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_recovery_services_backup_passive_client.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/_recovery_services_backup_passive_client.py
@@ -8,6 +8,7 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
+from typing_extensions import Self
from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
@@ -32,11 +33,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class RecoveryServicesBackupPassiveClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class RecoveryServicesBackupPassiveClient: # pylint: disable=too-many-instance-attributes
"""Open API 2.0 Specs for Azure RecoveryServices Backup service.
:ivar backup_usage_summaries_crr: BackupUsageSummariesCRROperations operations
@@ -174,7 +174,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()
- async def __aenter__(self) -> "RecoveryServicesBackupPassiveClient":
+ async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/__init__.py
index 2fc83cfb6d5a..62c2cdf28182 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/__init__.py
@@ -5,21 +5,27 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._backup_usage_summaries_crr_operations import BackupUsageSummariesCRROperations
-from ._aad_properties_operations import AadPropertiesOperations
-from ._cross_region_restore_operations import CrossRegionRestoreOperations
-from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations
-from ._backup_crr_jobs_operations import BackupCrrJobsOperations
-from ._crr_operation_results_operations import CrrOperationResultsOperations
-from ._crr_operation_status_operations import CrrOperationStatusOperations
-from ._recovery_points_operations import RecoveryPointsOperations
-from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations
-from ._recovery_points_crr_operations import RecoveryPointsCrrOperations
-from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._backup_usage_summaries_crr_operations import BackupUsageSummariesCRROperations # type: ignore
+from ._aad_properties_operations import AadPropertiesOperations # type: ignore
+from ._cross_region_restore_operations import CrossRegionRestoreOperations # type: ignore
+from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations # type: ignore
+from ._backup_crr_jobs_operations import BackupCrrJobsOperations # type: ignore
+from ._crr_operation_results_operations import CrrOperationResultsOperations # type: ignore
+from ._crr_operation_status_operations import CrrOperationStatusOperations # type: ignore
+from ._recovery_points_operations import RecoveryPointsOperations # type: ignore
+from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations # type: ignore
+from ._recovery_points_crr_operations import RecoveryPointsCrrOperations # type: ignore
+from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -35,5 +41,5 @@
"RecoveryPointsCrrOperations",
"BackupProtectedItemsCrrOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_aad_properties_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_aad_properties_operations.py
index 3aaef7bf2c9d..9183dd60e1cd 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_aad_properties_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_aad_properties_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._aad_properties_operations import build_get_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -66,7 +68,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.AADPropertiesResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -88,7 +90,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -103,7 +104,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AADPropertiesResource", pipeline_response)
+ deserialized = self._deserialize("AADPropertiesResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_job_details_operations.py
index 633048e26297..a809815315bf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_job_details_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_job_details_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_crr_job_details_operations import build_get_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -114,7 +116,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.JobResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -147,7 +149,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -162,7 +163,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("JobResource", pipeline_response)
+ deserialized = self._deserialize("JobResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_jobs_operations.py
index b354f0cb570f..78bc2b764213 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_crr_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,16 +20,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_crr_jobs_operations import build_list_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -152,7 +154,7 @@ def list(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +184,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -198,7 +199,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_protected_items_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_protected_items_crr_operations.py
index 04b703505c9d..6dfdebb9a8c9 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_protected_items_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_protected_items_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_protected_items_crr_operations import build_list_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -61,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.ProtectedItemResource"]:
+ # pylint: disable=line-too-long
"""Provides a pageable list of all items that are backed up within a vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -84,7 +87,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectedItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -105,7 +108,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -121,7 +123,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_resource_storage_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_resource_storage_configs_operations.py
index 3f6f4e28391b..30f2b9dfab84 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_resource_storage_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_resource_storage_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,20 +18,22 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_resource_storage_configs_operations import (
build_get_request,
build_patch_request,
build_update_request,
)
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -70,7 +72,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -92,7 +94,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -107,7 +108,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -193,7 +194,7 @@ async def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -227,7 +228,6 @@ async def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -242,7 +242,7 @@ async def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -250,7 +250,7 @@ async def update(
return deserialized # type: ignore
@overload
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -278,7 +278,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -305,7 +305,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def patch( # pylint: disable=inconsistent-return-statements
+ async def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -328,7 +328,7 @@ async def patch( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -362,7 +362,6 @@ async def patch( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_usage_summaries_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_usage_summaries_crr_operations.py
index dcbda00aa786..c337a32779ce 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_usage_summaries_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_backup_usage_summaries_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._backup_usage_summaries_crr_operations import build_list_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -61,6 +63,7 @@ def list(
skip_token: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.BackupManagementUsage"]:
+ # pylint: disable=line-too-long
"""Fetches the backup management usage summaries of the vault.
:param vault_name: The name of the recovery services vault. Required.
@@ -84,7 +87,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupManagementUsageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -105,7 +108,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -121,7 +123,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_cross_region_restore_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_cross_region_restore_operations.py
index 5ebb45d3ada9..5233859af7f2 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_cross_region_restore_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_cross_region_restore_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,21 +15,25 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
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._cross_region_restore_operations import build_trigger_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -53,10 +57,10 @@ def __init__(self, *args, **kwargs) -> None:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- async def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ async def _trigger_initial(
self, azure_region: str, parameters: Union[_models.CrossRegionRestoreRequest, IO[bytes]], **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -69,7 +73,7 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -89,10 +93,10 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -100,12 +104,20 @@ async def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
async def begin_trigger(
@@ -187,7 +199,7 @@ async def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = await self._trigger_initial( # type: ignore
+ raw_result = await self._trigger_initial(
azure_region=azure_region,
parameters=parameters,
api_version=api_version,
@@ -197,6 +209,7 @@ async def begin_trigger(
params=_params,
**kwargs
)
+ await raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_results_operations.py
index ab856b952bbc..456435abfe0b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._crr_operation_results_operations import build_get_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -51,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None:
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace_async
- async def get( # pylint: disable=inconsistent-return-statements
- self, azure_region: str, operation_id: str, **kwargs: Any
- ) -> None:
+ async def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> None:
"""get.
:param azure_region: Azure region to hit Api. Required.
@@ -64,7 +64,7 @@ async def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -86,7 +86,6 @@ async def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_status_operations.py
index ec37f0659c1e..712e1d4569f5 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_crr_operation_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._crr_operation_status_operations import build_get_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -62,7 +64,7 @@ async def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -84,7 +86,6 @@ async def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _mod
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -99,7 +100,7 @@ async def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _mod
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_crr_operations.py
index bd113862648f..69941100210a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
@@ -19,17 +19,19 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._recovery_points_crr_operations import build_get_request, build_list_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -64,6 +66,7 @@ def list(
filter: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.RecoveryPointResource"]:
+ # pylint: disable=line-too-long
"""Lists the backup copies for the backed up item.
:param vault_name: The name of the recovery services vault. Required.
@@ -91,7 +94,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -114,7 +117,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -130,7 +132,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -192,7 +193,7 @@ async def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.RecoveryPointResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -218,7 +219,6 @@ async def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -233,7 +233,7 @@ async def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecoveryPointResource", pipeline_response)
+ deserialized = self._deserialize("RecoveryPointResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_operations.py
index 527224916c15..0e9fa42749d1 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/aio/operations/_recovery_points_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import AsyncHttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
-from ..._vendor import _convert_request
from ...operations._recovery_points_operations import build_get_access_token_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -170,12 +172,11 @@ async def get_access_token(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.CrrAccessTokenResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
- 400: lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
@@ -209,7 +210,6 @@ async def get_access_token(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -224,7 +224,7 @@ async def get_access_token(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("CrrAccessTokenResource", pipeline_response)
+ deserialized = self._deserialize("CrrAccessTokenResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/__init__.py
index 4d165128ead5..d4b88bc19dc2 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/__init__.py
@@ -5,161 +5,172 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import AADProperties
-from ._models_py3 import AADPropertiesResource
-from ._models_py3 import AzureFileShareRecoveryPoint
-from ._models_py3 import AzureFileShareRestoreRequest
-from ._models_py3 import AzureFileshareProtectedItem
-from ._models_py3 import AzureFileshareProtectedItemExtendedInfo
-from ._models_py3 import AzureIaaSClassicComputeVMProtectedItem
-from ._models_py3 import AzureIaaSComputeVMProtectedItem
-from ._models_py3 import AzureIaaSVMErrorInfo
-from ._models_py3 import AzureIaaSVMHealthDetails
-from ._models_py3 import AzureIaaSVMJob
-from ._models_py3 import AzureIaaSVMJobExtendedInfo
-from ._models_py3 import AzureIaaSVMJobTaskDetails
-from ._models_py3 import AzureIaaSVMProtectedItem
-from ._models_py3 import AzureIaaSVMProtectedItemExtendedInfo
-from ._models_py3 import AzureSqlProtectedItem
-from ._models_py3 import AzureSqlProtectedItemExtendedInfo
-from ._models_py3 import AzureStorageErrorInfo
-from ._models_py3 import AzureStorageJob
-from ._models_py3 import AzureStorageJobExtendedInfo
-from ._models_py3 import AzureStorageJobTaskDetails
-from ._models_py3 import AzureVmWorkloadProtectedItem
-from ._models_py3 import AzureVmWorkloadProtectedItemExtendedInfo
-from ._models_py3 import AzureVmWorkloadSAPAseDatabaseProtectedItem
-from ._models_py3 import AzureVmWorkloadSAPHanaDatabaseProtectedItem
-from ._models_py3 import AzureVmWorkloadSQLDatabaseProtectedItem
-from ._models_py3 import AzureWorkloadErrorInfo
-from ._models_py3 import AzureWorkloadJob
-from ._models_py3 import AzureWorkloadJobExtendedInfo
-from ._models_py3 import AzureWorkloadJobTaskDetails
-from ._models_py3 import AzureWorkloadPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadRecoveryPoint
-from ._models_py3 import AzureWorkloadRestoreRequest
-from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadSAPHanaPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadSAPHanaRecoveryPoint
-from ._models_py3 import AzureWorkloadSAPHanaRestoreRequest
-from ._models_py3 import AzureWorkloadSQLPointInTimeRecoveryPoint
-from ._models_py3 import AzureWorkloadSQLPointInTimeRestoreRequest
-from ._models_py3 import AzureWorkloadSQLRecoveryPoint
-from ._models_py3 import AzureWorkloadSQLRecoveryPointExtendedInfo
-from ._models_py3 import AzureWorkloadSQLRestoreRequest
-from ._models_py3 import BEKDetails
-from ._models_py3 import BMSAADPropertiesQueryObject
-from ._models_py3 import BMSBackupSummariesQueryObject
-from ._models_py3 import BMSRPQueryObject
-from ._models_py3 import BackupManagementUsage
-from ._models_py3 import BackupManagementUsageList
-from ._models_py3 import BackupResourceConfig
-from ._models_py3 import BackupResourceConfigResource
-from ._models_py3 import ClientScriptForConnect
-from ._models_py3 import CrossRegionRestoreRequest
-from ._models_py3 import CrossRegionRestoreRequestResource
-from ._models_py3 import CrrAccessToken
-from ._models_py3 import CrrAccessTokenResource
-from ._models_py3 import CrrJobRequest
-from ._models_py3 import CrrJobRequestResource
-from ._models_py3 import DPMProtectedItem
-from ._models_py3 import DPMProtectedItemExtendedInfo
-from ._models_py3 import DiskExclusionProperties
-from ._models_py3 import DiskInformation
-from ._models_py3 import DpmErrorInfo
-from ._models_py3 import DpmJob
-from ._models_py3 import DpmJobExtendedInfo
-from ._models_py3 import DpmJobTaskDetails
-from ._models_py3 import EncryptionDetails
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ExtendedProperties
-from ._models_py3 import GenericProtectedItem
-from ._models_py3 import GenericRecoveryPoint
-from ._models_py3 import IaasVMRecoveryPoint
-from ._models_py3 import IaasVMRestoreRequest
-from ._models_py3 import IdentityBasedRestoreDetails
-from ._models_py3 import IdentityInfo
-from ._models_py3 import InstantItemRecoveryTarget
-from ._models_py3 import Job
-from ._models_py3 import JobQueryObject
-from ._models_py3 import JobResource
-from ._models_py3 import JobResourceList
-from ._models_py3 import KEKDetails
-from ._models_py3 import KPIResourceHealthDetails
-from ._models_py3 import KeyAndSecretDetails
-from ._models_py3 import MabErrorInfo
-from ._models_py3 import MabFileFolderProtectedItem
-from ._models_py3 import MabFileFolderProtectedItemExtendedInfo
-from ._models_py3 import MabJob
-from ._models_py3 import MabJobExtendedInfo
-from ._models_py3 import MabJobTaskDetails
-from ._models_py3 import NameInfo
-from ._models_py3 import NewErrorResponse
-from ._models_py3 import NewErrorResponseError
-from ._models_py3 import OperationStatus
-from ._models_py3 import OperationStatusError
-from ._models_py3 import OperationStatusExtendedInfo
-from ._models_py3 import OperationStatusJobExtendedInfo
-from ._models_py3 import OperationStatusJobsExtendedInfo
-from ._models_py3 import OperationStatusProvisionILRExtendedInfo
-from ._models_py3 import OperationStatusRecoveryPointExtendedInfo
-from ._models_py3 import PointInTimeRange
-from ._models_py3 import ProtectedItem
-from ._models_py3 import ProtectedItemQueryObject
-from ._models_py3 import ProtectedItemResource
-from ._models_py3 import ProtectedItemResourceList
-from ._models_py3 import RecoveryPoint
-from ._models_py3 import RecoveryPointDiskConfiguration
-from ._models_py3 import RecoveryPointMoveReadinessInfo
-from ._models_py3 import RecoveryPointResource
-from ._models_py3 import RecoveryPointResourceList
-from ._models_py3 import RecoveryPointTierInformation
-from ._models_py3 import Resource
-from ._models_py3 import ResourceHealthDetails
-from ._models_py3 import ResourceList
-from ._models_py3 import RestoreFileSpecs
-from ._models_py3 import RestoreRequest
-from ._models_py3 import SQLDataDirectory
-from ._models_py3 import SQLDataDirectoryMapping
-from ._models_py3 import TargetAFSRestoreInfo
-from ._models_py3 import TargetRestoreInfo
-from ._models_py3 import WorkloadCrrAccessToken
+from typing import TYPE_CHECKING
-from ._recovery_services_backup_passive_client_enums import BackupManagementType
-from ._recovery_services_backup_passive_client_enums import CopyOptions
-from ._recovery_services_backup_passive_client_enums import CreateMode
-from ._recovery_services_backup_passive_client_enums import DataSourceType
-from ._recovery_services_backup_passive_client_enums import HealthState
-from ._recovery_services_backup_passive_client_enums import HealthStatus
-from ._recovery_services_backup_passive_client_enums import JobOperationType
-from ._recovery_services_backup_passive_client_enums import JobStatus
-from ._recovery_services_backup_passive_client_enums import JobSupportedAction
-from ._recovery_services_backup_passive_client_enums import LastBackupStatus
-from ._recovery_services_backup_passive_client_enums import MabServerType
-from ._recovery_services_backup_passive_client_enums import OperationStatusValues
-from ._recovery_services_backup_passive_client_enums import OverwriteOptions
-from ._recovery_services_backup_passive_client_enums import ProtectedItemHealthStatus
-from ._recovery_services_backup_passive_client_enums import ProtectedItemState
-from ._recovery_services_backup_passive_client_enums import ProtectionState
-from ._recovery_services_backup_passive_client_enums import RecoveryMode
-from ._recovery_services_backup_passive_client_enums import RecoveryPointTierStatus
-from ._recovery_services_backup_passive_client_enums import RecoveryPointTierType
-from ._recovery_services_backup_passive_client_enums import RecoveryType
-from ._recovery_services_backup_passive_client_enums import ResourceHealthStatus
-from ._recovery_services_backup_passive_client_enums import RestorePointQueryType
-from ._recovery_services_backup_passive_client_enums import RestorePointType
-from ._recovery_services_backup_passive_client_enums import RestoreRequestType
-from ._recovery_services_backup_passive_client_enums import SQLDataDirectoryType
-from ._recovery_services_backup_passive_client_enums import StorageType
-from ._recovery_services_backup_passive_client_enums import StorageTypeState
-from ._recovery_services_backup_passive_client_enums import Type
-from ._recovery_services_backup_passive_client_enums import UsagesUnit
-from ._recovery_services_backup_passive_client_enums import WorkloadType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AADProperties,
+ AADPropertiesResource,
+ AzureFileShareRecoveryPoint,
+ AzureFileShareRestoreRequest,
+ AzureFileshareProtectedItem,
+ AzureFileshareProtectedItemExtendedInfo,
+ AzureIaaSClassicComputeVMProtectedItem,
+ AzureIaaSComputeVMProtectedItem,
+ AzureIaaSVMErrorInfo,
+ AzureIaaSVMHealthDetails,
+ AzureIaaSVMJob,
+ AzureIaaSVMJobExtendedInfo,
+ AzureIaaSVMJobTaskDetails,
+ AzureIaaSVMProtectedItem,
+ AzureIaaSVMProtectedItemExtendedInfo,
+ AzureSqlProtectedItem,
+ AzureSqlProtectedItemExtendedInfo,
+ AzureStorageErrorInfo,
+ AzureStorageJob,
+ AzureStorageJobExtendedInfo,
+ AzureStorageJobTaskDetails,
+ AzureVmWorkloadProtectedItem,
+ AzureVmWorkloadProtectedItemExtendedInfo,
+ AzureVmWorkloadSAPAseDatabaseProtectedItem,
+ AzureVmWorkloadSAPHanaDatabaseProtectedItem,
+ AzureVmWorkloadSQLDatabaseProtectedItem,
+ AzureWorkloadErrorInfo,
+ AzureWorkloadJob,
+ AzureWorkloadJobExtendedInfo,
+ AzureWorkloadJobTaskDetails,
+ AzureWorkloadPointInTimeRecoveryPoint,
+ AzureWorkloadPointInTimeRestoreRequest,
+ AzureWorkloadRecoveryPoint,
+ AzureWorkloadRestoreRequest,
+ AzureWorkloadSAPHanaPointInTimeRecoveryPoint,
+ AzureWorkloadSAPHanaPointInTimeRestoreRequest,
+ AzureWorkloadSAPHanaRecoveryPoint,
+ AzureWorkloadSAPHanaRestoreRequest,
+ AzureWorkloadSQLPointInTimeRecoveryPoint,
+ AzureWorkloadSQLPointInTimeRestoreRequest,
+ AzureWorkloadSQLRecoveryPoint,
+ AzureWorkloadSQLRecoveryPointExtendedInfo,
+ AzureWorkloadSQLRestoreRequest,
+ BEKDetails,
+ BMSAADPropertiesQueryObject,
+ BMSBackupSummariesQueryObject,
+ BMSRPQueryObject,
+ BackupManagementUsage,
+ BackupManagementUsageList,
+ BackupResourceConfig,
+ BackupResourceConfigResource,
+ ClientScriptForConnect,
+ CrossRegionRestoreRequest,
+ CrossRegionRestoreRequestResource,
+ CrrAccessToken,
+ CrrAccessTokenResource,
+ CrrJobRequest,
+ CrrJobRequestResource,
+ DPMProtectedItem,
+ DPMProtectedItemExtendedInfo,
+ DiskExclusionProperties,
+ DiskInformation,
+ DpmErrorInfo,
+ DpmJob,
+ DpmJobExtendedInfo,
+ DpmJobTaskDetails,
+ EncryptionDetails,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ExtendedProperties,
+ GenericProtectedItem,
+ GenericRecoveryPoint,
+ IaasVMRecoveryPoint,
+ IaasVMRestoreRequest,
+ IdentityBasedRestoreDetails,
+ IdentityInfo,
+ InstantItemRecoveryTarget,
+ Job,
+ JobQueryObject,
+ JobResource,
+ JobResourceList,
+ KEKDetails,
+ KPIResourceHealthDetails,
+ KeyAndSecretDetails,
+ MabErrorInfo,
+ MabFileFolderProtectedItem,
+ MabFileFolderProtectedItemExtendedInfo,
+ MabJob,
+ MabJobExtendedInfo,
+ MabJobTaskDetails,
+ NameInfo,
+ NewErrorResponse,
+ NewErrorResponseError,
+ OperationStatus,
+ OperationStatusError,
+ OperationStatusExtendedInfo,
+ OperationStatusJobExtendedInfo,
+ OperationStatusJobsExtendedInfo,
+ OperationStatusProvisionILRExtendedInfo,
+ OperationStatusRecoveryPointExtendedInfo,
+ PointInTimeRange,
+ ProtectedItem,
+ ProtectedItemQueryObject,
+ ProtectedItemResource,
+ ProtectedItemResourceList,
+ RecoveryPoint,
+ RecoveryPointDiskConfiguration,
+ RecoveryPointMoveReadinessInfo,
+ RecoveryPointResource,
+ RecoveryPointResourceList,
+ RecoveryPointTierInformation,
+ Resource,
+ ResourceHealthDetails,
+ ResourceList,
+ RestoreFileSpecs,
+ RestoreRequest,
+ SQLDataDirectory,
+ SQLDataDirectoryMapping,
+ TargetAFSRestoreInfo,
+ TargetRestoreInfo,
+ WorkloadCrrAccessToken,
+)
+
+from ._recovery_services_backup_passive_client_enums import ( # type: ignore
+ BackupManagementType,
+ CopyOptions,
+ CreateMode,
+ DataSourceType,
+ HealthState,
+ HealthStatus,
+ JobOperationType,
+ JobStatus,
+ JobSupportedAction,
+ LastBackupStatus,
+ MabServerType,
+ OperationStatusValues,
+ OverwriteOptions,
+ ProtectedItemHealthStatus,
+ ProtectedItemState,
+ ProtectionState,
+ RecoveryMode,
+ RecoveryPointTierStatus,
+ RecoveryPointTierType,
+ RecoveryType,
+ ResourceHealthStatus,
+ RestorePointQueryType,
+ RestorePointType,
+ RestoreRequestType,
+ SQLDataDirectoryType,
+ StorageType,
+ StorageTypeState,
+ Type,
+ UsagesUnit,
+ WorkloadType,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -315,5 +326,5 @@
"UsagesUnit",
"WorkloadType",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/_models_py3.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/_models_py3.py
index 1851e59aee15..4bd9dc2e3a6a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/_models_py3.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -13,7 +13,6 @@
from .. import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -191,7 +190,7 @@ def __init__(
self.properties = properties
-class ProtectedItem(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ProtectedItem(_serialization.Model):
"""Base class for backup items.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -361,7 +360,7 @@ def __init__(
self.resource_guard_operation_requests = resource_guard_operation_requests
-class AzureFileshareProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureFileshareProtectedItem(ProtectedItem):
"""Azure File Share workload-specific backup item.
All required parameters must be populated in order to send to server.
@@ -851,7 +850,7 @@ def __init__(
self.target_details = target_details
-class AzureIaaSVMProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMProtectedItem(ProtectedItem):
"""IaaS VM workload-specific backup item.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -1119,7 +1118,7 @@ def __init__( # pylint: disable=too-many-locals
self.extended_properties = extended_properties
-class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSClassicComputeVMProtectedItem(AzureIaaSVMProtectedItem):
"""IaaS VM workload-specific backup item representing the Classic Compute VM.
All required parameters must be populated in order to send to server.
@@ -1377,7 +1376,7 @@ def __init__( # pylint: disable=too-many-locals
self.protected_item_type: str = "Microsoft.ClassicCompute/virtualMachines"
-class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureIaaSComputeVMProtectedItem(AzureIaaSVMProtectedItem):
"""IaaS VM workload-specific backup item representing the Azure Resource Manager VM.
All required parameters must be populated in order to send to server.
@@ -1825,7 +1824,7 @@ def __init__(
self.job_type: Optional[str] = None
-class AzureIaaSVMJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureIaaSVMJob(Job):
"""Azure IaaS VM workload-specific job object.
All required parameters must be populated in order to send to server.
@@ -2136,7 +2135,7 @@ def __init__(
self.policy_inconsistent = policy_inconsistent
-class AzureSqlProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureSqlProtectedItem(ProtectedItem):
"""Azure SQL workload-specific backup item.
All required parameters must be populated in order to send to server.
@@ -2400,7 +2399,7 @@ def __init__(
self.recommendations = recommendations
-class AzureStorageJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureStorageJob(Job):
"""Azure storage specific job.
All required parameters must be populated in order to send to server.
@@ -2604,7 +2603,7 @@ def __init__(self, *, task_id: Optional[str] = None, status: Optional[str] = Non
self.status = status
-class AzureVmWorkloadProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadProtectedItem(ProtectedItem):
"""Azure VM workload-specific protected item.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -2926,9 +2925,7 @@ def __init__(
self.policy_state = policy_state
-class AzureVmWorkloadSAPAseDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPAseDatabaseProtectedItem(AzureVmWorkloadProtectedItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protected item representing SAP ASE Database.
All required parameters must be populated in order to send to server.
@@ -3197,9 +3194,7 @@ def __init__( # pylint: disable=too-many-locals
self.protected_item_type: str = "AzureVmWorkloadSAPAseDatabase"
-class AzureVmWorkloadSAPHanaDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureVmWorkloadSAPHanaDatabaseProtectedItem(AzureVmWorkloadProtectedItem): # pylint: disable=name-too-long
"""Azure VM workload-specific protected item representing SAP HANA Database.
All required parameters must be populated in order to send to server.
@@ -3468,9 +3463,7 @@ def __init__( # pylint: disable=too-many-locals
self.protected_item_type: str = "AzureVmWorkloadSAPHanaDatabase"
-class AzureVmWorkloadSQLDatabaseProtectedItem(
- AzureVmWorkloadProtectedItem
-): # pylint: disable=too-many-instance-attributes
+class AzureVmWorkloadSQLDatabaseProtectedItem(AzureVmWorkloadProtectedItem):
"""Azure VM workload-specific protected item representing SQL Database.
All required parameters must be populated in order to send to server.
@@ -3792,7 +3785,7 @@ def __init__(
self.additional_details = additional_details
-class AzureWorkloadJob(Job): # pylint: disable=too-many-instance-attributes
+class AzureWorkloadJob(Job):
"""Azure storage specific job.
All required parameters must be populated in order to send to server.
@@ -4960,9 +4953,7 @@ def __init__(
self.alternate_directory_paths = alternate_directory_paths
-class AzureWorkloadSQLPointInTimeRestoreRequest(
- AzureWorkloadSQLRestoreRequest
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class AzureWorkloadSQLPointInTimeRestoreRequest(AzureWorkloadSQLRestoreRequest): # pylint: disable=name-too-long
"""AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore.
All required parameters must be populated in order to send to server.
@@ -5628,7 +5619,7 @@ def __init__(
self.properties = properties
-class CrrAccessToken(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class CrrAccessToken(_serialization.Model):
"""CrrAccessToken.
You probably want to use the sub-classes and not this class directly. Known sub-classes are:
@@ -6075,7 +6066,7 @@ def __init__(
self.recommendations = recommendations
-class DpmJob(Job): # pylint: disable=too-many-instance-attributes
+class DpmJob(Job):
"""DPM workload-specific job object.
All required parameters must be populated in order to send to server.
@@ -6318,7 +6309,7 @@ def __init__(
self.status = status
-class DPMProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class DPMProtectedItem(ProtectedItem):
"""Additional information on Backup engine specific backup item.
All required parameters must be populated in order to send to server.
@@ -6508,7 +6499,7 @@ def __init__(
self.extended_info = extended_info
-class DPMProtectedItemExtendedInfo(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DPMProtectedItemExtendedInfo(_serialization.Model):
"""Additional information of DPM Protected item.
:ivar protectable_object_load_path: Attribute to provide information on various DBs.
@@ -6764,7 +6755,7 @@ def __init__(
self.disk_exclusion_properties = disk_exclusion_properties
-class GenericProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class GenericProtectedItem(ProtectedItem):
"""Base class for backup items.
All required parameters must be populated in order to send to server.
@@ -7028,7 +7019,7 @@ def __init__(
self.recovery_point_additional_info = recovery_point_additional_info
-class IaasVMRecoveryPoint(RecoveryPoint): # pylint: disable=too-many-instance-attributes
+class IaasVMRecoveryPoint(RecoveryPoint):
"""IaaS VM workload specific backup copy.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -7175,7 +7166,7 @@ def __init__(
self.recovery_point_move_readiness_info = recovery_point_move_readiness_info
-class IaasVMRestoreRequest(RestoreRequest): # pylint: disable=too-many-instance-attributes
+class IaasVMRestoreRequest(RestoreRequest):
"""IaaS VM workload-specific restore.
All required parameters must be populated in order to send to server.
@@ -7819,7 +7810,7 @@ def __init__(self, **kwargs: Any) -> None:
self.recommendations = None
-class MabFileFolderProtectedItem(ProtectedItem): # pylint: disable=too-many-instance-attributes
+class MabFileFolderProtectedItem(ProtectedItem):
"""MAB workload-specific backup item.
All required parameters must be populated in order to send to server.
@@ -8065,7 +8056,7 @@ def __init__(
self.recovery_point_count = recovery_point_count
-class MabJob(Job): # pylint: disable=too-many-instance-attributes
+class MabJob(Job):
"""MAB workload-specific job.
All required parameters must be populated in order to send to server.
@@ -9350,7 +9341,7 @@ def __init__(
self.target_directory_for_file_restore = target_directory_for_file_restore
-class WorkloadCrrAccessToken(CrrAccessToken): # pylint: disable=too-many-instance-attributes
+class WorkloadCrrAccessToken(CrrAccessToken):
"""WorkloadCrrAccessToken.
All required parameters must be populated in order to send to server.
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/__init__.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/__init__.py
index 2fc83cfb6d5a..62c2cdf28182 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/__init__.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/__init__.py
@@ -5,21 +5,27 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._backup_usage_summaries_crr_operations import BackupUsageSummariesCRROperations
-from ._aad_properties_operations import AadPropertiesOperations
-from ._cross_region_restore_operations import CrossRegionRestoreOperations
-from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations
-from ._backup_crr_jobs_operations import BackupCrrJobsOperations
-from ._crr_operation_results_operations import CrrOperationResultsOperations
-from ._crr_operation_status_operations import CrrOperationStatusOperations
-from ._recovery_points_operations import RecoveryPointsOperations
-from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations
-from ._recovery_points_crr_operations import RecoveryPointsCrrOperations
-from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._backup_usage_summaries_crr_operations import BackupUsageSummariesCRROperations # type: ignore
+from ._aad_properties_operations import AadPropertiesOperations # type: ignore
+from ._cross_region_restore_operations import CrossRegionRestoreOperations # type: ignore
+from ._backup_crr_job_details_operations import BackupCrrJobDetailsOperations # type: ignore
+from ._backup_crr_jobs_operations import BackupCrrJobsOperations # type: ignore
+from ._crr_operation_results_operations import CrrOperationResultsOperations # type: ignore
+from ._crr_operation_status_operations import CrrOperationStatusOperations # type: ignore
+from ._recovery_points_operations import RecoveryPointsOperations # type: ignore
+from ._backup_resource_storage_configs_operations import BackupResourceStorageConfigsOperations # type: ignore
+from ._recovery_points_crr_operations import RecoveryPointsCrrOperations # type: ignore
+from ._backup_protected_items_crr_operations import BackupProtectedItemsCrrOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -35,5 +41,5 @@
"RecoveryPointsCrrOperations",
"BackupProtectedItemsCrrOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_aad_properties_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_aad_properties_operations.py
index 500f862a4d1b..83cd3d250007 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_aad_properties_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_aad_properties_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -99,7 +101,7 @@ def get(self, azure_region: str, filter: Optional[str] = None, **kwargs: Any) ->
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.AADPropertiesResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -121,7 +123,6 @@ def get(self, azure_region: str, filter: Optional[str] = None, **kwargs: Any) ->
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -136,7 +137,7 @@ def get(self, azure_region: str, filter: Optional[str] = None, **kwargs: Any) ->
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("AADPropertiesResource", pipeline_response)
+ deserialized = self._deserialize("AADPropertiesResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_job_details_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_job_details_operations.py
index c2ab6f847e86..0a265bf25cff 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_job_details_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_job_details_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -148,7 +150,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.JobResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -181,7 +183,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -196,7 +197,7 @@ def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("JobResource", pipeline_response)
+ deserialized = self._deserialize("JobResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_jobs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_jobs_operations.py
index 8a233d1029b0..69f708826a85 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_jobs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_crr_jobs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
@@ -20,16 +20,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -197,7 +199,7 @@ def list(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -227,7 +229,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -243,7 +244,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_protected_items_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_protected_items_crr_operations.py
index ee45d1998f1f..4fed2de6e5a9 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_protected_items_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_protected_items_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -128,7 +130,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ProtectedItemResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -149,7 +151,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -165,7 +166,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_resource_storage_configs_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_resource_storage_configs_operations.py
index 4f9516b89780..65fa111df601 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_resource_storage_configs_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_resource_storage_configs_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -160,7 +162,7 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +184,6 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -197,7 +198,7 @@ def get(self, vault_name: str, resource_group_name: str, **kwargs: Any) -> _mode
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -283,7 +284,7 @@ def update(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.BackupResourceConfigResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -317,7 +318,6 @@ def update(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -332,7 +332,7 @@ def update(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response)
+ deserialized = self._deserialize("BackupResourceConfigResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -340,7 +340,7 @@ def update(
return deserialized # type: ignore
@overload
- def patch( # pylint: disable=inconsistent-return-statements
+ def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -368,7 +368,7 @@ def patch( # pylint: disable=inconsistent-return-statements
"""
@overload
- def patch( # pylint: disable=inconsistent-return-statements
+ def patch(
self,
vault_name: str,
resource_group_name: str,
@@ -418,7 +418,7 @@ def patch( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -452,7 +452,6 @@ def patch( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_usage_summaries_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_usage_summaries_crr_operations.py
index 1986295015ee..3df38a22db17 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_usage_summaries_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_backup_usage_summaries_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -128,7 +130,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BackupManagementUsageList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -149,7 +151,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -165,7 +166,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_cross_region_restore_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_cross_region_restore_operations.py
index 39b92a0240d0..789fae93445d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_cross_region_restore_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_cross_region_restore_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
-from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -15,12 +15,13 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
@@ -28,8 +29,11 @@
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -87,10 +91,10 @@ def __init__(self, *args, **kwargs):
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
- def _trigger_initial( # pylint: disable=inconsistent-return-statements
+ def _trigger_initial(
self, azure_region: str, parameters: Union[_models.CrossRegionRestoreRequest, IO[bytes]], **kwargs: Any
- ) -> None:
- error_map = {
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -103,7 +107,7 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[None] = kwargs.pop("cls", None)
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
content_type = content_type or "application/json"
_json = None
@@ -123,10 +127,10 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
- _stream = False
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)
@@ -134,12 +138,20 @@ def _trigger_initial( # pylint: disable=inconsistent-return-statements
response = pipeline_response.http_response
if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
if cls:
- return cls(pipeline_response, None, {}) # type: ignore
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
@overload
def begin_trigger(
@@ -221,7 +233,7 @@ def begin_trigger(
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
cont_token: Optional[str] = kwargs.pop("continuation_token", None)
if cont_token is None:
- raw_result = self._trigger_initial( # type: ignore
+ raw_result = self._trigger_initial(
azure_region=azure_region,
parameters=parameters,
api_version=api_version,
@@ -231,6 +243,7 @@ def begin_trigger(
params=_params,
**kwargs
)
+ raw_result.http_response.read() # type: ignore
kwargs.pop("error_map", None)
def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_results_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_results_operations.py
index 5c1b0688fcca..5b4c52e7d238 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_results_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_results_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -96,7 +98,7 @@ def get( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -118,7 +120,6 @@ def get( # pylint: disable=inconsistent-return-statements
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_status_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_status_operations.py
index c76f47cee47a..1b5ad9f939d0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_status_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_crr_operation_status_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
@@ -17,16 +17,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -94,7 +96,7 @@ def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _models.Op
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.OperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -116,7 +118,6 @@ def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _models.Op
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -131,7 +132,7 @@ def get(self, azure_region: str, operation_id: str, **kwargs: Any) -> _models.Op
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("OperationStatus", pipeline_response)
+ deserialized = self._deserialize("OperationStatus", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_crr_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_crr_operations.py
index 72a5cb14d833..8284e339e42e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_crr_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_crr_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6,6 +5,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
@@ -19,16 +19,18 @@
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -179,7 +181,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.RecoveryPointResourceList] = kwargs.pop("cls", None)
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -202,7 +204,6 @@ def prepare_request(next_link=None):
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
else:
@@ -218,7 +219,6 @@ def prepare_request(next_link=None):
_request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_request.method = "GET"
return _request
@@ -280,7 +280,7 @@ def get(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.RecoveryPointResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -306,7 +306,6 @@ def get(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -321,7 +320,7 @@ def get(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("RecoveryPointResource", pipeline_response)
+ deserialized = self._deserialize("RecoveryPointResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_operations.py
index 064d46221c8e..b2de0cfdc15d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/passivestamp/operations/_recovery_points_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
+import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
@@ -18,16 +18,18 @@
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.pipeline.transport import HttpResponse
-from azure.core.rest import HttpRequest
+from azure.core.rest import HttpRequest, HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from .._serialization import Serializer
-from .._vendor import _convert_request
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -218,12 +220,11 @@ def get_access_token(
:rtype: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.CrrAccessTokenResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
- 400: lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat),
}
error_map.update(kwargs.pop("error_map", {}) or {})
@@ -257,7 +258,6 @@ def get_access_token(
headers=_headers,
params=_params,
)
- _request = _convert_request(_request)
_request.url = self._client.format_url(_request.url)
_stream = False
@@ -272,7 +272,7 @@ def get_access_token(
error = self._deserialize.failsafe_deserialize(_models.NewErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
- deserialized = self._deserialize("CrrAccessTokenResource", pipeline_response)
+ deserialized = self._deserialize("CrrAccessTokenResource", pipeline_response.http_response)
if cls:
return cls(pipeline_response, deserialized, {}) # type: ignore
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_feature_validate.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_feature_validate.py
index bfb198c090b1..0898dcb11213 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_feature_validate.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_feature_validate.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -39,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupFeature_Validate.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/BackupFeature_Validate.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_policies_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_policies_list.py
index 68e3d01f56cf..ae9ba49e6ef7 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_policies_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_policies_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupPolicies_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/BackupPolicies_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protectable_items_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protectable_items_list.py
index 6d0542ba99e3..4c74657bf1e3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protectable_items_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protectable_items_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectableItems_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/BackupProtectableItems_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protected_items_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protected_items_list.py
index 73940173737d..0a78c2358e9a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protected_items_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/backup_protected_items_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectedItems_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/BackupProtectedItems_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/classic_compute_protected_item_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/classic_compute_protected_item_get.py
index 0d2f7309a730..603ff948a905 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/classic_compute_protected_item_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/classic_compute_protected_item_get.py
@@ -40,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/compute_protected_item_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/compute_protected_item_get.py
index d8eb84f16f28..59c1fc0c47a9 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/compute_protected_item_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/compute_protected_item_get.py
@@ -40,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/configure_protection.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/configure_protection.py
index 7715c2fa4c93..5edc8b62717d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/configure_protection.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/configure_protection.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -49,6 +47,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ConfigureProtection.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ConfigureProtection.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/get_backup_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/get_backup_status.py
index d2109172dd4c..46b90b2becb7 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/get_backup_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/get_backup_status.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -42,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/GetBackupStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/GetBackupStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_results.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_results.py
index 1dfc5d76c541..7209514da7a3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_results.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_results.py
@@ -41,6 +41,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationResults.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectedItemOperationResults.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_status.py
index 5edcfa585ddd..fe7710e56edc 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protected_item_operation_status.py
@@ -41,6 +41,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_create_or_update.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_create_or_update.py
index d54aeadd93c0..1b1af92e4bc0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_create_or_update.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_create_or_update.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -48,6 +46,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_validate.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_validate.py
index 14d335618301..83e3b6818bca 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_validate.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_intent_validate.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -44,6 +42,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_Validate.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionIntent_Validate.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_complex.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_complex.py
index 44751e923827..978ea4083259 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_complex.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_complex.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -79,6 +77,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_simple.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_simple.py
index cc206e7a1437..c16f925d035f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_simple.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_create_or_update_simple.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -58,6 +56,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_delete.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_delete.py
index 2ac3fc156b12..67a9130e99fe 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_delete.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_delete.py
@@ -37,6 +37,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_get.py
index 7eef9d348168..07c1fa2164e1 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policies_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicies_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_results_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_results_get.py
index 44514f643ec5..bab01b4a69e6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_results_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_results_get.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_statuses_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_statuses_get.py
index 84cbc523f132..33896c6bca35 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_statuses_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/protection_policy_operation_statuses_get.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/provision_ilr.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/provision_ilr.py
index a28d5721933d..d03881d01e21 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/provision_ilr.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/provision_ilr.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -51,6 +49,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Provision_Ilr.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/Provision_Ilr.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_get.py
index 985ec2893e05..35bd6d996f25 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_get.py
@@ -41,6 +41,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/RecoveryPoints_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_list.py
index 4553067b1832..8a6557bd379a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_list.py
@@ -41,6 +41,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/RecoveryPoints_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_recommended_for_move_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_recommended_for_move_list.py
index bac6221574d7..5b3cc05e0153 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_recommended_for_move_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/recovery_points_recommended_for_move_list.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -47,6 +45,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/revoke_ilr.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/revoke_ilr.py
index a6fb076b0f89..37b142e3abe0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/revoke_ilr.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/revoke_ilr.py
@@ -40,6 +40,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Revoke_Ilr.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/Revoke_Ilr.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/stop_protection.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/stop_protection.py
index 528fc2b7866a..739f4fdef577 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/stop_protection.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/stop_protection.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -49,6 +47,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/StopProtection.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/StopProtection.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request.py
index 88dda9f233f9..671577a8f417 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -60,6 +58,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request_identity_based_restore_details.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request_identity_based_restore_details.py
index ca8cd3a183c8..3444f3cab919 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request_identity_based_restore_details.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_request_identity_based_restore_details.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -62,6 +60,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_with_rehydration_request.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_with_rehydration_request.py
index aa2f99be46d6..b2933602ec5e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_with_rehydration_request.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_alr_iaas_vm_restore_with_rehydration_request.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -60,6 +58,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_resource_guard_enabled.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_resource_guard_enabled.py
new file mode 100644
index 000000000000..1374cadc0289
--- /dev/null
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_resource_guard_enabled.py
@@ -0,0 +1,67 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-recoveryservicesbackup
+# USAGE
+ python trigger_restore_resource_guard_enabled.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = RecoveryServicesBackupClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000000",
+ )
+
+ client.restores.begin_trigger(
+ vault_name="testVault",
+ resource_group_name="netsdktestrg",
+ fabric_name="Azure",
+ container_name="IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
+ protected_item_name="VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
+ recovery_point_id="348916168024334",
+ parameters={
+ "properties": {
+ "createNewCloudService": True,
+ "encryptionDetails": {"encryptionEnabled": False},
+ "identityBasedRestoreDetails": {
+ "targetStorageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"
+ },
+ "identityInfo": {
+ "isSystemAssignedIdentity": False,
+ "managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi",
+ },
+ "objectType": "IaasVMRestoreRequest",
+ "originalStorageAccountOption": False,
+ "recoveryPointId": "348916168024334",
+ "recoveryType": "RestoreDisks",
+ "region": "southeastasia",
+ "resourceGuardOperationRequests": [
+ "/subscriptions/063bf7bc-e4dc-4cde-8840-8416fbd7921e/resourcegroups/ankurRG1/providers/Microsoft.DataProtection/resourceGuards/RG341/triggerRestoreRequests/default"
+ ],
+ "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1",
+ }
+ },
+ ).result()
+
+
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_ResourceGuardEnabled.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request.py
index 7582da964d87..08611fe9f65c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -63,6 +61,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request_identity_based_restore_details.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request_identity_based_restore_details.py
index 962ef6fa816e..da6fd4f9d66b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request_identity_based_restore_details.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_request_identity_based_restore_details.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -61,6 +59,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_with_rehydration_request.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_with_rehydration_request.py
index 83c6013470cd..566d59868f56 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_with_rehydration_request.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_restore_restore_disks_iaas_vm_restore_with_rehydration_request.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -59,6 +57,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_validate_operation_restore_disk.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_validate_operation_restore_disk.py
index 5cadee924f7b..4f8b4b65b40e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_validate_operation_restore_disk.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/trigger_validate_operation_restore_disk.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -59,6 +57,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_daily.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_daily.py
index 108571ec0bc4..b89137914a88 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_daily.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_daily.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -81,6 +79,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_hourly.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_hourly.py
index ce4409fe0470..495622760ca6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_hourly.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/iaa_s_v2_hourly.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -85,6 +83,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_get_policy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_get_policy.py
index 0292cc2d7626..6914a723fc35 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_get_policy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_get_policy.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_list_policies.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_list_policies.py
index 2a7b57f29c18..d9ed6bbecbd5 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_list_policies.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/v2_policy/v2_list_policies.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk.py
index a0ca33346582..ae947ae8a700 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -60,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk_identity_based_restore_details.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk_identity_based_restore_details.py
index 57ee5f4ed854..269eb3720e92 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk_identity_based_restore_details.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_restore_disk_identity_based_restore_details.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -62,6 +60,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_results.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_results.py
index ea6a258efde9..95fe061810f6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_results.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_results.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationResults.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ValidateOperationResults.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_status.py
index 586ee54a2634..395eee86a9dd 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_iaas_vm/validate_operation_status.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureIaasVm/ValidateOperationStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protectable_containers_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protectable_containers_list.py
index b1a5f64e0039..1f655332d74b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protectable_containers_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protectable_containers_list.py
@@ -39,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectableContainers_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectableContainers_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire.py
index 378f56ba96a5..b6afc4ead42c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionContainers_Inquire.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire_result.py
index a0871cfa306b..5e1a370a8274 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire_result.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_inquire_result.py
@@ -40,6 +40,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_list.py
index 3d8000273290..4ef0d5be241c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionContainers_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_register.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_register.py
index a3fdfdb479b7..22109577bda3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_register.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_containers_register.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -50,6 +48,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Register.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionContainers_Register.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_daily.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_daily.py
index 8048436175ea..457b2e6a0826 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_daily.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_daily.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -79,6 +77,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hardened.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hardened.py
index ba78c0f8fb47..c8a5916edbf6 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hardened.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hardened.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -82,6 +80,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hourly.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hourly.py
index afd1c098e10d..8f5c211a6d9b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hourly.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/protection_policies_create_or_update_hourly.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -83,6 +81,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/soft_deleted_containers_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/soft_deleted_containers_list.py
index 801bdb8e5243..5e6b1bb5bfd0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/soft_deleted_containers_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_storage/soft_deleted_containers_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/SoftDeletedContainers_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureStorage/SoftDeletedContainers_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_policies_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_policies_list.py
index 16ea661602d7..a8668714592f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_policies_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_policies_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupPolicies_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/BackupPolicies_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_delete.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_delete.py
index a6537243d857..6c82c03d7403 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_delete.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_delete.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_get.py
index 25208eb1568e..5af7245bbf7f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_get.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/BackupProtectionIntent_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_list.py
index f36f87b20c56..a167037b033d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_protection_intent_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/BackupProtectionIntent_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_workload_items_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_workload_items_list.py
index 79d5c3ee87ab..971730f03714 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_workload_items_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/backup_workload_items_list.py
@@ -40,6 +40,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupWorkloadItems_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/BackupWorkloadItems_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_get.py
index a8014599ccaf..d8f22000aa0b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_get.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/ProtectionContainers_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_unregister.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_unregister.py
index 6ecaa729da6e..e0cd2ed4c0af 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_unregister.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_containers_unregister.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Unregister.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/ProtectionContainers_Unregister.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_policies_create_or_update_complex.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_policies_create_or_update_complex.py
index 960c9b656d36..ea0d427fcb2b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_policies_create_or_update_complex.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/azure_workload/protection_policies_create_or_update_complex.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -100,6 +98,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/backup_data_move_operation_status_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/backup_data_move_operation_status_get.py
index 70ade9db3011..827e144dbe6c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/backup_data_move_operation_status_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/backup_data_move_operation_status_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_operation_result_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_operation_result_get.py
index e9cb94d2282e..4531ad918fb4 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_operation_result_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_operation_result_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_post.py
index 3aa117c94762..e91b48bdf7e8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/prepare_data_move_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -43,6 +41,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMove_Post.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupDataMove/PrepareDataMove_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/trigger_data_move_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/trigger_data_move_post.py
index 14d9109a4211..6fa67f3eae4a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/trigger_data_move_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_data_move/trigger_data_move_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -44,6 +42,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/TriggerDataMove_Post.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupDataMove/TriggerDataMove_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_get.py
index e63e64284cfe..3cddfbec447c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupResourceEncryptionConfig_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_put.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_put.py
index b0a091dde8ba..48978246cdad 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_put.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/backup_resource_encryption_config_put.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -46,6 +44,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Put.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/BackupResourceEncryptionConfig_Put.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protected_item_usage_summary_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protected_item_usage_summary_get.py
index 5d84c0e50845..07537704bcc8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protected_item_usage_summary_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protected_item_usage_summary_get.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protection_containers_usage_summary_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protection_containers_usage_summary_get.py
index e3c9ffcdcb0e..66bff30ae412 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protection_containers_usage_summary_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_protection_containers_usage_summary_get.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_get.py
index 26a420a1caef..54978309d28b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupResourceVaultConfigs_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_patch.py
index 0ce851f5fbf5..11451057cd5b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_patch.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_patch.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -40,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Patch.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupResourceVaultConfigs_Patch.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_put.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_put.py
index 08b686474948..5823973afe51 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_put.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_resource_vault_configs_put.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -40,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Put.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupResourceVaultConfigs_Put.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_security_pin_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_security_pin_get.py
index bc56c3c734eb..457512819fa8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_security_pin_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_security_pin_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupSecurityPin_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupSecurityPin_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_get.py
index dd7257a94ead..593b0751264a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupStorageConfig_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_patch.py
index 78bf61a71967..325fa1a5407a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_patch.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_patch.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -39,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Patch.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupStorageConfig_Patch.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_put.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_put.py
index 866c860921f4..76b11f42c6d4 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_put.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/backup_storage_config_put.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -40,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Put.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/BackupStorageConfig_Put.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/cancel_job_operation_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/cancel_job_operation_result.py
index 4770a9d99fc9..d0c56ab912f4 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/cancel_job_operation_result.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/cancel_job_operation_result.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/CancelJobOperationResult.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/CancelJobOperationResult.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/export_jobs_operation_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/export_jobs_operation_result.py
index 811736f8427e..53b5d4184526 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/export_jobs_operation_result.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/export_jobs_operation_result.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ExportJobsOperationResult.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ExportJobsOperationResult.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/get_job_details.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/get_job_details.py
index d6028cee0182..0bcfe2e7c5e7 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/get_job_details.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/get_job_details.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/GetJobDetails.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/GetJobDetails.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs.py
index 2a67bdda94ba..4605fb26f097 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobs.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ListJobs.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_all_supported_filters.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_all_supported_filters.py
index 141634fd4015..d6a3040613f3 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_all_supported_filters.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_all_supported_filters.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithAllSupportedFilters.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ListJobsWithAllSupportedFilters.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_start_time_and_end_time_filters.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_start_time_and_end_time_filters.py
index 52a307f1c32d..66237b9a3e72 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_start_time_and_end_time_filters.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/list_jobs_with_start_time_and_end_time_filters.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete.py
index 1de14cc17cbd..9deb52103b69 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete.py
@@ -39,6 +39,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ProtectedItem_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_result.py
index 507a6e6407e7..97630a215440 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_result.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_result.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationResult.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ProtectedItem_Delete_OperationResult.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_status.py
index c9cc7f3bd242..d3da007c5d9a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/protected_item_delete_operation_status.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/ProtectedItem_Delete_OperationStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers.py
index e01828e2978c..988263454eaf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/RefreshContainers.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers_operation_results.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers_operation_results.py
index 0928131add00..7681cc8b9c5e 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers_operation_results.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/refresh_containers_operation_results.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers_OperationResults.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/RefreshContainers_OperationResults.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_backup_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_backup_post.py
index 29662173150c..c8a31b45c67a 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_backup_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_backup_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -42,6 +40,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerBackup_Post.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/TriggerBackup_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_cancel_job.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_cancel_job.py
index 5b6b4ed9e36d..f1662359d448 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_cancel_job.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_cancel_job.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerCancelJob.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/TriggerCancelJob.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_export_jobs.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_export_jobs.py
index 015f77cba075..c340586f86d2 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_export_jobs.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/common/trigger_export_jobs.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerExportJobs.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Common/TriggerExportJobs.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_get.py
index 290866cb18e6..16b7a6360b0b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_Get.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Dpm/BackupEngines_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_list.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_list.py
index 2f96f318e9b0..adf8b226cace 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_list.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/dpm/backup_engines_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_List.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/Dpm/BackupEngines_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/list_operations.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/list_operations.py
index 8ae3ffc9a87e..0b0349a9e0bf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/list_operations.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/list_operations.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ListOperations.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/delete_private_endpoint_connection.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/delete_private_endpoint_connection.py
index 26c69c0465bc..b8ce6d2d79a0 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/delete_private_endpoint_connection.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/delete_private_endpoint_connection.py
@@ -37,6 +37,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection.py
index 1465c2d46e46..b655f62a4c84 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection_operation_status.py
index 4f481934f9d6..4f2cd0264fe8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection_operation_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/get_private_endpoint_connection_operation_status.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/put_private_endpoint_connection.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/put_private_endpoint_connection.py
index 8dbe45134b24..9adf09b4fda8 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/put_private_endpoint_connection.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/private_endpoint_connection/put_private_endpoint_connection.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -53,6 +51,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/delete_resource_guard_proxy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/delete_resource_guard_proxy.py
index 63d7674ea989..d8c20d41632d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/delete_resource_guard_proxy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/delete_resource_guard_proxy.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/get_resource_guard_proxy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/get_resource_guard_proxy.py
index ca950bfdc32d..e1050677b707 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/get_resource_guard_proxy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/get_resource_guard_proxy.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/list_resource_guard_proxy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/list_resource_guard_proxy.py
index 02c4c73614fc..38a81413fe7c 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/list_resource_guard_proxy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/list_resource_guard_proxy.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/put_resource_guard_proxy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/put_resource_guard_proxy.py
index cd16b70061e1..d2258b8cbf8f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/put_resource_guard_proxy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/put_resource_guard_proxy.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -45,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/unlock_delete_resource_guard_proxy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/unlock_delete_resource_guard_proxy.py
index a7a2fce82c34..c2ba303aac5f 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/unlock_delete_resource_guard_proxy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/resource_guard_proxy_crud/unlock_delete_resource_guard_proxy.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -46,6 +44,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_policy.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_policy.py
index fb5c462a6cbb..1374eadac958 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_policy.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_policy.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -45,6 +43,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForPolicy.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/FetchTieringCostForPolicy.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_protected_item.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_protected_item.py
index 4b925ee3da5d..2dd9088ced29 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_protected_item.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_protected_item.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -46,6 +44,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForProtectedItem.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/FetchTieringCostForProtectedItem.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_rehydrate.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_rehydrate.py
index 72a614aa2de8..af27b0181a69 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_rehydrate.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_rehydrate.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -48,6 +46,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForRehydrate.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/FetchTieringCostForRehydrate.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_vault.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_vault.py
index 3f093d0501f7..5f064825b9e1 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_vault.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/fetch_tiering_cost_for_vault.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -44,6 +42,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForVault.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/FetchTieringCostForVault.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_result.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_result.py
index 6701339983fa..907a408de070 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_result.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_result.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationResult.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/GetTieringCostOperationResult.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_status.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_status.py
index 640fc4fa184b..4a0ec4772c69 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_status.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/tiering_cost/get_tiering_cost_operation_status.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationStatus.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TieringCost/GetTieringCostOperationStatus.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/trigger_recovery_point_move_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/trigger_recovery_point_move_post.py
index 1b38ec86e173..02ae117dc038 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/trigger_recovery_point_move_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/activestamp/trigger_recovery_point_move_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.activestamp import RecoveryServicesBackupClient
@@ -47,6 +45,6 @@ def main():
).result()
-# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TriggerRecoveryPointMove_Post.json
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/examples/TriggerRecoveryPointMove_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_access_token_get.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_access_token_get.py
index 3271881fbc2d..dd746880d4f5 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_access_token_get.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_access_token_get.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_crr_job_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_crr_job_post.py
index 7763749648ce..0c9140f70e9b 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_crr_job_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/get_crr_job_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/list_crr_jobs_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/list_crr_jobs_post.py
index beccd76f8dee..fe2d110b6f13 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/list_crr_jobs_post.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/list_crr_jobs_post.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_identity_based_restore_details_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_identity_based_restore_details_post.py
new file mode 100644
index 000000000000..dfd2418e2462
--- /dev/null
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_identity_based_restore_details_post.py
@@ -0,0 +1,87 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-recoveryservicesbackup
+# USAGE
+ python trigger_cross_region_restore_identity_based_restore_details_post.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = RecoveryServicesBackupPassiveClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000000",
+ )
+
+ client.cross_region_restore.begin_trigger(
+ azure_region="southeastasia",
+ parameters={
+ "crossRegionRestoreAccessDetails": {
+ "accessTokenString": "**********",
+ "backupManagementType": "AzureIaasVM",
+ "containerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
+ "containerType": "IaasVMContainer",
+ "coordinatorServiceStampUri": "https://pod01-coord1.ccy.backup.windowsazure.com",
+ "datasourceContainerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
+ "datasourceId": "1142937031",
+ "datasourceName": "sriniccylinux",
+ "datasourceType": "VM",
+ "objectType": "WorkloadCrrAccessToken",
+ "protectionServiceStampId": "90d98224-2ac6-4bda-9f35-33fb22841f2a",
+ "protectionServiceStampUri": "https://pod01-prot1-int.ccy.backup.windowsazure.com",
+ "recoveryPointId": "87178355392716",
+ "recoveryPointTime": "10/9/2019 6:05:54 PM",
+ "resourceGroupName": "srinivasccyrg",
+ "resourceId": "1330837906418138160",
+ "resourceName": "sriniccyvault",
+ "subscriptionId": "f2edfd5d-5496-4683-b94f-b3588c579009",
+ "tokenExtendedInformation": 'V2015_09f2edfd5d-5496-4683-b94f-b3588c579009;AzureBackup_sriniccylinux_1142937031;AzureBackup_20191009_060554;AzureBackupRG_centraluseuap_1truetruefalseLinuxFileSystemConsistentPremiumVMOnPremiumStorageStandard_D2s_v3',
+ },
+ "restoreRequest": {
+ "affinityGroup": "",
+ "createNewCloudService": False,
+ "encryptionDetails": {"encryptionEnabled": False},
+ "identityBasedRestoreDetails": {
+ "targetStorageAccountId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993"
+ },
+ "identityInfo": {
+ "isSystemAssignedIdentity": False,
+ "managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi",
+ },
+ "objectType": "IaasVMRestoreRequest",
+ "originalStorageAccountOption": False,
+ "recoveryPointId": "87178355392716",
+ "recoveryType": "AlternateLocation",
+ "region": "eastus2euap",
+ "sourceResourceId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux",
+ "subnetId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default",
+ "targetDomainNameId": None,
+ "targetResourceGroupId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl",
+ "targetVirtualMachineId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM",
+ "virtualNetworkId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet",
+ "zones": ["2"],
+ },
+ },
+ ).result()
+
+
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-11-15/examples/AzureIaasVm/TriggerCrossRegionRestore_IdentityBasedRestoreDetails_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_post.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_post.py
new file mode 100644
index 000000000000..ee62856b2db4
--- /dev/null
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/azure_iaas_vm/trigger_cross_region_restore_post.py
@@ -0,0 +1,85 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-recoveryservicesbackup
+# USAGE
+ python trigger_cross_region_restore_post.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = RecoveryServicesBackupPassiveClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000000",
+ )
+
+ client.cross_region_restore.begin_trigger(
+ azure_region="southeastasia",
+ parameters={
+ "crossRegionRestoreAccessDetails": {
+ "accessTokenString": "**********",
+ "backupManagementType": "AzureIaasVM",
+ "containerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
+ "containerType": "IaasVMContainer",
+ "coordinatorServiceStampUri": "https://pod01-coord1.ccy.backup.windowsazure.com",
+ "datasourceContainerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
+ "datasourceId": "1142937031",
+ "datasourceName": "sriniccylinux",
+ "datasourceType": "VM",
+ "objectType": "WorkloadCrrAccessToken",
+ "protectionServiceStampId": "90d98224-2ac6-4bda-9f35-33fb22841f2a",
+ "protectionServiceStampUri": "https://pod01-prot1-int.ccy.backup.windowsazure.com",
+ "recoveryPointId": "87178355392716",
+ "recoveryPointTime": "10/9/2019 6:05:54 PM",
+ "resourceGroupName": "srinivasccyrg",
+ "resourceId": "1330837906418138160",
+ "resourceName": "sriniccyvault",
+ "subscriptionId": "f2edfd5d-5496-4683-b94f-b3588c579009",
+ "tokenExtendedInformation": 'V2015_09f2edfd5d-5496-4683-b94f-b3588c579009;AzureBackup_sriniccylinux_1142937031;AzureBackup_20191009_060554;AzureBackupRG_centraluseuap_1truetruefalseLinuxFileSystemConsistentPremiumVMOnPremiumStorageStandard_D2s_v3',
+ },
+ "restoreRequest": {
+ "affinityGroup": "",
+ "createNewCloudService": False,
+ "encryptionDetails": {"encryptionEnabled": False},
+ "identityInfo": {
+ "isSystemAssignedIdentity": False,
+ "managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi",
+ },
+ "objectType": "IaasVMRestoreRequest",
+ "originalStorageAccountOption": False,
+ "recoveryPointId": "87178355392716",
+ "recoveryType": "AlternateLocation",
+ "region": "eastus2euap",
+ "sourceResourceId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux",
+ "storageAccountId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993",
+ "subnetId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default",
+ "targetDomainNameId": None,
+ "targetResourceGroupId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl",
+ "targetVirtualMachineId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM",
+ "virtualNetworkId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet",
+ "zones": ["2"],
+ },
+ },
+ ).result()
+
+
+# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2021-11-15/examples/AzureIaasVm/TriggerCrossRegionRestore_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_patch.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_patch.py
index 62d997c72c19..60cf72b2196d 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_patch.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_patch.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_put.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_put.py
index 8c4362e33ac8..94d3bc334baf 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_put.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/generated_samples/passivestamp/common/backup_storage_config_put.py
@@ -6,8 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-from typing import Any, IO, Union
-
from azure.identity import DefaultAzureCredential
from azure.mgmt.recoveryservicesbackup.passivestamp import RecoveryServicesBackupPassiveClient
diff --git a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py
index 822c72ba578a..6ba4051dae01 100644
--- a/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py
+++ b/sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/setup.py
@@ -75,6 +75,7 @@
},
install_requires=[
"isodate>=0.6.1",
+ "typing-extensions>=4.6.0",
"azure-common>=1.1",
"azure-mgmt-core>=1.3.2",
],