diff --git a/sdk/batch/azure-mgmt-batch/_meta.json b/sdk/batch/azure-mgmt-batch/_meta.json index 0450a38e7d99..a13bc1aede0a 100644 --- a/sdk/batch/azure-mgmt-batch/_meta.json +++ b/sdk/batch/azure-mgmt-batch/_meta.json @@ -1,11 +1,11 @@ { - "commit": "1040c6b9bd69bf414c895f7bef87bfd470e90127", + "commit": "4c6d0481729ff095999f4edf219bd68f9347d719", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.34.1", "@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.34.1 --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..30b26d285e18 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 @@ -7,17 +7,19 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from . import models as _models from ._configuration import BatchManagementClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( ApplicationOperations, ApplicationPackageOperations, @@ -32,11 +34,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 @@ -66,7 +67,7 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this default value may result in unsupported behavior. @@ -76,15 +77,17 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = BatchManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -103,7 +106,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) 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/_utils/__init__.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_utils/__init__.py new file mode 100644 index 000000000000..0af9b28f6607 --- /dev/null +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_utils/serialization.py similarity index 83% rename from sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py rename to sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_utils/serialization.py index 8139854b97bb..f5187701d7be 100644 --- a/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_serialization.py +++ b/sdk/batch/azure-mgmt-batch/azure/mgmt/batch/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -48,11 +30,8 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, List, - Mapping, ) try: @@ -62,13 +41,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +70,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 +93,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 +136,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 @@ -179,80 +165,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _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 +244,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 +280,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 +304,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 +340,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,30 +358,31 @@ 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 @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -426,9 +390,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 + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +414,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 +471,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 +512,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 +532,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. + :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 +567,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 +610,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 +642,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 + :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 +681,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,11 +690,13 @@ 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 - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -728,21 +708,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 + :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 +738,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 + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +760,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. + :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 +784,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 +800,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 +819,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 +852,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 +862,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 +923,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 +948,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 +956,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 +981,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 +1012,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 +1074,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 +1089,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. + :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 +1127,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. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1159,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 + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1174,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 +1199,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 +1222,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 +1281,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 +1333,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( + 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 +1355,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 +1364,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1401,27 +1402,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :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 :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :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 +1443,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 +1479,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 +1507,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 +1520,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 +1535,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 +1558,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 +1587,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 +1624,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. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1647,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 +1671,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 +1695,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,13 +1706,14 @@ 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. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1720,11 +1746,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,8 +1757,9 @@ 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. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1743,24 +1769,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 +1793,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 +1807,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 +1819,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 +1830,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,8 +1848,9 @@ 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. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1834,8 +1861,9 @@ 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. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1849,8 +1877,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,8 +1894,9 @@ 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. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1877,8 +1907,9 @@ 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. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1887,16 +1918,16 @@ 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. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1910,8 +1941,9 @@ 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. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1924,31 +1956,32 @@ 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. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) 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. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1976,8 +2009,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,8 +2017,9 @@ 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 + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1996,5 +2029,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/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..a99fb8be5ee4 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 @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .. import models as _models -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import BatchManagementClientConfiguration from .operations import ( ApplicationOperations, @@ -32,11 +34,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 @@ -66,7 +67,7 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service URL. Default value is None. :type base_url: str :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this default value may result in unsupported behavior. @@ -76,15 +77,17 @@ class BatchManagementClient: # pylint: disable=client-accepts-api-version-keywo """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = BatchManagementClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -103,7 +106,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, base_url), policies=_policies, **kwargs + ) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) 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..4cb5a7db641f 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._application_operations import ( build_create_request, build_delete_request, @@ -35,11 +36,8 @@ build_list_request, build_update_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +56,10 @@ class ApplicationOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def create( @@ -151,7 +149,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 +208,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 +223,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 +280,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 +411,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 +490,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..6059cc9a1863 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +28,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._application_package_operations import ( build_activate_request, build_create_request, @@ -35,11 +36,8 @@ build_get_request, build_list_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -58,10 +56,10 @@ class ApplicationPackageOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def activate( @@ -166,7 +164,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 +326,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 +386,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 +405,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 +465,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 +541,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..b89c12a3e786 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +33,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._batch_account_operations import ( build_create_request, build_delete_request, @@ -46,11 +48,8 @@ build_synchronize_auto_storage_keys_request, build_update_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,10 +68,10 @@ class BatchAccountOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _create_initial( self, @@ -81,7 +80,7 @@ async def _create_initial( parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +363,7 @@ async def update( :rtype: ~azure.mgmt.batch.models.BatchAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -419,7 +418,7 @@ async def update( 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]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -539,7 +538,7 @@ async def get(self, resource_group_name: str, account_name: str, **kwargs: Any) :rtype: ~azure.mgmt.batch.models.BatchAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -595,7 +594,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 +671,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 +733,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 +746,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 +875,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 +947,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 +1010,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 +1089,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 +1141,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 +1160,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..817190f82981 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._certificate_operations import ( build_cancel_deletion_request, build_create_request, @@ -40,11 +41,8 @@ build_list_by_batch_account_request, build_update_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,10 +61,10 @@ class CertificateOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -110,7 +108,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 +303,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 +478,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 +540,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 +682,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 +758,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..85b8801b3ac2 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,16 +28,14 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._location_operations import ( build_check_name_availability_request, build_get_quotas_request, build_list_supported_virtual_machine_skus_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -56,10 +54,10 @@ class LocationOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get_quotas(self, location_name: str, **kwargs: Any) -> _models.BatchLocationQuota: @@ -71,7 +69,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 +134,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 +253,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..a84eac200888 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. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,16 +31,14 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._network_security_perimeter_operations import ( build_get_configuration_request, build_list_configurations_request, build_reconcile_configuration_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -59,10 +57,10 @@ class NetworkSecurityPerimeterOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_configurations( @@ -87,7 +85,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 +169,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 +219,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..5ad5c8423c62 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. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -26,12 +26,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import build_list_request +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -50,10 +48,10 @@ class Operations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -69,7 +67,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..b405288eb0ea 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,6 +32,7 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._pool_operations import ( build_create_request, build_delete_request, @@ -41,11 +42,8 @@ build_stop_resize_request, build_update_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -64,10 +62,10 @@ class PoolOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -117,7 +115,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 +292,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 +452,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 +514,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 +642,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 +705,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 +775,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..96abf289209d 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,17 +32,15 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_endpoint_connection_operations import ( build_delete_request, build_get_request, build_list_by_batch_account_request, build_update_request, ) +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -61,10 +59,10 @@ class PrivateEndpointConnectionOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -92,7 +90,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 +171,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 +223,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 +453,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..59faf1d86011 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. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse +from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,12 +27,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models +from ..._utils.serialization import Deserializer, Serializer from ...operations._private_link_resource_operations import build_get_request, build_list_by_batch_account_request +from .._configuration import BatchManagementClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -51,10 +49,10 @@ class PrivateLinkResourceOperations: def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -80,7 +78,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 +159,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..c02b12dd981c 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 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 -# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,21 +7,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping import datetime -import sys from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union -from .. import _serialization - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +from .._utils import serialization as _serialization if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] class AccessRule(_serialization.Model): @@ -205,10 +199,10 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N :paramtype tags: dict[str, str] """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.etag = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.etag: Optional[str] = None self.tags = tags @@ -342,11 +336,11 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N :paramtype tags: dict[str, str] """ super().__init__(tags=tags, **kwargs) - self.state = None - self.format = None - self.storage_url = None - self.storage_url_expiry = None - self.last_activation_time = None + self.state: Optional[Union[str, "_models.PackageState"]] = None + self.format: Optional[str] = None + self.storage_url: Optional[str] = None + self.storage_url_expiry: Optional[datetime.datetime] = None + self.last_activation_time: Optional[datetime.datetime] = None class ApplicationPackageReference(_serialization.Model): @@ -398,9 +392,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 +426,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 @@ -918,14 +912,14 @@ class AzureResource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = None - self.tags = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.location: Optional[str] = None + self.tags: Optional[Dict[str, str]] = 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. @@ -1076,23 +1070,23 @@ def __init__( """ super().__init__(**kwargs) self.identity = identity - self.account_endpoint = None - self.node_management_endpoint = None - self.provisioning_state = None - self.pool_allocation_mode = None - self.key_vault_reference = None + self.account_endpoint: Optional[str] = None + self.node_management_endpoint: Optional[str] = None + self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None + self.pool_allocation_mode: Optional[Union[str, "_models.PoolAllocationMode"]] = None + self.key_vault_reference: Optional["_models.KeyVaultReference"] = None self.public_network_access = public_network_access self.network_profile = network_profile - self.private_endpoint_connections = None - self.auto_storage = None - self.encryption = None - self.dedicated_core_quota = None - self.low_priority_core_quota = None - self.dedicated_core_quota_per_vm_family = None - self.dedicated_core_quota_per_vm_family_enforced = None - self.pool_quota = None - self.active_job_and_job_schedule_quota = None - self.allowed_authentication_modes = None + self.private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = None + self.auto_storage: Optional["_models.AutoStorageProperties"] = None + self.encryption: Optional["_models.EncryptionProperties"] = None + self.dedicated_core_quota: Optional[int] = None + self.low_priority_core_quota: Optional[int] = None + self.dedicated_core_quota_per_vm_family: Optional[List["_models.VirtualMachineFamilyCoreQuota"]] = None + self.dedicated_core_quota_per_vm_family_enforced: Optional[bool] = None + self.pool_quota: Optional[int] = None + self.active_job_and_job_schedule_quota: Optional[int] = None + self.allowed_authentication_modes: Optional[List[Union[str, "_models.AuthenticationMode"]]] = None class BatchAccountCreateParameters(_serialization.Model): @@ -1262,8 +1256,8 @@ def __init__( :paramtype user_assigned_identities: dict[str, ~azure.mgmt.batch.models.UserAssignedIdentities] """ super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None + self.principal_id: Optional[str] = None + self.tenant_id: Optional[str] = None self.type = type self.user_assigned_identities = user_assigned_identities @@ -1296,9 +1290,9 @@ class BatchAccountKeys(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.account_name = None - self.primary = None - self.secondary = None + self.account_name: Optional[str] = None + self.primary: Optional[str] = None + self.secondary: Optional[str] = None class BatchAccountListResult(_serialization.Model): @@ -1458,7 +1452,7 @@ class BatchLocationQuota(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.account_quota = None + self.account_quota: Optional[int] = None class BatchPoolIdentity(_serialization.Model): @@ -1503,7 +1497,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. @@ -1603,12 +1597,12 @@ def __init__( self.thumbprint_algorithm = thumbprint_algorithm self.thumbprint = thumbprint self.format = format - self.provisioning_state = None - self.provisioning_state_transition_time = None - self.previous_provisioning_state = None - self.previous_provisioning_state_transition_time = None - self.public_data = None - self.delete_certificate_error = None + self.provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None + self.provisioning_state_transition_time: Optional[datetime.datetime] = None + self.previous_provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None + self.previous_provisioning_state_transition_time: Optional[datetime.datetime] = None + self.public_data: Optional[str] = None + self.delete_certificate_error: Optional["_models.DeleteCertificateError"] = None class CertificateBaseProperties(_serialization.Model): @@ -1873,12 +1867,12 @@ def __init__( :paramtype format: str or ~azure.mgmt.batch.models.CertificateFormat """ super().__init__(thumbprint_algorithm=thumbprint_algorithm, thumbprint=thumbprint, format=format, **kwargs) - self.provisioning_state = None - self.provisioning_state_transition_time = None - self.previous_provisioning_state = None - self.previous_provisioning_state_transition_time = None - self.public_data = None - self.delete_certificate_error = None + self.provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None + self.provisioning_state_transition_time: Optional[datetime.datetime] = None + self.previous_provisioning_state: Optional[Union[str, "_models.CertificateProvisioningState"]] = None + self.previous_provisioning_state_transition_time: Optional[datetime.datetime] = None + self.public_data: Optional[str] = None + self.delete_certificate_error: Optional["_models.DeleteCertificateError"] = None class CertificateReference(_serialization.Model): @@ -2022,9 +2016,9 @@ class CheckNameAvailabilityResult(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name_available = None - self.reason = None - self.message = None + self.name_available: Optional[bool] = None + self.reason: Optional[Union[str, "_models.NameAvailabilityReason"]] = None + self.message: Optional[str] = None class CIFSMountConfiguration(_serialization.Model): @@ -2367,7 +2361,7 @@ def __init__( readWrite - The caching mode for the disk is read and write. The default value for caching is none. For information about the caching options see: - https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. # pylint: disable=line-too-long + https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Known values are: "None", "ReadOnly", and "ReadWrite". :paramtype caching: str or ~azure.mgmt.batch.models.CachingType :keyword disk_size_gb: The initial disk size in GB when creating new data disk. Required. @@ -2555,9 +2549,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 +2566,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 """ @@ -2714,9 +2708,9 @@ class EndpointDependency(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.domain_name = None - self.description = None - self.endpoint_details = None + self.domain_name: Optional[str] = None + self.description: Optional[str] = None + self.endpoint_details: Optional[List["_models.EndpointDetail"]] = None class EndpointDetail(_serialization.Model): @@ -2739,7 +2733,7 @@ class EndpointDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.port = None + self.port: Optional[int] = None class EnvironmentSetting(_serialization.Model): @@ -2798,8 +2792,8 @@ class ErrorAdditionalInfo(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None - self.info = None + self.type: Optional[str] = None + self.info: Optional[JSON] = None class ErrorDetail(_serialization.Model): @@ -2838,11 +2832,11 @@ class ErrorDetail(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + self.code: Optional[str] = None + self.message: Optional[str] = None + self.target: Optional[str] = None + self.details: Optional[List["_models.ErrorDetail"]] = None + self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None class ErrorResponse(_serialization.Model): @@ -2943,7 +2937,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 +2982,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 +3015,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 +3073,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 +3581,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 +3634,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". @@ -3825,7 +3817,7 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3854,10 +3846,10 @@ class Resource(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.system_data: Optional["_models.SystemData"] = None class ProxyResource(Resource): @@ -3867,7 +3859,7 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3886,7 +3878,7 @@ class NetworkSecurityPerimeterConfiguration(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4008,8 +4000,10 @@ def __init__( :paramtype profile: ~azure.mgmt.batch.models.NetworkSecurityProfile """ super().__init__(**kwargs) - self.provisioning_state = None - self.provisioning_issues = None + self.provisioning_state: Optional[ + Union[str, "_models.NetworkSecurityPerimeterConfigurationProvisioningState"] + ] = None + self.provisioning_issues: Optional[List["_models.ProvisioningIssue"]] = None self.network_security_perimeter = network_security_perimeter self.resource_association = resource_association self.profile = profile @@ -4348,8 +4342,8 @@ class OutboundEnvironmentEndpoint(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.category = None - self.endpoints = None + self.category: Optional[str] = None + self.endpoints: Optional[List["_models.EndpointDependency"]] = None class OutboundEnvironmentEndpointCollection(_serialization.Model): @@ -4379,11 +4373,11 @@ def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: :paramtype next_link: str """ super().__init__(**kwargs) - self.value = None + self.value: Optional[List["_models.OutboundEnvironmentEndpoint"]] = 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 +4414,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 +4584,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 @@ -4664,18 +4654,18 @@ def __init__( # pylint: disable=too-many-locals super().__init__(tags=tags, **kwargs) self.identity = identity self.display_name = display_name - self.last_modified = None - self.creation_time = None - self.provisioning_state = None - self.provisioning_state_transition_time = None - self.allocation_state = None - self.allocation_state_transition_time = None + self.last_modified: Optional[datetime.datetime] = None + self.creation_time: Optional[datetime.datetime] = None + self.provisioning_state: Optional[Union[str, "_models.PoolProvisioningState"]] = None + self.provisioning_state_transition_time: Optional[datetime.datetime] = None + self.allocation_state: Optional[Union[str, "_models.AllocationState"]] = None + self.allocation_state_transition_time: Optional[datetime.datetime] = None self.vm_size = vm_size self.deployment_configuration = deployment_configuration - self.current_dedicated_nodes = None - self.current_low_priority_nodes = None + self.current_dedicated_nodes: Optional[int] = None + self.current_low_priority_nodes: Optional[int] = None self.scale_settings = scale_settings - self.auto_scale_run = None + self.auto_scale_run: Optional["_models.AutoScaleRun"] = None self.inter_node_communication = inter_node_communication self.network_configuration = network_configuration self.task_slots_per_node = task_slots_per_node @@ -4686,10 +4676,10 @@ def __init__( # pylint: disable=too-many-locals self.certificates = certificates self.application_packages = application_packages self.application_licenses = application_licenses - self.resize_operation_status = None + self.resize_operation_status: Optional["_models.ResizeOperationStatus"] = None self.mount_configuration = mount_configuration self.target_node_communication_mode = target_node_communication_mode - self.current_node_communication_mode = None + self.current_node_communication_mode: Optional[Union[str, "_models.NodeCommunicationMode"]] = None self.upgrade_policy = upgrade_policy self.resource_tags = resource_tags @@ -4730,7 +4720,7 @@ class PrivateEndpoint(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The ARM resource identifier of the private endpoint. This is of the form - /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. # pylint: disable=line-too-long + /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. :vartype id: str """ @@ -4745,7 +4735,7 @@ class PrivateEndpoint(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.id = None + self.id: Optional[str] = None class PrivateEndpointConnection(AzureProxyResource): @@ -4818,9 +4808,9 @@ def __init__( ~azure.mgmt.batch.models.PrivateLinkServiceConnectionState """ super().__init__(tags=tags, **kwargs) - self.provisioning_state = None - self.private_endpoint = None - self.group_ids = None + self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None + self.private_endpoint: Optional["_models.PrivateEndpoint"] = None + self.group_ids: Optional[List[str]] = None self.private_link_service_connection_state = private_link_service_connection_state @@ -4875,9 +4865,9 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N :paramtype tags: dict[str, str] """ super().__init__(tags=tags, **kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = None + self.group_id: Optional[str] = None + self.required_members: Optional[List[str]] = None + self.required_zone_names: Optional[List[str]] = None class PrivateLinkServiceConnectionState(_serialization.Model): @@ -4924,7 +4914,7 @@ def __init__( super().__init__(**kwargs) self.status = status self.description = description - self.actions_required = None + self.actions_required: Optional[str] = None class ProvisioningIssue(_serialization.Model): @@ -4954,8 +4944,8 @@ class ProvisioningIssue(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.properties = None + self.name: Optional[str] = None + self.properties: Optional["_models.ProvisioningIssueProperties"] = None class ProvisioningIssueProperties(_serialization.Model): @@ -5001,11 +4991,11 @@ class ProvisioningIssueProperties(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.issue_type = None - self.severity = None - self.description = None - self.suggested_resource_ids = None - self.suggested_access_rules = None + self.issue_type: Optional[Union[str, "_models.IssueType"]] = None + self.severity: Optional[Union[str, "_models.Severity"]] = None + self.description: Optional[str] = None + self.suggested_resource_ids: Optional[List[str]] = None + self.suggested_access_rules: Optional[List["_models.AccessRule"]] = None class PublicIPAddressConfiguration(_serialization.Model): @@ -5530,7 +5520,7 @@ class ServiceArtifactReference(_serialization.Model): All required parameters must be populated in order to send to server. :ivar id: The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. Required. :vartype id: str """ @@ -5546,7 +5536,7 @@ class ServiceArtifactReference(_serialization.Model): def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. Required. :paramtype id: str """ @@ -5578,8 +5568,8 @@ class SkuCapability(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.value = None + self.name: Optional[str] = None + self.value: Optional[str] = None class StartTask(_serialization.Model): @@ -5726,10 +5716,10 @@ class SupportedSku(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.family_name = None - self.capabilities = None - self.batch_support_end_of_life = None + self.name: Optional[str] = None + self.family_name: Optional[str] = None + self.capabilities: Optional[List["_models.SkuCapability"]] = None + self.batch_support_end_of_life: Optional[datetime.datetime] = None class SupportedSkusResult(_serialization.Model): @@ -5762,7 +5752,7 @@ def __init__(self, *, value: List["_models.SupportedSku"], **kwargs: Any) -> Non """ super().__init__(**kwargs) self.value = value - self.next_link = None + self.next_link: Optional[str] = None class SystemData(_serialization.Model): @@ -5970,13 +5960,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 +5995,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. @@ -6122,8 +6112,8 @@ class UserAssignedIdentities(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None class UserIdentity(_serialization.Model): @@ -6162,7 +6152,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. @@ -6211,7 +6201,7 @@ class VirtualMachineConfiguration(_serialization.Model): # pylint: disable=too- virtual machine scale set. :vartype security_profile: ~azure.mgmt.batch.models.SecurityProfile :ivar service_artifact_reference: The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. :vartype service_artifact_reference: ~azure.mgmt.batch.models.ServiceArtifactReference """ @@ -6296,7 +6286,7 @@ def __init__( virtual machine scale set. :paramtype security_profile: ~azure.mgmt.batch.models.SecurityProfile :keyword service_artifact_reference: The service artifact reference id in the form of - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. # pylint: disable=line-too-long + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}. :paramtype service_artifact_reference: ~azure.mgmt.batch.models.ServiceArtifactReference """ super().__init__(**kwargs) @@ -6338,8 +6328,8 @@ class VirtualMachineFamilyCoreQuota(_serialization.Model): def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name = None - self.core_quota = None + self.name: Optional[str] = None + self.core_quota: Optional[int] = None class VMDiskSecurityProfile(_serialization.Model): 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..bfdc4f82af2b 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +52,7 @@ def build_create_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -92,7 +90,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -128,7 +126,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -165,7 +163,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -208,7 +206,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -244,10 +242,10 @@ class ApplicationOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload def create( @@ -337,7 +335,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 +411,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 +468,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 +599,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 +678,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..a63875618a75 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +28,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -59,7 +57,7 @@ def build_activate_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}/activate", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -106,7 +104,7 @@ def build_create_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -152,7 +150,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -196,7 +194,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -241,7 +239,7 @@ def build_list_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -280,10 +278,10 @@ class ApplicationPackageOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload def activate( @@ -388,7 +386,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 +548,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 +627,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 +687,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 +763,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..2c0db0a7c61a 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -58,7 +56,7 @@ def build_create_request( _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( @@ -94,7 +92,7 @@ def build_update_request( _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( @@ -129,7 +127,7 @@ def build_delete_request( _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( @@ -160,7 +158,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ _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( @@ -215,7 +213,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -245,7 +243,7 @@ def build_synchronize_auto_storage_keys_request( # pylint: disable=name-too-lon _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -279,7 +277,7 @@ def build_regenerate_key_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -314,7 +312,7 @@ def build_get_keys_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -347,7 +345,7 @@ def build_list_detectors_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -380,7 +378,7 @@ def build_get_detector_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -414,7 +412,7 @@ def build_list_outbound_network_dependencies_endpoints_request( # pylint: disab _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -448,10 +446,10 @@ class BatchAccountOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") def _create_initial( self, @@ -460,7 +458,7 @@ def _create_initial( parameters: Union[_models.BatchAccountCreateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -743,7 +741,7 @@ def update( :rtype: ~azure.mgmt.batch.models.BatchAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -798,7 +796,7 @@ def update( 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]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +916,7 @@ def get(self, resource_group_name: str, account_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.batch.models.BatchAccount :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -974,7 +972,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 +1049,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 +1126,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 +1255,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 +1327,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 +1390,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 +1469,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 +1521,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 +1539,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..caa543ed8559 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=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +62,7 @@ def build_list_by_batch_account_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -111,7 +109,7 @@ def build_create_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -160,7 +158,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -200,7 +198,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -236,7 +234,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -272,7 +270,7 @@ def build_cancel_deletion_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -309,10 +307,10 @@ class CertificateOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -356,7 +354,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 +549,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 +724,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 +786,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 +928,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 +1004,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..9355fb7b515e 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. @@ -6,11 +5,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -27,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +47,7 @@ def build_get_quotas_request(location_name: str, subscription_id: str, **kwargs: # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas" - ) # pylint: disable=line-too-long + ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -85,7 +82,7 @@ def build_list_supported_virtual_machine_skus_request( # pylint: disable=name-t _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -118,7 +115,7 @@ def build_check_name_availability_request(location_name: str, subscription_id: s _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), @@ -151,10 +148,10 @@ class LocationOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def get_quotas(self, location_name: str, **kwargs: Any) -> _models.BatchLocationQuota: @@ -166,7 +163,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 +228,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 +347,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..acb03448f929 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Iterator, Optional, Type, TypeVar, Union, cast +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, cast import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -30,12 +31,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,7 +54,7 @@ def build_list_configurations_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -93,7 +91,7 @@ def build_get_configuration_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -136,7 +134,7 @@ def build_reconcile_configuration_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -176,10 +174,10 @@ class NetworkSecurityPerimeterOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_configurations( @@ -204,7 +202,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 +286,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 +336,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..f5816af01303 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. @@ -6,10 +5,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +26,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -72,10 +69,10 @@ class Operations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -91,7 +88,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..33f94407deaa 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=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -64,7 +62,7 @@ def build_list_by_batch_account_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -111,7 +109,7 @@ def build_create_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -160,7 +158,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -200,7 +198,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -236,7 +234,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -272,7 +270,7 @@ def build_disable_auto_scale_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -308,7 +306,7 @@ def build_stop_resize_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "accountName": _SERIALIZER.url( @@ -345,10 +343,10 @@ class PoolOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -398,7 +396,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 +573,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 +733,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 +795,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 +923,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 +986,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 +1054,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..104784b879ed 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,11 +6,12 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping 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 import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -31,12 +32,9 @@ from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +60,7 @@ def build_list_by_batch_account_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -101,7 +99,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -149,7 +147,7 @@ def build_update_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -198,7 +196,7 @@ def build_delete_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -240,10 +238,10 @@ class PrivateEndpointConnectionOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -270,7 +268,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 +349,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 +401,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 +630,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..9746b85dcf88 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,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,10 +6,11 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from collections.abc import MutableMapping +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, @@ -26,12 +27,9 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models -from .._serialization import Serializer +from .._configuration import BatchManagementClientConfiguration +from .._utils.serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +55,7 @@ def build_list_by_batch_account_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -92,7 +90,7 @@ def build_get_request( _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName}", - ) # pylint: disable=line-too-long + ) path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -134,10 +132,10 @@ class PrivateLinkResourceOperations: def __init__(self, *args, **kwargs): input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: BatchManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_batch_account( @@ -163,7 +161,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 +242,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/application_create.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_create.py index 34f50204d9b0..b55bed02711e 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_create.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_delete.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_delete.py index a6512f1a05e3..5b07025541d7 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_delete.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_get.py index 5a75bbcc6106..6937e31e94f0 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_list.py index f0cd27842e14..fb4f067b11e2 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_activate.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_activate.py index b27b0a8b0919..a422bfd471e0 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_activate.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_activate.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_create.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_create.py index e248723330f5..b558e5130f5b 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_create.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_create.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_delete.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_delete.py index a94b5a1eca26..5eff77d4ed28 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_delete.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_get.py index d2bc057a5abf..15f3cb9a51e3 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_list.py index 67043d2ba0ca..5dbe3a878ffc 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_package_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_package_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/application_update.py b/sdk/batch/azure-mgmt-batch/generated_samples/application_update.py index a0172a60f638..626a5191fb33 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/application_update.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/application_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 5cd3815907b4..63e5937d6785 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index c3064b90c897..f031b85a385e 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index fd9f89729767..4955d447b7cc 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 7be4a8fd84ab..eb44117d8730 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 5a196dc7c3b0..fec1ea16a5e9 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_delete.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 44e3146e0a14..52bbdb92db64 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get_keys.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get_keys.py index 6175279ae1cc..60acb213bcf6 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get_keys.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_get_keys.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list.py index 85328ef76678..a15b5d822ca1 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_by_resource_group.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_by_resource_group.py index 0f65e3eb1dbc..192edf79500c 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_by_resource_group.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_by_resource_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_outbound_network_dependencies_endpoints.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_outbound_network_dependencies_endpoints.py index be4d250ec533..2f00cba2d9a7 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_outbound_network_dependencies_endpoints.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_list_outbound_network_dependencies_endpoints.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_regenerate_key.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_regenerate_key.py index cdd3bd61cc9d..acb0f05c9d41 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_regenerate_key.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_regenerate_key.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_synchronize_auto_storage_keys.py b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_synchronize_auto_storage_keys.py index 92dac77ca475..b149baef3f33 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_synchronize_auto_storage_keys.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_synchronize_auto_storage_keys.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 4839ece6557b..44524dfe2597 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_update.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/batch_account_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_cancel_deletion.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_cancel_deletion.py index 68de8cce5ea7..55f9833977db 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_cancel_deletion.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_cancel_deletion.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_full.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_full.py index 1dd002f3dcf0..2e22e3f10edd 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_full.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_full.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal.py index 8b355229de18..669147d19c6f 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal_cer.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal_cer.py index ea196367a908..6a65816f2619 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal_cer.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_create_minimal_cer.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_delete.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_delete.py index 2fc0c7772202..4757f4e8f22a 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_delete.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get.py index c77e177cf139..da0eaaea06f4 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get_with_deletion_error.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get_with_deletion_error.py index d7c54aa0b525..4ea056e9e1a9 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get_with_deletion_error.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_get_with_deletion_error.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list.py index 595cb2bc613e..bf7d9829d70a 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list_with_filter.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list_with_filter.py index 012e30783098..17449cce080d 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list_with_filter.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_list_with_filter.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_update.py b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_update.py index 90b11e02bf26..c91ea108344e 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/certificate_update.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/certificate_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_already_exists.py b/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_already_exists.py index 96ba16751480..f251ad3d3803 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_already_exists.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_already_exists.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_available.py b/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_available.py index 824bbf5ba9e8..93c26782f1ba 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_available.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/location_check_name_availability_available.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/location_get_quotas.py b/sdk/batch/azure-mgmt-batch/generated_samples/location_get_quotas.py index 78c3fa7bd595..ee8a829fc58b 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/location_get_quotas.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/location_get_quotas.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/location_list_virtual_machine_skus.py b/sdk/batch/azure-mgmt-batch/generated_samples/location_list_virtual_machine_skus.py index 9f514668c064..96cb88def5c3 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/location_list_virtual_machine_skus.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/location_list_virtual_machine_skus.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_get.py index 882bc275fd70..ba73c32127bf 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_reconcile.py b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_reconcile.py index 53dfe287f42a..fd84b722ba44 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_reconcile.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configuration_reconcile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configurations_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configurations_list.py index f682b15d4fa3..b3a3d8787f43 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configurations_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/nsp_configurations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/operations_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/operations_list.py index 544ce5b4e76d..c57e935031ed 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/operations_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/operations_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_accelerated_networking.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_accelerated_networking.py index 224286ca8fec..8966398b1170 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_accelerated_networking.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_accelerated_networking.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_minimal_virtual_machine_configuration.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_minimal_virtual_machine_configuration.py index ed14afe8cd97..283f3b8ac147 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_minimal_virtual_machine_configuration.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_minimal_virtual_machine_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_no_public_ip_addresses.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_no_public_ip_addresses.py index 96c397837369..6bc230b0a531 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_no_public_ip_addresses.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_no_public_ip_addresses.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_public_ips.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_public_ips.py index 7207473706f8..f4fa0310b8a3 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_public_ips.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_public_ips.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_resource_tags.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_resource_tags.py index 66e118f95f2b..2fdbcb53d69b 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_resource_tags.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_resource_tags.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_security_profile.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_security_profile.py index 22ef3583c92b..d9a981be5d48 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_security_profile.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_security_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_shared_image_gallery.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_shared_image_gallery.py index 77977c73de89..ef89e9f6aa17 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_shared_image_gallery.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_shared_image_gallery.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_tags.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_tags.py index 3fd4937a9be4..b3324a6dd955 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_tags.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_tags.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_upgrade_policy.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_upgrade_policy.py index 2932c39e9e50..11a84e8fbcc5 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_upgrade_policy.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_upgrade_policy.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_user_assigned_identities.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_user_assigned_identities.py index 23f343e9b2e0..b47cb3a77eb4 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_user_assigned_identities.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_user_assigned_identities.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration.py index 2fb5b0a9142a..15668d201c6a 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_extensions.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_extensions.py index a110d9754dbf..6fa38f9d6aca 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_extensions.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_extensions.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_managed_os_disk.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_managed_os_disk.py index 3e3d48a94488..54996b7f4e32 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_managed_os_disk.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_managed_os_disk.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_service_artifact_reference.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_service_artifact_reference.py index 261e91e04192..cdd7dd7f6964 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_service_artifact_reference.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_create_virtual_machine_configuration_service_artifact_reference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_disable_auto_scale.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_disable_auto_scale.py index 532bf8e07f1f..2b75795ab98a 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_disable_auto_scale.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_disable_auto_scale.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_accelerated_networking.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_accelerated_networking.py index 832bd6dc9626..3b5c90bf1d5f 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_accelerated_networking.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_accelerated_networking.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_security_profile.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_security_profile.py index ea3c79ddb7ec..575ecbabd31a 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_security_profile.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_security_profile.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_upgrade_policy.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_upgrade_policy.py index cedd49b97fea..e55eb6b0ff6b 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_upgrade_policy.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_upgrade_policy.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_extensions.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_extensions.py index 8e213fee3238..5aa14049a97c 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_extensions.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_extensions.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_manged_os_disk.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_manged_os_disk.py index 7569b6287415..31b3d3e05277 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_manged_os_disk.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_manged_os_disk.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_service_artifact_reference.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_service_artifact_reference.py index ded9316e7170..ecc11a158d86 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_service_artifact_reference.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_get_virtual_machine_configuration_service_artifact_reference.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_list_with_filter.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_list_with_filter.py index 44e91ad8a4ad..0c6ae6b809d4 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_list_with_filter.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_list_with_filter.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_stop_resize.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_stop_resize.py index 0f518cb765b1..c225a15a6fcc 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_stop_resize.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_stop_resize.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_enable_auto_scale.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_enable_auto_scale.py index def14873939f..1f9b20547479 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_enable_auto_scale.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_enable_auto_scale.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_other_properties.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_other_properties.py index d38df9a059ed..42230799873c 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_other_properties.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_other_properties.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_remove_start_task.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_remove_start_task.py index adb88642c2ac..6dd64267e482 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_remove_start_task.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_remove_start_task.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_resize_pool.py b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_resize_pool.py index 2d120085b64d..3b977704098e 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_resize_pool.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/pool_update_resize_pool.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 65fe113d9ead..1e41989d7a73 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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 index 70d7935ccd43..a1dfd5251c8a 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_delete.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_delete.py index 56205beb4c3d..31c7fb113cf7 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_delete.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_get.py index 57e33d90534a..327b325d21a3 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_update.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_update.py index ae3760cc981b..f5af3deb139f 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_update.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connection_update.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connections_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connections_list.py index 406abec363c4..a729d2d66bbf 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connections_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_endpoint_connections_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resource_get.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resource_get.py index e8a93013c416..b7fdb11717db 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resource_get.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resource_get.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resources_list.py b/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resources_list.py index 99bb74e7869f..fcdc06ae9726 100644 --- a/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resources_list.py +++ b/sdk/batch/azure-mgmt-batch/generated_samples/private_link_resources_list.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. 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..315eee23127a 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,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create(self, resource_group): + def test_batch_account_begin_create(self, resource_group): response = self.client.batch_account.begin_create( resource_group_name=resource_group.name, account_name="str", @@ -56,7 +56,7 @@ def test_begin_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_batch_account_update(self, resource_group): response = self.client.batch_account.update( resource_group_name=resource_group.name, account_name="str", @@ -89,7 +89,7 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_batch_account_begin_delete(self, resource_group): response = self.client.batch_account.begin_delete( resource_group_name=resource_group.name, account_name="str", @@ -101,7 +101,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_batch_account_get(self, resource_group): response = self.client.batch_account.get( resource_group_name=resource_group.name, account_name="str", @@ -113,7 +113,7 @@ def test_get(self, resource_group): @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 +123,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 +134,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 +146,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 +159,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 +171,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 +183,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 +196,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..ed1f191c206a 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,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create(self, resource_group): + async def test_batch_account_begin_create(self, resource_group): response = await ( await self.client.batch_account.begin_create( resource_group_name=resource_group.name, @@ -62,7 +62,7 @@ async def test_begin_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_batch_account_update(self, resource_group): response = await self.client.batch_account.update( resource_group_name=resource_group.name, account_name="str", @@ -95,7 +95,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_batch_account_begin_delete(self, resource_group): response = await ( await self.client.batch_account.begin_delete( resource_group_name=resource_group.name, @@ -109,7 +109,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_batch_account_get(self, resource_group): response = await self.client.batch_account.get( resource_group_name=resource_group.name, account_name="str", @@ -121,7 +121,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_batch_account_list(self, resource_group): response = self.client.batch_account.list( api_version="2024-07-01", ) @@ -131,7 +131,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 +142,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 +154,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 +167,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 +179,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 +191,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 +204,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",