diff --git a/sdk/batch/azure-mgmt-batch/_meta.json b/sdk/batch/azure-mgmt-batch/_meta.json
index 0450a38e7d99..d765c3fcb4e2 100644
--- a/sdk/batch/azure-mgmt-batch/_meta.json
+++ b/sdk/batch/azure-mgmt-batch/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "1040c6b9bd69bf414c895f7bef87bfd470e90127",
+ "commit": "743d071ba3e316d0302006a5f42962ac8e217181",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
- "@autorest/python@6.19.0",
+ "@autorest/python@6.27.4",
"@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --generate-test=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.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
+ "autorest_command": "autorest specification/batch/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/batch/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py
index fd0e2d493c6c..d7e1bf20278f 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__init__.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/__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 ._batch_management_client import BatchManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._batch_management_client import BatchManagementClient # 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__ = [
"BatchManagementClient",
]
-__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/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py
index 5407e5e94888..6de3f7441597 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_batch_management_client.py
@@ -32,11 +32,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class BatchManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class BatchManagementClient: # pylint: disable=too-many-instance-attributes
"""Batch Client.
:ivar batch_account: BatchAccountOperations operations
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py
index 93f7c26287ca..a217d1e78437 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_configuration.py
@@ -14,11 +14,10 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for BatchManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py
index 8139854b97bb..b24ab2885450 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_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:
@@ -155,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
@@ -184,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)
@@ -206,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):
@@ -235,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):
@@ -300,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:
@@ -326,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:
@@ -346,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,
@@ -380,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):
@@ -395,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
@@ -408,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
@@ -426,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
@@ -448,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:
@@ -501,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"}
@@ -540,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,
@@ -560,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)
@@ -592,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"] == "":
@@ -633,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
@@ -664,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
@@ -703,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
@@ -712,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
"""
@@ -728,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
@@ -759,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]"]:
@@ -780,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")
@@ -805,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
@@ -821,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
@@ -841,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
@@ -871,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.
@@ -882,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.")
@@ -945,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 = {}
@@ -971,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
@@ -979,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
@@ -1003,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:
@@ -1034,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)
@@ -1091,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)
@@ -1105,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],
@@ -1141,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)
@@ -1172,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
@@ -1186,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
@@ -1211,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
@@ -1232,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)
@@ -1279,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
@@ -1331,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:
@@ -1354,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.
@@ -1363,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,
@@ -1403,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
@@ -1416,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)
@@ -1440,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 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"...
@@ -1476,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:
@@ -1505,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
@@ -1516,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
@@ -1531,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
)
@@ -1552,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", {})
@@ -1579,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():
@@ -1605,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
@@ -1627,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)
@@ -1647,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:
@@ -1671,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):
@@ -1681,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.
"""
@@ -1720,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
@@ -1732,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.
"""
@@ -1743,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):
@@ -1768,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,
@@ -1781,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):
@@ -1794,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:
@@ -1804,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:
@@ -1822,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.
"""
@@ -1834,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.
"""
@@ -1849,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
@@ -1865,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.
"""
@@ -1877,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.
"""
@@ -1887,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.
"""
@@ -1910,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.
"""
@@ -1924,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.
"""
@@ -1939,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.
"""
@@ -1976,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):
@@ -1985,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
"""
@@ -1996,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/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py
index 8dae91701610..c23f64adb662 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "18.0.0"
+VERSION = "14.0.0b1"
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/__init__.py
index 483d9240d9df..9436e5099427 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/__init__.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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 ._batch_management_client import BatchManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._batch_management_client import BatchManagementClient # 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__ = [
"BatchManagementClient",
]
-__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/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management_client.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management_client.py
index 4348a7b86864..ba971bc9f366 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management_client.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_batch_management_client.py
@@ -32,11 +32,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class BatchManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class BatchManagementClient: # pylint: disable=too-many-instance-attributes
"""Batch Client.
:ivar batch_account: BatchAccountOperations operations
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py
index 3e524c012aaf..7a704463fe07 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/_configuration.py
@@ -14,11 +14,10 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class BatchManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for BatchManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/__init__.py
index 5ef1210d26db..30ba1a1427e2 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/__init__.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/__init__.py
@@ -5,20 +5,26 @@
# 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 ._batch_account_operations import BatchAccountOperations
-from ._application_package_operations import ApplicationPackageOperations
-from ._application_operations import ApplicationOperations
-from ._location_operations import LocationOperations
-from ._operations import Operations
-from ._certificate_operations import CertificateOperations
-from ._private_link_resource_operations import PrivateLinkResourceOperations
-from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations
-from ._pool_operations import PoolOperations
-from ._network_security_perimeter_operations import NetworkSecurityPerimeterOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._batch_account_operations import BatchAccountOperations # type: ignore
+from ._application_package_operations import ApplicationPackageOperations # type: ignore
+from ._application_operations import ApplicationOperations # type: ignore
+from ._location_operations import LocationOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._certificate_operations import CertificateOperations # type: ignore
+from ._private_link_resource_operations import PrivateLinkResourceOperations # type: ignore
+from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations # type: ignore
+from ._pool_operations import PoolOperations # type: ignore
+from ._network_security_perimeter_operations import NetworkSecurityPerimeterOperations # 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__ = [
@@ -33,5 +39,5 @@
"PoolOperations",
"NetworkSecurityPerimeterOperations",
]
-__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/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py
index c0619f924462..5d7a5ad6c1af 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -151,7 +150,7 @@ async def create(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -210,9 +209,7 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, account_name: str, application_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, account_name: str, application_name: str, **kwargs: Any) -> None:
"""Deletes an application.
:param resource_group_name: The name of the resource group that contains the Batch account.
@@ -227,7 +224,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -284,7 +281,7 @@ async def get(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -415,7 +412,7 @@ async def update(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -494,7 +491,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListApplicationsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py
index f9b516a08ecc..f825fb8c22f8 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_application_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -166,7 +165,7 @@ async def activate(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -328,7 +327,7 @@ async def create(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -388,7 +387,7 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, account_name: str, application_name: str, version_name: str, **kwargs: Any
) -> None:
"""Deletes an application package record and its associated binary file.
@@ -407,7 +406,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -467,7 +466,7 @@ async def get(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -543,7 +542,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListApplicationPackagesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py
index eb8cd93e8fd2..905ea0f0ee63 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -18,39 +17,31 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
- StreamClosedError,
- StreamConsumedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
-from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
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 azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
from ...operations._batch_account_operations import (
- build_create_request,
- build_delete_request,
build_get_detector_request,
build_get_keys_request,
- build_get_request,
build_list_by_resource_group_request,
build_list_detectors_request,
build_list_outbound_network_dependencies_endpoints_request,
build_list_request,
build_regenerate_key_request,
build_synchronize_auto_storage_keys_request,
- build_update_request,
)
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,513 +65,6 @@ 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 _create_initial(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]],
- **kwargs: Any
- ) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IOBase, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BatchAccountCreateParameters")
-
- _request = build_create_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _decompress = kwargs.pop("decompress", True)
- _stream = True
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- 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)
-
- response_headers = {}
- if response.status_code == 202:
- response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
- response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
-
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
-
- @overload
- async def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: _models.BatchAccountCreateParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> AsyncLROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountCreateParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: An instance of AsyncLROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: IO[bytes],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> AsyncLROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Required.
- :type parameters: IO[bytes]
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: An instance of AsyncLROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]],
- **kwargs: Any
- ) -> AsyncLROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Is either a
- BatchAccountCreateParameters type or a IO[bytes] type. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountCreateParameters or IO[bytes]
- :return: An instance of AsyncLROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BatchAccount] = kwargs.pop("cls", None)
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
- 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._create_initial(
- resource_group_name=resource_group_name,
- account_name=account_name,
- parameters=parameters,
- api_version=api_version,
- content_type=content_type,
- cls=lambda x, y, z: x,
- headers=_headers,
- 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("BatchAccount", pipeline_response.http_response)
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
-
- if polling is True:
- polling_method: AsyncPollingMethod = cast(
- AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
- else:
- polling_method = polling
- if cont_token:
- return AsyncLROPoller[_models.BatchAccount].from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return AsyncLROPoller[_models.BatchAccount](
- self._client, raw_result, get_long_running_output, polling_method # type: ignore
- )
-
- @overload
- async def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: _models.BatchAccountUpdateParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountUpdateParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- async def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: IO[bytes],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Required.
- :type parameters: IO[bytes]
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace_async
- async def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountUpdateParameters, IO[bytes]],
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Is either a
- BatchAccountUpdateParameters type or a IO[bytes] type. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountUpdateParameters or IO[bytes]
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BatchAccount] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IOBase, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BatchAccountUpdateParameters")
-
- _request = build_update_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BatchAccount", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
- async def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _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[AsyncIterator[bytes]] = kwargs.pop("cls", None)
-
- _request = build_delete_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _decompress = kwargs.pop("decompress", True)
- _stream = True
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- 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)
-
- response_headers = {}
- if response.status_code == 202:
- response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
- response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
-
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
-
- @distributed_trace_async
- async def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
- """Deletes the specified Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
- :rtype: ~azure.core.polling.AsyncLROPoller[None]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _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)
- polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
- 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(
- resource_group_name=resource_group_name,
- account_name=account_name,
- api_version=api_version,
- cls=lambda x, y, z: x,
- headers=_headers,
- 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
- if cls:
- return cls(pipeline_response, None, {}) # type: ignore
-
- if polling is True:
- polling_method: AsyncPollingMethod = cast(
- AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
- else:
- polling_method = polling
- if cont_token:
- return AsyncLROPoller[None].from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- @distributed_trace_async
- async def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.BatchAccount:
- """Gets information about the specified Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _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[_models.BatchAccount] = kwargs.pop("cls", None)
-
- _request = build_get_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BatchAccount", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.BatchAccount"]:
"""Gets information about the Batch accounts associated with the subscription.
@@ -595,7 +79,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.BatchAccount"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BatchAccountListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -672,7 +156,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BatchAccountListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -734,9 +218,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
- async def synchronize_auto_storage_keys( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, account_name: str, **kwargs: Any
- ) -> None:
+ async def synchronize_auto_storage_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -> None:
"""Synchronizes access keys for the auto-storage account configured for the specified Batch
account, only if storage key authentication is being used.
@@ -749,7 +231,7 @@ async def synchronize_auto_storage_keys( # pylint: disable=inconsistent-return-
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -878,7 +360,7 @@ async def regenerate_key(
:rtype: ~azure.mgmt.batch.models.BatchAccountKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -950,7 +432,7 @@ async def get_keys(self, resource_group_name: str, account_name: str, **kwargs:
:rtype: ~azure.mgmt.batch.models.BatchAccountKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1013,7 +495,7 @@ def list_detectors(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DetectorListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1092,7 +574,7 @@ async def get_detector(
:rtype: ~azure.mgmt.batch.models.DetectorResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1144,7 +626,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo
specify, you must make sure your network allows outbound access to these endpoints. Failure to
allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For
more information about creating a pool inside of a virtual network, see
- https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network.
+ https://learn.microsoft.com/azure/batch/batch-virtual-network.
:param resource_group_name: The name of the resource group that contains the Batch account.
Required.
@@ -1163,7 +645,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py
index 34d762e60f16..8b1ad93621c3 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_certificate_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -44,7 +43,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -110,7 +109,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListCertificatesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -305,7 +304,7 @@ async def create(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -480,7 +479,7 @@ async def update(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -542,7 +541,7 @@ async def update(
async def _delete_initial(
self, resource_group_name: str, account_name: str, certificate_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -684,7 +683,7 @@ async def get(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -760,7 +759,7 @@ async def cancel_deletion(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py
index 75c99df5f828..d5c2edff2e26 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_location_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -37,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +70,7 @@ async def get_quotas(self, location_name: str, **kwargs: Any) -> _models.BatchLo
:rtype: ~azure.mgmt.batch.models.BatchLocationQuota
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -136,7 +135,7 @@ def list_supported_virtual_machine_skus(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SupportedSkusResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -255,7 +254,7 @@ async def check_name_availability(
:rtype: ~azure.mgmt.batch.models.CheckNameAvailabilityResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_network_security_perimeter_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_network_security_perimeter_operations.py
index 3470186e0988..e76648645b39 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_network_security_perimeter_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_network_security_perimeter_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,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -87,7 +86,7 @@ def list_configurations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -171,7 +170,7 @@ async def get_configuration(
:rtype: ~azure.mgmt.batch.models.NetworkSecurityPerimeterConfiguration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -221,7 +220,7 @@ async def _reconcile_configuration_initial(
network_security_perimeter_configuration_name: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py
index 70847053dc83..77d38d404a21 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -69,7 +68,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py
index dbf5c93b009e..269de3629761 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_pool_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -45,7 +44,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -117,7 +116,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPoolsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -294,7 +293,7 @@ async def create(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -454,7 +453,7 @@ async def update(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -516,7 +515,7 @@ async def update(
async def _delete_initial(
self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -644,7 +643,7 @@ async def get(self, resource_group_name: str, account_name: str, pool_name: str,
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -707,7 +706,7 @@ async def disable_auto_scale(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -777,7 +776,7 @@ async def stop_resize(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py
index b412146c0669..779eaf302b6b 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_endpoint_connection_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,7 +91,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPrivateEndpointConnectionsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -173,7 +172,7 @@ async def get(
:rtype: ~azure.mgmt.batch.models.PrivateEndpointConnection
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -225,7 +224,7 @@ async def _update_initial(
if_match: Optional[str] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -455,7 +454,7 @@ def get_long_running_output(pipeline_response):
async def _delete_initial(
self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py
index 717ff683c703..db883e3c2bd6 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_private_link_resource_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,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +79,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPrivateLinkResourcesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -161,7 +160,7 @@ async def get(
:rtype: ~azure.mgmt.batch.models.PrivateLinkResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py
index b5e36793db93..32cfc1cf257c 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/__init__.py
@@ -5,182 +5,193 @@
# 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 AccessRule
-from ._models_py3 import AccessRuleProperties
-from ._models_py3 import AccessRulePropertiesSubscriptionsItem
-from ._models_py3 import ActivateApplicationPackageParameters
-from ._models_py3 import Application
-from ._models_py3 import ApplicationPackage
-from ._models_py3 import ApplicationPackageReference
-from ._models_py3 import AutoScaleRun
-from ._models_py3 import AutoScaleRunError
-from ._models_py3 import AutoScaleSettings
-from ._models_py3 import AutoStorageBaseProperties
-from ._models_py3 import AutoStorageProperties
-from ._models_py3 import AutoUserSpecification
-from ._models_py3 import AutomaticOSUpgradePolicy
-from ._models_py3 import AzureBlobFileSystemConfiguration
-from ._models_py3 import AzureFileShareConfiguration
-from ._models_py3 import AzureProxyResource
-from ._models_py3 import AzureResource
-from ._models_py3 import BatchAccount
-from ._models_py3 import BatchAccountCreateParameters
-from ._models_py3 import BatchAccountIdentity
-from ._models_py3 import BatchAccountKeys
-from ._models_py3 import BatchAccountListResult
-from ._models_py3 import BatchAccountRegenerateKeyParameters
-from ._models_py3 import BatchAccountUpdateParameters
-from ._models_py3 import BatchLocationQuota
-from ._models_py3 import BatchPoolIdentity
-from ._models_py3 import CIFSMountConfiguration
-from ._models_py3 import Certificate
-from ._models_py3 import CertificateBaseProperties
-from ._models_py3 import CertificateCreateOrUpdateParameters
-from ._models_py3 import CertificateCreateOrUpdateProperties
-from ._models_py3 import CertificateProperties
-from ._models_py3 import CertificateReference
-from ._models_py3 import CheckNameAvailabilityParameters
-from ._models_py3 import CheckNameAvailabilityResult
-from ._models_py3 import CloudErrorBody
-from ._models_py3 import ComputeNodeIdentityReference
-from ._models_py3 import ContainerConfiguration
-from ._models_py3 import ContainerHostBatchBindMountEntry
-from ._models_py3 import ContainerRegistry
-from ._models_py3 import DataDisk
-from ._models_py3 import DeleteCertificateError
-from ._models_py3 import DeploymentConfiguration
-from ._models_py3 import DetectorListResult
-from ._models_py3 import DetectorResponse
-from ._models_py3 import DiffDiskSettings
-from ._models_py3 import DiskEncryptionConfiguration
-from ._models_py3 import EncryptionProperties
-from ._models_py3 import EndpointAccessProfile
-from ._models_py3 import EndpointDependency
-from ._models_py3 import EndpointDetail
-from ._models_py3 import EnvironmentSetting
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import FixedScaleSettings
-from ._models_py3 import IPRule
-from ._models_py3 import ImageReference
-from ._models_py3 import InboundNatPool
-from ._models_py3 import KeyVaultProperties
-from ._models_py3 import KeyVaultReference
-from ._models_py3 import LinuxUserConfiguration
-from ._models_py3 import ListApplicationPackagesResult
-from ._models_py3 import ListApplicationsResult
-from ._models_py3 import ListCertificatesResult
-from ._models_py3 import ListPoolsResult
-from ._models_py3 import ListPrivateEndpointConnectionsResult
-from ._models_py3 import ListPrivateLinkResourcesResult
-from ._models_py3 import ManagedDisk
-from ._models_py3 import MetadataItem
-from ._models_py3 import MountConfiguration
-from ._models_py3 import NFSMountConfiguration
-from ._models_py3 import NetworkConfiguration
-from ._models_py3 import NetworkProfile
-from ._models_py3 import NetworkSecurityGroupRule
-from ._models_py3 import NetworkSecurityPerimeter
-from ._models_py3 import NetworkSecurityPerimeterConfiguration
-from ._models_py3 import NetworkSecurityPerimeterConfigurationListResult
-from ._models_py3 import NetworkSecurityPerimeterConfigurationProperties
-from ._models_py3 import NetworkSecurityProfile
-from ._models_py3 import NodePlacementConfiguration
-from ._models_py3 import OSDisk
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import OutboundEnvironmentEndpoint
-from ._models_py3 import OutboundEnvironmentEndpointCollection
-from ._models_py3 import Pool
-from ._models_py3 import PoolEndpointConfiguration
-from ._models_py3 import PrivateEndpoint
-from ._models_py3 import PrivateEndpointConnection
-from ._models_py3 import PrivateLinkResource
-from ._models_py3 import PrivateLinkServiceConnectionState
-from ._models_py3 import ProvisioningIssue
-from ._models_py3 import ProvisioningIssueProperties
-from ._models_py3 import ProxyResource
-from ._models_py3 import PublicIPAddressConfiguration
-from ._models_py3 import ResizeError
-from ._models_py3 import ResizeOperationStatus
-from ._models_py3 import Resource
-from ._models_py3 import ResourceAssociation
-from ._models_py3 import ResourceFile
-from ._models_py3 import RollingUpgradePolicy
-from ._models_py3 import ScaleSettings
-from ._models_py3 import SecurityProfile
-from ._models_py3 import ServiceArtifactReference
-from ._models_py3 import SkuCapability
-from ._models_py3 import StartTask
-from ._models_py3 import SupportedSku
-from ._models_py3 import SupportedSkusResult
-from ._models_py3 import SystemData
-from ._models_py3 import TaskContainerSettings
-from ._models_py3 import TaskSchedulingPolicy
-from ._models_py3 import UefiSettings
-from ._models_py3 import UpgradePolicy
-from ._models_py3 import UserAccount
-from ._models_py3 import UserAssignedIdentities
-from ._models_py3 import UserIdentity
-from ._models_py3 import VMDiskSecurityProfile
-from ._models_py3 import VMExtension
-from ._models_py3 import VirtualMachineConfiguration
-from ._models_py3 import VirtualMachineFamilyCoreQuota
-from ._models_py3 import WindowsConfiguration
-from ._models_py3 import WindowsUserConfiguration
+from typing import TYPE_CHECKING
-from ._batch_management_client_enums import AccessRuleDirection
-from ._batch_management_client_enums import AccountKeyType
-from ._batch_management_client_enums import AllocationState
-from ._batch_management_client_enums import AuthenticationMode
-from ._batch_management_client_enums import AutoStorageAuthenticationMode
-from ._batch_management_client_enums import AutoUserScope
-from ._batch_management_client_enums import CachingType
-from ._batch_management_client_enums import CertificateFormat
-from ._batch_management_client_enums import CertificateProvisioningState
-from ._batch_management_client_enums import CertificateStoreLocation
-from ._batch_management_client_enums import CertificateVisibility
-from ._batch_management_client_enums import ComputeNodeDeallocationOption
-from ._batch_management_client_enums import ComputeNodeFillType
-from ._batch_management_client_enums import ContainerHostDataPath
-from ._batch_management_client_enums import ContainerType
-from ._batch_management_client_enums import ContainerWorkingDirectory
-from ._batch_management_client_enums import CreatedByType
-from ._batch_management_client_enums import DiskEncryptionTarget
-from ._batch_management_client_enums import DynamicVNetAssignmentScope
-from ._batch_management_client_enums import ElevationLevel
-from ._batch_management_client_enums import EndpointAccessDefaultAction
-from ._batch_management_client_enums import IPAddressProvisioningType
-from ._batch_management_client_enums import InboundEndpointProtocol
-from ._batch_management_client_enums import InterNodeCommunicationState
-from ._batch_management_client_enums import IssueType
-from ._batch_management_client_enums import KeySource
-from ._batch_management_client_enums import LoginMode
-from ._batch_management_client_enums import NameAvailabilityReason
-from ._batch_management_client_enums import NetworkSecurityGroupRuleAccess
-from ._batch_management_client_enums import NetworkSecurityPerimeterConfigurationProvisioningState
-from ._batch_management_client_enums import NodeCommunicationMode
-from ._batch_management_client_enums import NodePlacementPolicyType
-from ._batch_management_client_enums import PackageState
-from ._batch_management_client_enums import PoolAllocationMode
-from ._batch_management_client_enums import PoolIdentityType
-from ._batch_management_client_enums import PoolProvisioningState
-from ._batch_management_client_enums import PrivateEndpointConnectionProvisioningState
-from ._batch_management_client_enums import PrivateLinkServiceConnectionStatus
-from ._batch_management_client_enums import ProvisioningState
-from ._batch_management_client_enums import PublicNetworkAccessType
-from ._batch_management_client_enums import ResourceAssociationAccessMode
-from ._batch_management_client_enums import ResourceIdentityType
-from ._batch_management_client_enums import SecurityEncryptionTypes
-from ._batch_management_client_enums import SecurityTypes
-from ._batch_management_client_enums import Severity
-from ._batch_management_client_enums import StorageAccountType
-from ._batch_management_client_enums import UpgradeMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AccessRule,
+ AccessRuleProperties,
+ AccessRulePropertiesSubscriptionsItem,
+ ActivateApplicationPackageParameters,
+ Application,
+ ApplicationPackage,
+ ApplicationPackageReference,
+ AutoScaleRun,
+ AutoScaleRunError,
+ AutoScaleSettings,
+ AutoStorageBaseProperties,
+ AutoStorageProperties,
+ AutoUserSpecification,
+ AutomaticOSUpgradePolicy,
+ AzureBlobFileSystemConfiguration,
+ AzureFileShareConfiguration,
+ AzureProxyResource,
+ AzureResource,
+ BatchAccount,
+ BatchAccountCreateParameters,
+ BatchAccountIdentity,
+ BatchAccountKeys,
+ BatchAccountListResult,
+ BatchAccountRegenerateKeyParameters,
+ BatchAccountUpdateParameters,
+ BatchLocationQuota,
+ BatchPoolIdentity,
+ CIFSMountConfiguration,
+ Certificate,
+ CertificateBaseProperties,
+ CertificateCreateOrUpdateParameters,
+ CertificateCreateOrUpdateProperties,
+ CertificateProperties,
+ CertificateReference,
+ CheckNameAvailabilityParameters,
+ CheckNameAvailabilityResult,
+ CloudErrorBody,
+ ComputeNodeIdentityReference,
+ ContainerConfiguration,
+ ContainerHostBatchBindMountEntry,
+ ContainerRegistry,
+ DataDisk,
+ DeleteCertificateError,
+ DeploymentConfiguration,
+ DetectorListResult,
+ DetectorResponse,
+ DiffDiskSettings,
+ DiskEncryptionConfiguration,
+ EncryptionProperties,
+ EndpointAccessProfile,
+ EndpointDependency,
+ EndpointDetail,
+ EnvironmentSetting,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ FixedScaleSettings,
+ IPRule,
+ ImageReference,
+ InboundNatPool,
+ KeyVaultProperties,
+ KeyVaultReference,
+ LinuxUserConfiguration,
+ ListApplicationPackagesResult,
+ ListApplicationsResult,
+ ListCertificatesResult,
+ ListPoolsResult,
+ ListPrivateEndpointConnectionsResult,
+ ListPrivateLinkResourcesResult,
+ ManagedDisk,
+ MetadataItem,
+ MountConfiguration,
+ NFSMountConfiguration,
+ NetworkConfiguration,
+ NetworkProfile,
+ NetworkSecurityGroupRule,
+ NetworkSecurityPerimeter,
+ NetworkSecurityPerimeterConfiguration,
+ NetworkSecurityPerimeterConfigurationListResult,
+ NetworkSecurityPerimeterConfigurationProperties,
+ NetworkSecurityProfile,
+ NodePlacementConfiguration,
+ OSDisk,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ OutboundEnvironmentEndpoint,
+ OutboundEnvironmentEndpointCollection,
+ Pool,
+ PoolEndpointConfiguration,
+ PrivateEndpoint,
+ PrivateEndpointConnection,
+ PrivateLinkResource,
+ PrivateLinkServiceConnectionState,
+ ProvisioningIssue,
+ ProvisioningIssueProperties,
+ ProxyResource,
+ PublicIPAddressConfiguration,
+ ResizeError,
+ ResizeOperationStatus,
+ Resource,
+ ResourceAssociation,
+ ResourceFile,
+ RollingUpgradePolicy,
+ ScaleSettings,
+ SecurityProfile,
+ ServiceArtifactReference,
+ SkuCapability,
+ StartTask,
+ SupportedSku,
+ SupportedSkusResult,
+ SystemData,
+ TaskContainerSettings,
+ TaskSchedulingPolicy,
+ UefiSettings,
+ UpgradePolicy,
+ UserAccount,
+ UserAssignedIdentities,
+ UserIdentity,
+ VMDiskSecurityProfile,
+ VMExtension,
+ VirtualMachineConfiguration,
+ VirtualMachineFamilyCoreQuota,
+ WindowsConfiguration,
+ WindowsUserConfiguration,
+)
+
+from ._batch_management_client_enums import ( # type: ignore
+ AccessRuleDirection,
+ AccountKeyType,
+ AllocationState,
+ AuthenticationMode,
+ AutoStorageAuthenticationMode,
+ AutoUserScope,
+ CachingType,
+ CertificateFormat,
+ CertificateProvisioningState,
+ CertificateStoreLocation,
+ CertificateVisibility,
+ ComputeNodeDeallocationOption,
+ ComputeNodeFillType,
+ ContainerHostDataPath,
+ ContainerType,
+ ContainerWorkingDirectory,
+ CreatedByType,
+ DiskEncryptionTarget,
+ DynamicVNetAssignmentScope,
+ ElevationLevel,
+ EndpointAccessDefaultAction,
+ IPAddressProvisioningType,
+ InboundEndpointProtocol,
+ InterNodeCommunicationState,
+ IssueType,
+ KeySource,
+ LoginMode,
+ NameAvailabilityReason,
+ NetworkSecurityGroupRuleAccess,
+ NetworkSecurityPerimeterConfigurationProvisioningState,
+ NodeCommunicationMode,
+ NodePlacementPolicyType,
+ PackageState,
+ PoolAllocationMode,
+ PoolIdentityType,
+ PoolProvisioningState,
+ PrivateEndpointConnectionProvisioningState,
+ PrivateLinkServiceConnectionStatus,
+ ProvisioningState,
+ PublicNetworkAccessType,
+ ResourceAssociationAccessMode,
+ ResourceIdentityType,
+ SecurityEncryptionTypes,
+ SecurityTypes,
+ Severity,
+ StorageAccountType,
+ UpgradeMode,
+)
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__ = [
@@ -357,5 +368,5 @@
"StorageAccountType",
"UpgradeMode",
]
-__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/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py
index 5741d1b9178d..560f636b76e0 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_batch_management_client_enums.py
@@ -554,12 +554,12 @@ class StorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
class UpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control the application
- of updates to virtual machines in the scale set. You do this by using the manualUpgrade
- action.:code:`
`:code:`
` **Automatic** - All virtual machines in the scale set are
- automatically updated at the same time.:code:`
`:code:`
` **Rolling** - Scale set
- performs updates in batches with an optional pause time in between.
+ """Specifies the mode of an upgrade to virtual machines in the scale set.\\ :code:`
`\\
+ :code:`
` Possible values are:\\ :code:`
`\\ :code:`
` **Manual** - You control
+ the application of updates to virtual machines in the scale set. You do this by using the
+ manualUpgrade action.\\ :code:`
`\\ :code:`
` **Automatic** - All virtual machines in
+ the scale set are automatically updated at the same time.\\ :code:`
`\\ :code:`
`
+ **Rolling** - Scale set performs updates in batches with an optional pause time in between.
"""
AUTOMATIC = "automatic"
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py
index acc1693c921b..1f8e6425803d 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/models/_models_py3.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -398,9 +397,9 @@ class AutomaticOSUpgradePolicy(_serialization.Model):
:vartype disable_automatic_rollback: bool
:ivar enable_automatic_os_upgrade: Indicates whether OS upgrades should automatically be
applied to scale set instances in a rolling fashion when a newer version of the OS image
- becomes available. :code:`
`:code:`
` If this is set to true for Windows based pools,
- `WindowsConfiguration.enableAutomaticUpdates
- `_
+ becomes available. :code:`
`\\ :code:`
` If this is set to true for Windows based
+ pools, `WindowsConfiguration.enableAutomaticUpdates
+ `_
cannot be set to true.
:vartype enable_automatic_os_upgrade: bool
:ivar use_rolling_upgrade_policy: Indicates whether rolling upgrade policy should be used
@@ -432,9 +431,9 @@ def __init__(
:paramtype disable_automatic_rollback: bool
:keyword enable_automatic_os_upgrade: Indicates whether OS upgrades should automatically be
applied to scale set instances in a rolling fashion when a newer version of the OS image
- becomes available. :code:`
`:code:`
` If this is set to true for Windows based pools,
- `WindowsConfiguration.enableAutomaticUpdates
- `_
+ becomes available. :code:`
`\\ :code:`
` If this is set to true for Windows based
+ pools, `WindowsConfiguration.enableAutomaticUpdates
+ `_
cannot be set to true.
:paramtype enable_automatic_os_upgrade: bool
:keyword use_rolling_upgrade_policy: Indicates whether rolling upgrade policy should be used
@@ -925,7 +924,7 @@ def __init__(self, **kwargs: Any) -> None:
self.tags = None
-class BatchAccount(AzureResource): # pylint: disable=too-many-instance-attributes
+class BatchAccount(AzureResource):
"""Contains information about an Azure Batch account.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1503,7 +1502,7 @@ def __init__(
self.user_assigned_identities = user_assigned_identities
-class Certificate(AzureProxyResource): # pylint: disable=too-many-instance-attributes
+class Certificate(AzureProxyResource):
"""Contains information about a certificate.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -2555,9 +2554,9 @@ class DiffDiskSettings(_serialization.Model):
operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For
more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size
requirements for Windows VMs at
- https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
+ https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
and Linux VMs at
- https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements.
+ https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements.
Default value is "CacheDisk".
:vartype placement: str
"""
@@ -2572,9 +2571,9 @@ def __init__(self, *, placement: Optional[Literal["CacheDisk"]] = None, **kwargs
the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning.
For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk
size requirements for Windows VMs at
- https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
+ https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements
and Linux VMs at
- https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements.
+ https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements.
Default value is "CacheDisk".
:paramtype placement: str
"""
@@ -2943,7 +2942,7 @@ class ImageReference(_serialization.Model):
:ivar id: This property is mutually exclusive with other properties. The Azure Compute Gallery
Image must have replicas in the same region as the Azure Batch account. For information about
the firewall settings for the Batch node agent to communicate with the Batch service see
- https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
+ https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
:vartype id: str
:ivar shared_gallery_image_id: This property is mutually exclusive with other properties and
can be fetched from shared gallery image GET call.
@@ -2988,7 +2987,7 @@ def __init__(
:keyword id: This property is mutually exclusive with other properties. The Azure Compute
Gallery Image must have replicas in the same region as the Azure Batch account. For information
about the firewall settings for the Batch node agent to communicate with the Batch service see
- https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
+ https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
:paramtype id: str
:keyword shared_gallery_image_id: This property is mutually exclusive with other properties and
can be fetched from shared gallery image GET call.
@@ -3021,8 +3020,8 @@ class InboundNatPool(_serialization.Model):
:ivar protocol: The protocol of the endpoint. Required. Known values are: "TCP" and "UDP".
:vartype protocol: str or ~azure.mgmt.batch.models.InboundEndpointProtocol
:ivar backend_port: This must be unique within a Batch pool. Acceptable values are between 1
- and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values
- are provided the request fails with HTTP status code 400. Required.
+ and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided
+ the request fails with HTTP status code 400. Required.
:vartype backend_port: int
:ivar frontend_port_range_start: Acceptable values range between 1 and 65534 except ports from
50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot
@@ -3079,8 +3078,8 @@ def __init__(
:keyword protocol: The protocol of the endpoint. Required. Known values are: "TCP" and "UDP".
:paramtype protocol: str or ~azure.mgmt.batch.models.InboundEndpointProtocol
:keyword backend_port: This must be unique within a Batch pool. Acceptable values are between 1
- and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values
- are provided the request fails with HTTP status code 400. Required.
+ and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided
+ the request fails with HTTP status code 400. Required.
:paramtype backend_port: int
:keyword frontend_port_range_start: Acceptable values range between 1 and 65534 except ports
from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot
@@ -3587,10 +3586,9 @@ class NetworkConfiguration(_serialization.Model):
communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch
service will set the state of the compute nodes to unusable. If the specified VNet has any
associated Network Security Groups (NSG), then a few reserved system ports must be enabled for
- inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389
- for Windows. Also enable outbound connections to Azure Storage on port 443. For more details
- see:
- https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
+ inbound communication,including ports 29876 and 29877. Also enable outbound connections to
+ Azure Storage on port 443. For more details see:
+ https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
:vartype subnet_id: str
:ivar dynamic_vnet_assignment_scope: The scope of dynamic vnet assignment. Known values are:
"none" and "job".
@@ -3641,10 +3639,9 @@ def __init__(
communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch
service will set the state of the compute nodes to unusable. If the specified VNet has any
associated Network Security Groups (NSG), then a few reserved system ports must be enabled for
- inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389
- for Windows. Also enable outbound connections to Azure Storage on port 443. For more details
- see:
- https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
+ inbound communication,including ports 29876 and 29877. Also enable outbound connections to
+ Azure Storage on port 443. For more details see:
+ https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
:paramtype subnet_id: str
:keyword dynamic_vnet_assignment_scope: The scope of dynamic vnet assignment. Known values are:
"none" and "job".
@@ -4383,7 +4380,7 @@ def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None:
self.next_link = next_link
-class Pool(AzureProxyResource): # pylint: disable=too-many-instance-attributes
+class Pool(AzureProxyResource):
"""Contains information about a pool.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -4420,12 +4417,10 @@ class Pool(AzureProxyResource): # pylint: disable=too-many-instance-attributes
:ivar allocation_state_transition_time: The time at which the pool entered its current
allocation state.
:vartype allocation_state_transition_time: ~datetime.datetime
- :ivar vm_size: For information about available VM sizes, see Sizes for Virtual Machines (Linux)
- (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for
- Virtual Machines (Windows)
- (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch
- supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS,
- STANDARD_DS, and STANDARD_DSV2 series).
+ :ivar vm_size: For information about available VM sizes, see Sizes for Virtual Machines in
+ Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all
+ Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and
+ STANDARD_DSV2 series).
:vartype vm_size: str
:ivar deployment_configuration: Deployment configuration properties.
:vartype deployment_configuration: ~azure.mgmt.batch.models.DeploymentConfiguration
@@ -4592,12 +4587,10 @@ def __init__( # pylint: disable=too-many-locals
:keyword display_name: The display name need not be unique and can contain any Unicode
characters up to a maximum length of 1024.
:paramtype display_name: str
- :keyword vm_size: For information about available VM sizes, see Sizes for Virtual Machines
- (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or
- Sizes for Virtual Machines (Windows)
- (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch
- supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS,
- STANDARD_DS, and STANDARD_DSV2 series).
+ :keyword vm_size: For information about available VM sizes, see Sizes for Virtual Machines in
+ Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all
+ Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and
+ STANDARD_DSV2 series).
:paramtype vm_size: str
:keyword deployment_configuration: Deployment configuration properties.
:paramtype deployment_configuration: ~azure.mgmt.batch.models.DeploymentConfiguration
@@ -5970,13 +5963,13 @@ class UpgradePolicy(_serialization.Model):
All required parameters must be populated in order to send to server.
- :ivar mode: Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control
- the application of updates to virtual machines in the scale set. You do this by using the
- manualUpgrade action.:code:`
`:code:`
` **Automatic** - All virtual machines in the
- scale set are automatically updated at the same time.:code:`
`:code:`
` **Rolling** -
- Scale set performs updates in batches with an optional pause time in between. Required. Known
- values are: "automatic", "manual", and "rolling".
+ :ivar mode: Specifies the mode of an upgrade to virtual machines in the scale set.\\ :code:`
`\\ :code:`
` Possible values are:\\ :code:`
`\\ :code:`
` **Manual** - You
+ control the application of updates to virtual machines in the scale set. You do this by using
+ the manualUpgrade action.\\ :code:`
`\\ :code:`
` **Automatic** - All virtual
+ machines in the scale set are automatically updated at the same time.\\ :code:`
`\\
+ :code:`
` **Rolling** - Scale set performs updates in batches with an optional pause time
+ in between. Required. Known values are: "automatic", "manual", and "rolling".
:vartype mode: str or ~azure.mgmt.batch.models.UpgradeMode
:ivar automatic_os_upgrade_policy: The configuration parameters used for performing automatic
OS upgrade.
@@ -6005,13 +5998,13 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword mode: Specifies the mode of an upgrade to virtual machines in the scale set.:code:`
`:code:`
` Possible values are::code:`
`:code:`
` **Manual** - You control
- the application of updates to virtual machines in the scale set. You do this by using the
- manualUpgrade action.:code:`
`:code:`
` **Automatic** - All virtual machines in the
- scale set are automatically updated at the same time.:code:`
`:code:`
` **Rolling** -
- Scale set performs updates in batches with an optional pause time in between. Required. Known
- values are: "automatic", "manual", and "rolling".
+ :keyword mode: Specifies the mode of an upgrade to virtual machines in the scale set.\\
+ :code:`
`\\ :code:`
` Possible values are:\\ :code:`
`\\ :code:`
`
+ **Manual** - You control the application of updates to virtual machines in the scale set. You
+ do this by using the manualUpgrade action.\\ :code:`
`\\ :code:`
` **Automatic** -
+ All virtual machines in the scale set are automatically updated at the same time.\\ :code:`
`\\ :code:`
` **Rolling** - Scale set performs updates in batches with an optional pause
+ time in between. Required. Known values are: "automatic", "manual", and "rolling".
:paramtype mode: str or ~azure.mgmt.batch.models.UpgradeMode
:keyword automatic_os_upgrade_policy: The configuration parameters used for performing
automatic OS upgrade.
@@ -6162,7 +6155,7 @@ def __init__(
self.auto_user = auto_user
-class VirtualMachineConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class VirtualMachineConfiguration(_serialization.Model):
"""The configuration for compute nodes in a pool based on the Azure Virtual Machines
infrastructure.
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py
index 5ef1210d26db..30ba1a1427e2 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/__init__.py
@@ -5,20 +5,26 @@
# 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 ._batch_account_operations import BatchAccountOperations
-from ._application_package_operations import ApplicationPackageOperations
-from ._application_operations import ApplicationOperations
-from ._location_operations import LocationOperations
-from ._operations import Operations
-from ._certificate_operations import CertificateOperations
-from ._private_link_resource_operations import PrivateLinkResourceOperations
-from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations
-from ._pool_operations import PoolOperations
-from ._network_security_perimeter_operations import NetworkSecurityPerimeterOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._batch_account_operations import BatchAccountOperations # type: ignore
+from ._application_package_operations import ApplicationPackageOperations # type: ignore
+from ._application_operations import ApplicationOperations # type: ignore
+from ._location_operations import LocationOperations # type: ignore
+from ._operations import Operations # type: ignore
+from ._certificate_operations import CertificateOperations # type: ignore
+from ._private_link_resource_operations import PrivateLinkResourceOperations # type: ignore
+from ._private_endpoint_connection_operations import PrivateEndpointConnectionOperations # type: ignore
+from ._pool_operations import PoolOperations # type: ignore
+from ._network_security_perimeter_operations import NetworkSecurityPerimeterOperations # 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__ = [
@@ -33,5 +39,5 @@
"PoolOperations",
"NetworkSecurityPerimeterOperations",
]
-__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/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py
index 7c5e920613f2..9163b24814b4 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -337,7 +336,7 @@ def create(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -413,7 +412,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -470,7 +469,7 @@ def get(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -601,7 +600,7 @@ def update(
:rtype: ~azure.mgmt.batch.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -680,7 +679,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListApplicationsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py
index 6ed170ffd5a0..b406834eabfe 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_application_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -388,7 +387,7 @@ def activate(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -550,7 +549,7 @@ def create(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -629,7 +628,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -689,7 +688,7 @@ def get(
:rtype: ~azure.mgmt.batch.models.ApplicationPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -765,7 +764,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListApplicationPackagesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py
index e801056288a5..2d3237bab20c 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_batch_account_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -17,18 +16,14 @@
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
- StreamClosedError,
- StreamConsumedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
-from azure.core.polling import LROPoller, NoPolling, PollingMethod
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 azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
from .._serialization import Serializer
@@ -36,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -44,142 +39,6 @@
_SERIALIZER.client_side_validation = False
-def build_create_request(
- resource_group_name: str, account_name: str, subscription_id: str, **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-07-01"))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
- "accountName": _SERIALIZER.url(
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-z0-9]+$"
- ),
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
- }
-
- _url: str = _url.format(**path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_update_request(
- resource_group_name: str, account_name: str, subscription_id: str, **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-07-01"))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
- "accountName": _SERIALIZER.url(
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-zA-Z0-9]+$"
- ),
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
- }
-
- _url: str = _url.format(**path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- if content_type is not None:
- _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_delete_request(
- resource_group_name: str, account_name: str, subscription_id: str, **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-07-01"))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
- "accountName": _SERIALIZER.url(
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-zA-Z0-9]+$"
- ),
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
- }
-
- _url: str = _url.format(**path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
-
-
-def build_get_request(resource_group_name: str, account_name: str, subscription_id: str, **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-07-01"))
- accept = _headers.pop("Accept", "application/json")
-
- # Construct URL
- _url = kwargs.pop(
- "template_url",
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}",
- ) # pylint: disable=line-too-long
- path_format_arguments = {
- "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
- "accountName": _SERIALIZER.url(
- "account_name", account_name, "str", max_length=24, min_length=3, pattern=r"^[a-zA-Z0-9]+$"
- ),
- "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
- }
-
- _url: str = _url.format(**path_format_arguments) # type: ignore
-
- # Construct parameters
- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
-
- # Construct headers
- _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
-
- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
-
-
def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -453,513 +312,6 @@ 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 _create_initial(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]],
- **kwargs: Any
- ) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IOBase, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BatchAccountCreateParameters")
-
- _request = build_create_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _decompress = kwargs.pop("decompress", True)
- _stream = True
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- 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)
-
- response_headers = {}
- if response.status_code == 202:
- response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
- response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
-
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
-
- @overload
- def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: _models.BatchAccountCreateParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> LROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountCreateParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: An instance of LROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: IO[bytes],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> LROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Required.
- :type parameters: IO[bytes]
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: An instance of LROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def begin_create(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]],
- **kwargs: Any
- ) -> LROPoller[_models.BatchAccount]:
- """Creates a new Batch account with the specified parameters. Existing accounts cannot be updated
- with this API and should instead be updated with the Update Batch Account API.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: A name for the Batch account which must be unique within the region. Batch
- account names must be between 3 and 24 characters in length and must use only numbers and
- lowercase letters. This name is used as part of the DNS name that is used to access the Batch
- service in the region in which the account is created. For example:
- http://accountname.region.batch.azure.com/. Required.
- :type account_name: str
- :param parameters: Additional parameters for account creation. Is either a
- BatchAccountCreateParameters type or a IO[bytes] type. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountCreateParameters or IO[bytes]
- :return: An instance of LROPoller that returns either BatchAccount or the result of
- cls(response)
- :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.batch.models.BatchAccount]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BatchAccount] = kwargs.pop("cls", None)
- polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
- 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._create_initial(
- resource_group_name=resource_group_name,
- account_name=account_name,
- parameters=parameters,
- api_version=api_version,
- content_type=content_type,
- cls=lambda x, y, z: x,
- headers=_headers,
- 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("BatchAccount", pipeline_response.http_response)
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
- return deserialized
-
- if polling is True:
- polling_method: PollingMethod = cast(
- PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(PollingMethod, NoPolling())
- else:
- polling_method = polling
- if cont_token:
- return LROPoller[_models.BatchAccount].from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return LROPoller[_models.BatchAccount](
- self._client, raw_result, get_long_running_output, polling_method # type: ignore
- )
-
- @overload
- def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: _models.BatchAccountUpdateParameters,
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountUpdateParameters
- :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @overload
- def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: IO[bytes],
- *,
- content_type: str = "application/json",
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Required.
- :type parameters: IO[bytes]
- :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
- Default value is "application/json".
- :paramtype content_type: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
-
- @distributed_trace
- def update(
- self,
- resource_group_name: str,
- account_name: str,
- parameters: Union[_models.BatchAccountUpdateParameters, IO[bytes]],
- **kwargs: Any
- ) -> _models.BatchAccount:
- """Updates the properties of an existing Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :param parameters: Additional parameters for account update. Is either a
- BatchAccountUpdateParameters type or a IO[bytes] type. Required.
- :type parameters: ~azure.mgmt.batch.models.BatchAccountUpdateParameters or IO[bytes]
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _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", self._config.api_version))
- content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
- cls: ClsType[_models.BatchAccount] = kwargs.pop("cls", None)
-
- content_type = content_type or "application/json"
- _json = None
- _content = None
- if isinstance(parameters, (IOBase, bytes)):
- _content = parameters
- else:
- _json = self._serialize.body(parameters, "BatchAccountUpdateParameters")
-
- _request = build_update_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- content_type=content_type,
- json=_json,
- content=_content,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BatchAccount", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
- def _delete_initial(self, resource_group_name: str, account_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _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[Iterator[bytes]] = kwargs.pop("cls", None)
-
- _request = build_delete_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _decompress = kwargs.pop("decompress", True)
- _stream = True
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- 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)
-
- response_headers = {}
- if response.status_code == 202:
- response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
- response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
-
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
-
- if cls:
- return cls(pipeline_response, deserialized, response_headers) # type: ignore
-
- return deserialized # type: ignore
-
- @distributed_trace
- def begin_delete(self, resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]:
- """Deletes the specified Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :return: An instance of LROPoller that returns either None or the result of cls(response)
- :rtype: ~azure.core.polling.LROPoller[None]
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- _headers = kwargs.pop("headers", {}) or {}
- _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)
- polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
- 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(
- resource_group_name=resource_group_name,
- account_name=account_name,
- api_version=api_version,
- cls=lambda x, y, z: x,
- headers=_headers,
- 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
- if cls:
- return cls(pipeline_response, None, {}) # type: ignore
-
- if polling is True:
- polling_method: PollingMethod = cast(
- PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
- )
- elif polling is False:
- polling_method = cast(PollingMethod, NoPolling())
- else:
- polling_method = polling
- if cont_token:
- return LROPoller[None].from_continuation_token(
- polling_method=polling_method,
- continuation_token=cont_token,
- client=self._client,
- deserialization_callback=get_long_running_output,
- )
- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
-
- @distributed_trace
- def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _models.BatchAccount:
- """Gets information about the specified Batch account.
-
- :param resource_group_name: The name of the resource group that contains the Batch account.
- Required.
- :type resource_group_name: str
- :param account_name: The name of the Batch account. Required.
- :type account_name: str
- :return: BatchAccount or the result of cls(response)
- :rtype: ~azure.mgmt.batch.models.BatchAccount
- :raises ~azure.core.exceptions.HttpResponseError:
- """
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
- 401: ClientAuthenticationError,
- 404: ResourceNotFoundError,
- 409: ResourceExistsError,
- 304: ResourceNotModifiedError,
- }
- error_map.update(kwargs.pop("error_map", {}) or {})
-
- _headers = kwargs.pop("headers", {}) or {}
- _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[_models.BatchAccount] = kwargs.pop("cls", None)
-
- _request = build_get_request(
- resource_group_name=resource_group_name,
- account_name=account_name,
- subscription_id=self._config.subscription_id,
- api_version=api_version,
- headers=_headers,
- params=_params,
- )
- _request.url = self._client.format_url(_request.url)
-
- _stream = False
- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
- _request, stream=_stream, **kwargs
- )
-
- response = pipeline_response.http_response
-
- if response.status_code not in [200]:
- map_error(status_code=response.status_code, response=response, error_map=error_map)
- raise HttpResponseError(response=response, error_format=ARMErrorFormat)
-
- deserialized = self._deserialize("BatchAccount", pipeline_response.http_response)
-
- if cls:
- return cls(pipeline_response, deserialized, {}) # type: ignore
-
- return deserialized # type: ignore
-
@distributed_trace
def list(self, **kwargs: Any) -> Iterable["_models.BatchAccount"]:
"""Gets information about the Batch accounts associated with the subscription.
@@ -974,7 +326,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.BatchAccount"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BatchAccountListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1051,7 +403,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.BatchAccountListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1128,7 +480,7 @@ def synchronize_auto_storage_keys( # pylint: disable=inconsistent-return-statem
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1257,7 +609,7 @@ def regenerate_key(
:rtype: ~azure.mgmt.batch.models.BatchAccountKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1329,7 +681,7 @@ def get_keys(self, resource_group_name: str, account_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.batch.models.BatchAccountKeys
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1392,7 +744,7 @@ def list_detectors(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DetectorListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1471,7 +823,7 @@ def get_detector(
:rtype: ~azure.mgmt.batch.models.DetectorResponse
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1523,7 +875,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo
specify, you must make sure your network allows outbound access to these endpoints. Failure to
allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For
more information about creating a pool inside of a virtual network, see
- https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network.
+ https://learn.microsoft.com/azure/batch/batch-virtual-network.
:param resource_group_name: The name of the resource group that contains the Batch account.
Required.
@@ -1541,7 +893,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py
index 499accb1f93d..1eed228c0510 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_certificate_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -356,7 +356,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListCertificatesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -551,7 +551,7 @@ def create(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -726,7 +726,7 @@ def update(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -788,7 +788,7 @@ def update(
def _delete_initial(
self, resource_group_name: str, account_name: str, certificate_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -930,7 +930,7 @@ def get(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1006,7 +1006,7 @@ def cancel_deletion(
:rtype: ~azure.mgmt.batch.models.Certificate
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py
index 4736e41195d1..0a621bf2e2a5 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_location_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -166,7 +165,7 @@ def get_quotas(self, location_name: str, **kwargs: Any) -> _models.BatchLocation
:rtype: ~azure.mgmt.batch.models.BatchLocationQuota
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -231,7 +230,7 @@ def list_supported_virtual_machine_skus(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SupportedSkusResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -350,7 +349,7 @@ def check_name_availability(
:rtype: ~azure.mgmt.batch.models.CheckNameAvailabilityResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_network_security_perimeter_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_network_security_perimeter_operations.py
index 20614db6b24a..2ba12d7ca60f 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_network_security_perimeter_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_network_security_perimeter_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,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Iterator, Optional, Type, TypeVar, Union, cast
+from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast
import urllib.parse
from azure.core.exceptions import (
@@ -35,7 +34,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -204,7 +203,7 @@ def list_configurations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -288,7 +287,7 @@ def get_configuration(
:rtype: ~azure.mgmt.batch.models.NetworkSecurityPerimeterConfiguration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -338,7 +337,7 @@ def _reconcile_configuration_initial(
network_security_perimeter_configuration_name: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py
index b9e0a50dd2b7..468d12a89a17 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -91,7 +90,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py
index 0e732612b695..40bc3c1b41c1 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_pool_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -398,7 +398,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPoolsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +575,7 @@ def create(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -735,7 +735,7 @@ def update(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -797,7 +797,7 @@ def update(
def _delete_initial(
self, resource_group_name: str, account_name: str, pool_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -925,7 +925,7 @@ def get(self, resource_group_name: str, account_name: str, pool_name: str, **kwa
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -988,7 +988,7 @@ def disable_auto_scale(
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1056,7 +1056,7 @@ def stop_resize(self, resource_group_name: str, account_name: str, pool_name: st
:rtype: ~azure.mgmt.batch.models.Pool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py
index 1b2b8ee591cd..19053c890169 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_endpoint_connection_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +35,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -270,7 +269,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPrivateEndpointConnectionsResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -351,7 +350,7 @@ def get(
:rtype: ~azure.mgmt.batch.models.PrivateEndpointConnection
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -403,7 +402,7 @@ def _update_initial(
if_match: Optional[str] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -632,7 +631,7 @@ def get_long_running_output(pipeline_response):
def _delete_initial(
self, resource_group_name: str, account_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py
index ba62577ca744..9a32e9f61269 100644
--- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_operations.py
+++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/operations/_private_link_resource_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,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -163,7 +162,7 @@ def list_by_batch_account(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ListPrivateLinkResourcesResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -244,7 +243,7 @@ def get(
:rtype: ~azure.mgmt.batch.models.PrivateLinkResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_byos.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_byos.py
deleted file mode 100644
index 5cd3815907b4..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_byos.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_create_byos.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.begin_create(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "location": "japaneast",
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- },
- "keyVaultReference": {
- "id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
- "url": "http://sample.vault.azure.net/",
- },
- "poolAllocationMode": "UserSubscription",
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountCreate_BYOS.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_default.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_default.py
deleted file mode 100644
index c3064b90c897..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_default.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_create_default.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.begin_create(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "location": "japaneast",
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- }
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountCreate_Default.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_system_assigned_identity.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_system_assigned_identity.py
deleted file mode 100644
index fd9f89729767..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_system_assigned_identity.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_create_system_assigned_identity.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.begin_create(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "identity": {"type": "SystemAssigned"},
- "location": "japaneast",
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- }
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountCreate_SystemAssignedIdentity.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_user_assigned_identity.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_user_assigned_identity.py
deleted file mode 100644
index 7be4a8fd84ab..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_create_user_assigned_identity.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_create_user_assigned_identity.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.begin_create(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "identity": {
- "type": "UserAssigned",
- "userAssignedIdentities": {
- "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
- },
- },
- "location": "japaneast",
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- }
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountCreate_UserAssignedIdentity.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_delete.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_delete.py
deleted file mode 100644
index 5a196dc7c3b0..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_delete.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_delete.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- client.batch_account.begin_delete(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- ).result()
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountDelete.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get.py
deleted file mode 100644
index 44e3146e0a14..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_get.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.get(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- )
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountGet.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_update.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_update.py
deleted file mode 100644
index 4839ece6557b..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_update.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python batch_account_update.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.update(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- }
- }
- },
- )
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountUpdate.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_create.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_create.py
deleted file mode 100644
index 65fe113d9ead..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_create.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python private_batch_account_create.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.begin_create(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- parameters={
- "location": "japaneast",
- "properties": {
- "autoStorage": {
- "storageAccountId": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"
- },
- "keyVaultReference": {
- "id": "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample",
- "url": "http://sample.vault.azure.net/",
- },
- "publicNetworkAccess": "Disabled",
- },
- },
- ).result()
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PrivateBatchAccountCreate.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_get.py
deleted file mode 100644
index 70d7935ccd43..000000000000
--- a/sdk/batch/azure-mgmt-batch/generated_samples/private_batch_account_get.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# coding=utf-8
-# --------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See License.txt in the project root for license information.
-# Code generated by Microsoft (R) AutoRest Code Generator.
-# Changes may cause incorrect behavior and will be lost if the code is regenerated.
-# --------------------------------------------------------------------------
-
-from azure.identity import DefaultAzureCredential
-
-from azure.mgmt.batch import BatchManagementClient
-
-"""
-# PREREQUISITES
- pip install azure-identity
- pip install azure-mgmt-batch
-# USAGE
- python private_batch_account_get.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 = BatchManagementClient(
- credential=DefaultAzureCredential(),
- subscription_id="subid",
- )
-
- response = client.batch_account.get(
- resource_group_name="default-azurebatch-japaneast",
- account_name="sampleacct",
- )
- print(response)
-
-
-# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PrivateBatchAccountGet.json
-if __name__ == "__main__":
- main()
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/conftest.py b/sdk/batch/azure-mgmt-batch/generated_tests/conftest.py
index d2197a0b732b..196062d9f60f 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/conftest.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/conftest.py
@@ -18,7 +18,7 @@
load_dotenv()
-# aovid record sensitive identity information in recordings
+# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
batchmanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations.py
index 793bb3b6cecc..73544a811640 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_application_create(self, resource_group):
response = self.client.application.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_application_delete(self, resource_group):
response = self.client.application.delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -46,7 +46,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_application_get(self, resource_group):
response = self.client.application.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -59,7 +59,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_application_update(self, resource_group):
response = self.client.application.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -82,7 +82,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_application_list(self, resource_group):
response = self.client.application.list(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations_async.py
index 840697e41cb7..7771836f2d6a 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_application_create(self, resource_group):
response = await self.client.application.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -34,7 +34,7 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_application_delete(self, resource_group):
response = await self.client.application.delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -47,7 +47,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_application_get(self, resource_group):
response = await self.client.application.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -60,7 +60,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_application_update(self, resource_group):
response = await self.client.application.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -83,7 +83,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_application_list(self, resource_group):
response = self.client.application.list(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations.py
index 959684b482f4..6f40e2b1407f 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_activate(self, resource_group):
+ def test_application_package_activate(self, resource_group):
response = self.client.application_package.activate(
resource_group_name=resource_group.name,
account_name="str",
@@ -35,7 +35,7 @@ def test_activate(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_application_package_create(self, resource_group):
response = self.client.application_package.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -49,7 +49,7 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_application_package_delete(self, resource_group):
response = self.client.application_package.delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -63,7 +63,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_application_package_get(self, resource_group):
response = self.client.application_package.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -77,7 +77,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_application_package_list(self, resource_group):
response = self.client.application_package.list(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations_async.py
index 493a81ace540..1a34028b522f 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_application_package_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_activate(self, resource_group):
+ async def test_application_package_activate(self, resource_group):
response = await self.client.application_package.activate(
resource_group_name=resource_group.name,
account_name="str",
@@ -36,7 +36,7 @@ async def test_activate(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_application_package_create(self, resource_group):
response = await self.client.application_package.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -50,7 +50,7 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_application_package_delete(self, resource_group):
response = await self.client.application_package.delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -64,7 +64,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_application_package_get(self, resource_group):
response = await self.client.application_package.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -78,7 +78,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_application_package_list(self, resource_group):
response = self.client.application_package.list(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations.py
index 7dde00ce609b..996066f936b3 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations.py
@@ -20,100 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create(self, resource_group):
- response = self.client.batch_account.begin_create(
- resource_group_name=resource_group.name,
- account_name="str",
- parameters={
- "location": "str",
- "allowedAuthenticationModes": ["str"],
- "autoStorage": {
- "storageAccountId": "str",
- "authenticationMode": "StorageKeys",
- "nodeIdentityReference": {"resourceId": "str"},
- },
- "encryption": {"keySource": "str", "keyVaultProperties": {"keyIdentifier": "str"}},
- "identity": {
- "type": "str",
- "principalId": "str",
- "tenantId": "str",
- "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
- },
- "keyVaultReference": {"id": "str", "url": "str"},
- "networkProfile": {
- "accountAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- "nodeManagementAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- },
- "poolAllocationMode": "str",
- "publicNetworkAccess": "Enabled",
- "tags": {"str": "str"},
- },
- api_version="2024-07-01",
- ).result() # call '.result()' to poll until service return final result
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy
- def test_update(self, resource_group):
- response = self.client.batch_account.update(
- resource_group_name=resource_group.name,
- account_name="str",
- parameters={
- "allowedAuthenticationModes": ["str"],
- "autoStorage": {
- "storageAccountId": "str",
- "authenticationMode": "StorageKeys",
- "nodeIdentityReference": {"resourceId": "str"},
- },
- "encryption": {"keySource": "str", "keyVaultProperties": {"keyIdentifier": "str"}},
- "identity": {
- "type": "str",
- "principalId": "str",
- "tenantId": "str",
- "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
- },
- "networkProfile": {
- "accountAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- "nodeManagementAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- },
- "publicNetworkAccess": "Enabled",
- "tags": {"str": "str"},
- },
- api_version="2024-07-01",
- )
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy
- def test_begin_delete(self, resource_group):
- response = self.client.batch_account.begin_delete(
- resource_group_name=resource_group.name,
- account_name="str",
- api_version="2024-07-01",
- ).result() # call '.result()' to poll until service return final result
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy
- def test_get(self, resource_group):
- response = self.client.batch_account.get(
- resource_group_name=resource_group.name,
- account_name="str",
- api_version="2024-07-01",
- )
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy
- def test_list(self, resource_group):
+ def test_batch_account_list(self, resource_group):
response = self.client.batch_account.list(
api_version="2024-07-01",
)
@@ -123,7 +30,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_batch_account_list_by_resource_group(self, resource_group):
response = self.client.batch_account.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2024-07-01",
@@ -134,7 +41,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_synchronize_auto_storage_keys(self, resource_group):
+ def test_batch_account_synchronize_auto_storage_keys(self, resource_group):
response = self.client.batch_account.synchronize_auto_storage_keys(
resource_group_name=resource_group.name,
account_name="str",
@@ -146,7 +53,7 @@ def test_synchronize_auto_storage_keys(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_regenerate_key(self, resource_group):
+ def test_batch_account_regenerate_key(self, resource_group):
response = self.client.batch_account.regenerate_key(
resource_group_name=resource_group.name,
account_name="str",
@@ -159,7 +66,7 @@ def test_regenerate_key(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_keys(self, resource_group):
+ def test_batch_account_get_keys(self, resource_group):
response = self.client.batch_account.get_keys(
resource_group_name=resource_group.name,
account_name="str",
@@ -171,7 +78,7 @@ def test_get_keys(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_detectors(self, resource_group):
+ def test_batch_account_list_detectors(self, resource_group):
response = self.client.batch_account.list_detectors(
resource_group_name=resource_group.name,
account_name="str",
@@ -183,7 +90,7 @@ def test_list_detectors(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_detector(self, resource_group):
+ def test_batch_account_get_detector(self, resource_group):
response = self.client.batch_account.get_detector(
resource_group_name=resource_group.name,
account_name="str",
@@ -196,7 +103,7 @@ def test_get_detector(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_outbound_network_dependencies_endpoints(self, resource_group):
+ def test_batch_account_list_outbound_network_dependencies_endpoints(self, resource_group):
response = self.client.batch_account.list_outbound_network_dependencies_endpoints(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations_async.py
index c76442104ec8..c37c8d5ce3e7 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_batch_account_operations_async.py
@@ -21,107 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create(self, resource_group):
- response = await (
- await self.client.batch_account.begin_create(
- resource_group_name=resource_group.name,
- account_name="str",
- parameters={
- "location": "str",
- "allowedAuthenticationModes": ["str"],
- "autoStorage": {
- "storageAccountId": "str",
- "authenticationMode": "StorageKeys",
- "nodeIdentityReference": {"resourceId": "str"},
- },
- "encryption": {"keySource": "str", "keyVaultProperties": {"keyIdentifier": "str"}},
- "identity": {
- "type": "str",
- "principalId": "str",
- "tenantId": "str",
- "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
- },
- "keyVaultReference": {"id": "str", "url": "str"},
- "networkProfile": {
- "accountAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- "nodeManagementAccess": {
- "defaultAction": "str",
- "ipRules": [{"action": "Allow", "value": "str"}],
- },
- },
- "poolAllocationMode": "str",
- "publicNetworkAccess": "Enabled",
- "tags": {"str": "str"},
- },
- api_version="2024-07-01",
- )
- ).result() # call '.result()' to poll until service return final result
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy_async
- async def test_update(self, resource_group):
- response = await self.client.batch_account.update(
- resource_group_name=resource_group.name,
- account_name="str",
- parameters={
- "allowedAuthenticationModes": ["str"],
- "autoStorage": {
- "storageAccountId": "str",
- "authenticationMode": "StorageKeys",
- "nodeIdentityReference": {"resourceId": "str"},
- },
- "encryption": {"keySource": "str", "keyVaultProperties": {"keyIdentifier": "str"}},
- "identity": {
- "type": "str",
- "principalId": "str",
- "tenantId": "str",
- "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
- },
- "networkProfile": {
- "accountAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- "nodeManagementAccess": {"defaultAction": "str", "ipRules": [{"action": "Allow", "value": "str"}]},
- },
- "publicNetworkAccess": "Enabled",
- "tags": {"str": "str"},
- },
- api_version="2024-07-01",
- )
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
- response = await (
- await self.client.batch_account.begin_delete(
- resource_group_name=resource_group.name,
- account_name="str",
- api_version="2024-07-01",
- )
- ).result() # call '.result()' to poll until service return final result
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy_async
- async def test_get(self, resource_group):
- response = await self.client.batch_account.get(
- resource_group_name=resource_group.name,
- account_name="str",
- api_version="2024-07-01",
- )
-
- # please add some check logic here by yourself
- # ...
-
- @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
- @recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_batch_account_list(self, resource_group):
response = self.client.batch_account.list(
api_version="2024-07-01",
)
@@ -131,7 +31,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_batch_account_list_by_resource_group(self, resource_group):
response = self.client.batch_account.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2024-07-01",
@@ -142,7 +42,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_synchronize_auto_storage_keys(self, resource_group):
+ async def test_batch_account_synchronize_auto_storage_keys(self, resource_group):
response = await self.client.batch_account.synchronize_auto_storage_keys(
resource_group_name=resource_group.name,
account_name="str",
@@ -154,7 +54,7 @@ async def test_synchronize_auto_storage_keys(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_regenerate_key(self, resource_group):
+ async def test_batch_account_regenerate_key(self, resource_group):
response = await self.client.batch_account.regenerate_key(
resource_group_name=resource_group.name,
account_name="str",
@@ -167,7 +67,7 @@ async def test_regenerate_key(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_keys(self, resource_group):
+ async def test_batch_account_get_keys(self, resource_group):
response = await self.client.batch_account.get_keys(
resource_group_name=resource_group.name,
account_name="str",
@@ -179,7 +79,7 @@ async def test_get_keys(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_detectors(self, resource_group):
+ async def test_batch_account_list_detectors(self, resource_group):
response = self.client.batch_account.list_detectors(
resource_group_name=resource_group.name,
account_name="str",
@@ -191,7 +91,7 @@ async def test_list_detectors(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_detector(self, resource_group):
+ async def test_batch_account_get_detector(self, resource_group):
response = await self.client.batch_account.get_detector(
resource_group_name=resource_group.name,
account_name="str",
@@ -204,7 +104,7 @@ async def test_get_detector(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_outbound_network_dependencies_endpoints(self, resource_group):
+ async def test_batch_account_list_outbound_network_dependencies_endpoints(self, resource_group):
response = self.client.batch_account.list_outbound_network_dependencies_endpoints(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations.py
index 1bdcc87462e2..586cf167cc66 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_batch_account(self, resource_group):
+ def test_certificate_list_by_batch_account(self, resource_group):
response = self.client.certificate.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -32,7 +32,7 @@ def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_certificate_create(self, resource_group):
response = self.client.certificate.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -57,7 +57,7 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_certificate_update(self, resource_group):
response = self.client.certificate.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -82,7 +82,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_certificate_begin_delete(self, resource_group):
response = self.client.certificate.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -95,7 +95,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_certificate_get(self, resource_group):
response = self.client.certificate.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -108,7 +108,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel_deletion(self, resource_group):
+ def test_certificate_cancel_deletion(self, resource_group):
response = self.client.certificate.cancel_deletion(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations_async.py
index d0f27b7bf5df..04fd9879e2dd 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_certificate_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_batch_account(self, resource_group):
+ async def test_certificate_list_by_batch_account(self, resource_group):
response = self.client.certificate.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ async def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_certificate_create(self, resource_group):
response = await self.client.certificate.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -58,7 +58,7 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_certificate_update(self, resource_group):
response = await self.client.certificate.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -83,7 +83,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_certificate_begin_delete(self, resource_group):
response = await (
await self.client.certificate.begin_delete(
resource_group_name=resource_group.name,
@@ -98,7 +98,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_certificate_get(self, resource_group):
response = await self.client.certificate.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -111,7 +111,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel_deletion(self, resource_group):
+ async def test_certificate_cancel_deletion(self, resource_group):
response = await self.client.certificate.cancel_deletion(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations.py
index bea348d83ff2..d27c6e634062 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_quotas(self, resource_group):
+ def test_location_get_quotas(self, resource_group):
response = self.client.location.get_quotas(
location_name="str",
api_version="2024-07-01",
@@ -31,7 +31,7 @@ def test_get_quotas(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_supported_virtual_machine_skus(self, resource_group):
+ def test_location_list_supported_virtual_machine_skus(self, resource_group):
response = self.client.location.list_supported_virtual_machine_skus(
location_name="str",
api_version="2024-07-01",
@@ -42,7 +42,7 @@ def test_list_supported_virtual_machine_skus(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_name_availability(self, resource_group):
+ def test_location_check_name_availability(self, resource_group):
response = self.client.location.check_name_availability(
location_name="str",
parameters={"name": "str", "type": "Microsoft.Batch/batchAccounts"},
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations_async.py
index 83b96efa5fd3..116e7ac304b8 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_location_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_quotas(self, resource_group):
+ async def test_location_get_quotas(self, resource_group):
response = await self.client.location.get_quotas(
location_name="str",
api_version="2024-07-01",
@@ -32,7 +32,7 @@ async def test_get_quotas(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_supported_virtual_machine_skus(self, resource_group):
+ async def test_location_list_supported_virtual_machine_skus(self, resource_group):
response = self.client.location.list_supported_virtual_machine_skus(
location_name="str",
api_version="2024-07-01",
@@ -43,7 +43,7 @@ async def test_list_supported_virtual_machine_skus(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_name_availability(self, resource_group):
+ async def test_location_check_name_availability(self, resource_group):
response = await self.client.location.check_name_availability(
location_name="str",
parameters={"name": "str", "type": "Microsoft.Batch/batchAccounts"},
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations.py
index 189306c465bf..b47118088ed9 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_configurations(self, resource_group):
+ def test_network_security_perimeter_list_configurations(self, resource_group):
response = self.client.network_security_perimeter.list_configurations(
resource_group_name=resource_group.name,
account_name="str",
@@ -32,7 +32,7 @@ def test_list_configurations(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_configuration(self, resource_group):
+ def test_network_security_perimeter_get_configuration(self, resource_group):
response = self.client.network_security_perimeter.get_configuration(
resource_group_name=resource_group.name,
account_name="str",
@@ -45,7 +45,7 @@ def test_get_configuration(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_reconcile_configuration(self, resource_group):
+ def test_network_security_perimeter_begin_reconcile_configuration(self, resource_group):
response = self.client.network_security_perimeter.begin_reconcile_configuration(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations_async.py
index 576c9c2eb4db..8da3bb2337bd 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_network_security_perimeter_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_configurations(self, resource_group):
+ async def test_network_security_perimeter_list_configurations(self, resource_group):
response = self.client.network_security_perimeter.list_configurations(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ async def test_list_configurations(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_configuration(self, resource_group):
+ async def test_network_security_perimeter_get_configuration(self, resource_group):
response = await self.client.network_security_perimeter.get_configuration(
resource_group_name=resource_group.name,
account_name="str",
@@ -46,7 +46,7 @@ async def test_get_configuration(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_reconcile_configuration(self, resource_group):
+ async def test_network_security_perimeter_begin_reconcile_configuration(self, resource_group):
response = await (
await self.client.network_security_perimeter.begin_reconcile_configuration(
resource_group_name=resource_group.name,
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations.py
index 5539e12e4fcb..a52e667d0779 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_operations_list(self, resource_group):
response = self.client.operations.list(
api_version="2024-07-01",
)
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations_async.py
index 00a4787eb3a0..6c78b05e55e1 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_operations_list(self, resource_group):
response = self.client.operations.list(
api_version="2024-07-01",
)
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations.py
index 9a7c4d0c743f..636ee79e0252 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_batch_account(self, resource_group):
+ def test_pool_list_by_batch_account(self, resource_group):
response = self.client.pool.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -32,7 +32,7 @@ def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_pool_create(self, resource_group):
response = self.client.pool.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -268,7 +268,7 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_pool_update(self, resource_group):
response = self.client.pool.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -504,7 +504,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_pool_begin_delete(self, resource_group):
response = self.client.pool.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
@@ -517,7 +517,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_pool_get(self, resource_group):
response = self.client.pool.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -530,7 +530,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_disable_auto_scale(self, resource_group):
+ def test_pool_disable_auto_scale(self, resource_group):
response = self.client.pool.disable_auto_scale(
resource_group_name=resource_group.name,
account_name="str",
@@ -543,7 +543,7 @@ def test_disable_auto_scale(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_stop_resize(self, resource_group):
+ def test_pool_stop_resize(self, resource_group):
response = self.client.pool.stop_resize(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations_async.py
index 95a7a2b1b936..0529a1e66bc9 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_pool_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_batch_account(self, resource_group):
+ async def test_pool_list_by_batch_account(self, resource_group):
response = self.client.pool.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ async def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_pool_create(self, resource_group):
response = await self.client.pool.create(
resource_group_name=resource_group.name,
account_name="str",
@@ -269,7 +269,7 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_pool_update(self, resource_group):
response = await self.client.pool.update(
resource_group_name=resource_group.name,
account_name="str",
@@ -505,7 +505,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_pool_begin_delete(self, resource_group):
response = await (
await self.client.pool.begin_delete(
resource_group_name=resource_group.name,
@@ -520,7 +520,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_pool_get(self, resource_group):
response = await self.client.pool.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -533,7 +533,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_disable_auto_scale(self, resource_group):
+ async def test_pool_disable_auto_scale(self, resource_group):
response = await self.client.pool.disable_auto_scale(
resource_group_name=resource_group.name,
account_name="str",
@@ -546,7 +546,7 @@ async def test_disable_auto_scale(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_stop_resize(self, resource_group):
+ async def test_pool_stop_resize(self, resource_group):
response = await self.client.pool.stop_resize(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations.py
index 577cdc32cbbd..c07f82087bf6 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_batch_account(self, resource_group):
+ def test_private_endpoint_connection_list_by_batch_account(self, resource_group):
response = self.client.private_endpoint_connection.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -32,7 +32,7 @@ def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_private_endpoint_connection_get(self, resource_group):
response = self.client.private_endpoint_connection.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -45,7 +45,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_update(self, resource_group):
+ def test_private_endpoint_connection_begin_update(self, resource_group):
response = self.client.private_endpoint_connection.begin_update(
resource_group_name=resource_group.name,
account_name="str",
@@ -69,7 +69,7 @@ def test_begin_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_private_endpoint_connection_begin_delete(self, resource_group):
response = self.client.private_endpoint_connection.begin_delete(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations_async.py
index 3688ff388dd2..d43ca32793be 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_endpoint_connection_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_batch_account(self, resource_group):
+ async def test_private_endpoint_connection_list_by_batch_account(self, resource_group):
response = self.client.private_endpoint_connection.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ async def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_private_endpoint_connection_get(self, resource_group):
response = await self.client.private_endpoint_connection.get(
resource_group_name=resource_group.name,
account_name="str",
@@ -46,7 +46,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_update(self, resource_group):
+ async def test_private_endpoint_connection_begin_update(self, resource_group):
response = await (
await self.client.private_endpoint_connection.begin_update(
resource_group_name=resource_group.name,
@@ -76,7 +76,7 @@ async def test_begin_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_private_endpoint_connection_begin_delete(self, resource_group):
response = await (
await self.client.private_endpoint_connection.begin_delete(
resource_group_name=resource_group.name,
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations.py
index 7477336bef11..9bb17bcf061a 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_batch_account(self, resource_group):
+ def test_private_link_resource_list_by_batch_account(self, resource_group):
response = self.client.private_link_resource.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -32,7 +32,7 @@ def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_private_link_resource_get(self, resource_group):
response = self.client.private_link_resource.get(
resource_group_name=resource_group.name,
account_name="str",
diff --git a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations_async.py b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations_async.py
index 5e37e447c29f..55adc4d1b2df 100644
--- a/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations_async.py
+++ b/sdk/batch/azure-mgmt-batch/generated_tests/test_batch_management_private_link_resource_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_batch_account(self, resource_group):
+ async def test_private_link_resource_list_by_batch_account(self, resource_group):
response = self.client.private_link_resource.list_by_batch_account(
resource_group_name=resource_group.name,
account_name="str",
@@ -33,7 +33,7 @@ async def test_list_by_batch_account(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_private_link_resource_get(self, resource_group):
response = await self.client.private_link_resource.get(
resource_group_name=resource_group.name,
account_name="str",