diff --git a/sdk/resources/azure-mgmt-resource/_meta.json b/sdk/resources/azure-mgmt-resource/_meta.json
index afa1accf3035..6005e08c8748 100644
--- a/sdk/resources/azure-mgmt-resource/_meta.json
+++ b/sdk/resources/azure-mgmt-resource/_meta.json
@@ -1,12 +1,12 @@
{
- "commit": "34424077cae09522361ea641761dc37941603383",
+ "commit": "308cef2792893a9c9140ed1b8298c65272c7f0a3",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
- "@autorest/python@6.19.0",
+ "@autorest/python@6.26.4",
"@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/resources/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/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/resources/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.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/resources/resource-manager/readme.md",
"package-privatelinks-2020-05": "2022-03-18 16:14:07 -0700 2c68b6f0c9566d97d9d590a31b0d46997622eef7 Microsoft.Authorization/stable/2020-05-01/privateLinks.json",
"package-features-2021-07": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Features/stable/2021-07-01/features.json",
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/__init__.py
index 63e926ebaebb..885ce76f7c57 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/__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 ._changes_client import ChangesClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._changes_client import ChangesClient # 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__ = [
"ChangesClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py
index 061d6df862aa..4f79edffe2ce 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py
@@ -21,11 +21,10 @@
from .operations import ChangesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ChangesClient: # pylint: disable=client-accepts-api-version-keyword
+class ChangesClient:
"""The Resource Changes Client.
:ivar changes: ChangesOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_configuration.py
index 7bf565feb1a7..42592331d042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/__init__.py
index fc466c6c0f3d..acead607168e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/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 ._changes_client import ChangesClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._changes_client import ChangesClient # 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__ = [
"ChangesClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py
index 39173493d243..a177262cf552 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py
@@ -21,11 +21,10 @@
from .operations import ChangesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ChangesClient: # pylint: disable=client-accepts-api-version-keyword
+class ChangesClient:
"""The Resource Changes Client.
:ivar changes: ChangesOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_configuration.py
index 3d21694e93c4..d6c35db39459 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/__init__.py
index be934d4074cf..8fe881f6b809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/__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 ._operations import ChangesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ChangesOperations # 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__ = [
"ChangesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py
index 4620820cfdf1..8138f9d9cc40 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -94,7 +93,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01"))
cls: ClsType[_models.ChangeResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -187,7 +186,7 @@ async def get(
:rtype: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/__init__.py
index 1ed07c9c19e1..402dae6f0312 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/__init__.py
@@ -5,22 +5,33 @@
# 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 ChangeAttributes
-from ._models_py3 import ChangeBase
-from ._models_py3 import ChangeProperties
-from ._models_py3 import ChangeResourceListResult
-from ._models_py3 import ChangeResourceResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Resource
+from typing import TYPE_CHECKING
-from ._changes_client_enums import ChangeCategory
-from ._changes_client_enums import ChangeType
-from ._changes_client_enums import PropertyChangeType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ChangeAttributes,
+ ChangeBase,
+ ChangeProperties,
+ ChangeResourceListResult,
+ ChangeResourceResult,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ Resource,
+)
+
+from ._changes_client_enums import ( # type: ignore
+ ChangeCategory,
+ ChangeType,
+ PropertyChangeType,
+)
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__ = [
@@ -37,5 +48,5 @@
"ChangeType",
"PropertyChangeType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/_models_py3.py
index b3f2daf338d2..3b8671e413dd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/__init__.py
index be934d4074cf..8fe881f6b809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/__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 ._operations import ChangesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ChangesOperations # 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__ = [
"ChangesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py
index 7fa5fb3e0c13..6546928703d4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -181,7 +180,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01"))
cls: ClsType[_models.ChangeResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -274,7 +273,7 @@ def get(
:rtype: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/__init__.py
index 9d5bd514bc35..bdb7fb5d678b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/__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 ._data_boundary_mgmt_client import DataBoundaryMgmtClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._data_boundary_mgmt_client import DataBoundaryMgmtClient # 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__ = [
"DataBoundaryMgmtClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_configuration.py
index 557a9194cbd9..17d0394ed190 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_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 DataBoundaryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DataBoundaryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DataBoundaryMgmtClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_data_boundary_mgmt_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_data_boundary_mgmt_client.py
index 5d608276d49a..092d4cc5266f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_data_boundary_mgmt_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_data_boundary_mgmt_client.py
@@ -21,11 +21,10 @@
from .operations import DataBoundariesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyword
+class DataBoundaryMgmtClient:
"""Provides APIs for data boundary operations.
:ivar data_boundaries: DataBoundariesOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/__init__.py
index b783cde44051..232f214e1b14 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/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 ._data_boundary_mgmt_client import DataBoundaryMgmtClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._data_boundary_mgmt_client import DataBoundaryMgmtClient # 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__ = [
"DataBoundaryMgmtClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_configuration.py
index 84f2969fa7f4..04f05110799d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/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 DataBoundaryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DataBoundaryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DataBoundaryMgmtClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_data_boundary_mgmt_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_data_boundary_mgmt_client.py
index ba53db49496f..618f56f1b4b8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_data_boundary_mgmt_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/_data_boundary_mgmt_client.py
@@ -21,11 +21,10 @@
from .operations import DataBoundariesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DataBoundaryMgmtClient: # pylint: disable=client-accepts-api-version-keyword
+class DataBoundaryMgmtClient:
"""Provides APIs for data boundary operations.
:ivar data_boundaries: DataBoundariesOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/__init__.py
index a7df7726b48e..3cd0a7f40599 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/__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 ._operations import DataBoundariesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DataBoundariesOperations # 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__ = [
"DataBoundariesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/_operations.py
index 07fa83ef82ac..05dae662698c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -34,7 +33,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -128,7 +127,7 @@ async def put(
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -194,7 +193,7 @@ async def get_tenant(
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -250,7 +249,7 @@ async def get_scope(
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/__init__.py
index 7c22bb26b669..5a86d6a8b2c5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/__init__.py
@@ -5,22 +5,33 @@
# 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 DataBoundaryDefinition
-from ._models_py3 import DataBoundaryProperties
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ProxyResource
-from ._models_py3 import Resource
-from ._models_py3 import SystemData
+from typing import TYPE_CHECKING
-from ._data_boundary_mgmt_client_enums import CreatedByType
-from ._data_boundary_mgmt_client_enums import DataBoundary
-from ._data_boundary_mgmt_client_enums import DefaultName
-from ._data_boundary_mgmt_client_enums import ProvisioningState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ DataBoundaryDefinition,
+ DataBoundaryProperties,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ProxyResource,
+ Resource,
+ SystemData,
+)
+
+from ._data_boundary_mgmt_client_enums import ( # type: ignore
+ CreatedByType,
+ DataBoundary,
+ DefaultName,
+ ProvisioningState,
+)
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__ = [
@@ -37,5 +48,5 @@
"DefaultName",
"ProvisioningState",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/_models_py3.py
index 0b58ce3d5307..79e1a6eb03c6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -13,7 +12,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/__init__.py
index a7df7726b48e..3cd0a7f40599 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/__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 ._operations import DataBoundariesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DataBoundariesOperations # 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__ = [
"DataBoundariesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/_operations.py
index 379ce30c9ec9..ee6addacf836 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/databoundaries/v2024_08_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -30,7 +29,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -205,7 +204,7 @@ def put(
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -269,7 +268,7 @@ def get_tenant(self, default: Union[str, _models.DefaultName], **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -325,7 +324,7 @@ def get_scope(
:rtype: ~azure.mgmt.resource.databoundaries.v2024_08_01.models.DataBoundaryDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/__init__.py
index b746eedf3a2f..731e09decae9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/__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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_configuration.py
index 714a6c5db591..96d4042ffa1f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py
index 597e62dd0c1c..3459ca44b802 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/__init__.py
index 5acf3e5d4eca..fc22d8e0e292 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_configuration.py
index 1dc0402c3595..6b0bebe27352 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py
index 5075472e6ad3..661a04c47894 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py
index d5d123b0d107..a42e0f8467b6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -46,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -78,7 +77,7 @@ async def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -150,6 +149,7 @@ async def begin_create(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -180,6 +180,7 @@ async def begin_create(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -207,6 +208,7 @@ async def begin_create(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -354,7 +356,7 @@ async def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -427,7 +429,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -473,9 +475,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, script_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, script_name: str, **kwargs: Any) -> None:
"""Deletes a deployment script. When operation completes, status code 200 returned without
content.
@@ -488,7 +488,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,
@@ -531,6 +531,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists all deployment scripts for a given subscription.
:return: An iterator like instance of either DeploymentScript or the result of cls(response)
@@ -546,7 +547,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme
)
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -620,7 +621,7 @@ async def get_logs(self, resource_group_name: str, script_name: str, **kwargs: A
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -684,7 +685,7 @@ async def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -734,6 +735,7 @@ async def get_logs_default(
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists deployments scripts.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -752,7 +754,7 @@ def list_by_resource_group(
)
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/__init__.py
index ac22e28d5f93..5f5019882057 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/__init__.py
@@ -5,37 +5,48 @@
# 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 AzureCliScript
-from ._models_py3 import AzureCliScriptProperties
-from ._models_py3 import AzurePowerShellScript
-from ._models_py3 import AzurePowerShellScriptProperties
-from ._models_py3 import AzureResourceBase
-from ._models_py3 import ContainerConfiguration
-from ._models_py3 import DeploymentScript
-from ._models_py3 import DeploymentScriptListResult
-from ._models_py3 import DeploymentScriptPropertiesBase
-from ._models_py3 import DeploymentScriptUpdateParameter
-from ._models_py3 import DeploymentScriptsError
-from ._models_py3 import EnvironmentVariable
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ManagedServiceIdentity
-from ._models_py3 import ScriptConfigurationBase
-from ._models_py3 import ScriptLog
-from ._models_py3 import ScriptLogsList
-from ._models_py3 import ScriptStatus
-from ._models_py3 import StorageAccountConfiguration
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentity
+from typing import TYPE_CHECKING
-from ._deployment_scripts_client_enums import CleanupOptions
-from ._deployment_scripts_client_enums import CreatedByType
-from ._deployment_scripts_client_enums import ManagedServiceIdentityType
-from ._deployment_scripts_client_enums import ScriptProvisioningState
-from ._deployment_scripts_client_enums import ScriptType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureCliScript,
+ AzureCliScriptProperties,
+ AzurePowerShellScript,
+ AzurePowerShellScriptProperties,
+ AzureResourceBase,
+ ContainerConfiguration,
+ DeploymentScript,
+ DeploymentScriptListResult,
+ DeploymentScriptPropertiesBase,
+ DeploymentScriptUpdateParameter,
+ DeploymentScriptsError,
+ EnvironmentVariable,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ManagedServiceIdentity,
+ ScriptConfigurationBase,
+ ScriptLog,
+ ScriptLogsList,
+ ScriptStatus,
+ StorageAccountConfiguration,
+ SystemData,
+ UserAssignedIdentity,
+)
+
+from ._deployment_scripts_client_enums import ( # type: ignore
+ CleanupOptions,
+ CreatedByType,
+ ManagedServiceIdentityType,
+ ScriptProvisioningState,
+ ScriptType,
+)
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__ = [
@@ -67,5 +78,5 @@
"ScriptProvisioningState",
"ScriptType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py
index bb9f70d6ef0d..adf2f08d9c28 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -13,7 +13,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -133,7 +132,7 @@ def __init__(
self.system_data = None
-class AzureCliScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzureCliScript(DeploymentScript):
"""Object model for the Azure CLI script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -501,9 +500,7 @@ def __init__(
self.outputs = None
-class AzureCliScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzureCliScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure CLI script object.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -669,7 +666,7 @@ def __init__(
self.outputs = None
-class AzurePowerShellScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScript(DeploymentScript):
"""Object model for the Azure PowerShell script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -871,9 +868,7 @@ def __init__(
self.az_power_shell_version = az_power_shell_version
-class AzurePowerShellScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure PowerShell script object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py
index 004931079d35..b93c20e78320 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -335,7 +335,7 @@ def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -407,6 +407,7 @@ def begin_create(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -437,6 +438,7 @@ def begin_create(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -464,6 +466,7 @@ def begin_create(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.DeploymentScript]:
+ # pylint: disable=line-too-long
"""Creates a deployment script.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -611,7 +614,7 @@ def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -684,7 +687,7 @@ def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -745,7 +748,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,
@@ -788,6 +791,7 @@ def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists all deployment scripts for a given subscription.
:return: An iterator like instance of either DeploymentScript or the result of cls(response)
@@ -803,7 +807,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScr
)
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -877,7 +881,7 @@ def get_logs(self, resource_group_name: str, script_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -941,7 +945,7 @@ def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2019_10_01_preview.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -989,6 +993,7 @@ def get_logs_default(
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists deployments scripts.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1007,7 +1012,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
)
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/__init__.py
index b746eedf3a2f..731e09decae9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/__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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_configuration.py
index 3f8c1aa9b882..4c2456a6737e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py
index 301e3ac57773..b166a41584a0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/__init__.py
index 5acf3e5d4eca..fc22d8e0e292 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_configuration.py
index 9db130048e19..c864208ccc28 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py
index a467c7dbbfb6..963feb2fccc6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py
index 29daa7c90ba5..033358df8728 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -46,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -78,7 +77,7 @@ async def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -350,7 +349,7 @@ async def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -421,7 +420,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -465,9 +464,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, script_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, script_name: str, **kwargs: Any) -> None:
"""Deletes a deployment script. When operation completes, status code 200 returned without
content.
@@ -480,7 +477,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,
@@ -521,6 +518,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists all deployment scripts for a given subscription.
:return: An iterator like instance of either DeploymentScript or the result of cls(response)
@@ -534,7 +532,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -608,7 +606,7 @@ async def get_logs(self, resource_group_name: str, script_name: str, **kwargs: A
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -670,7 +668,7 @@ async def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -718,6 +716,7 @@ async def get_logs_default(
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists deployments scripts.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -734,7 +733,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/__init__.py
index ac22e28d5f93..5f5019882057 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/__init__.py
@@ -5,37 +5,48 @@
# 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 AzureCliScript
-from ._models_py3 import AzureCliScriptProperties
-from ._models_py3 import AzurePowerShellScript
-from ._models_py3 import AzurePowerShellScriptProperties
-from ._models_py3 import AzureResourceBase
-from ._models_py3 import ContainerConfiguration
-from ._models_py3 import DeploymentScript
-from ._models_py3 import DeploymentScriptListResult
-from ._models_py3 import DeploymentScriptPropertiesBase
-from ._models_py3 import DeploymentScriptUpdateParameter
-from ._models_py3 import DeploymentScriptsError
-from ._models_py3 import EnvironmentVariable
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ManagedServiceIdentity
-from ._models_py3 import ScriptConfigurationBase
-from ._models_py3 import ScriptLog
-from ._models_py3 import ScriptLogsList
-from ._models_py3 import ScriptStatus
-from ._models_py3 import StorageAccountConfiguration
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentity
+from typing import TYPE_CHECKING
-from ._deployment_scripts_client_enums import CleanupOptions
-from ._deployment_scripts_client_enums import CreatedByType
-from ._deployment_scripts_client_enums import ManagedServiceIdentityType
-from ._deployment_scripts_client_enums import ScriptProvisioningState
-from ._deployment_scripts_client_enums import ScriptType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureCliScript,
+ AzureCliScriptProperties,
+ AzurePowerShellScript,
+ AzurePowerShellScriptProperties,
+ AzureResourceBase,
+ ContainerConfiguration,
+ DeploymentScript,
+ DeploymentScriptListResult,
+ DeploymentScriptPropertiesBase,
+ DeploymentScriptUpdateParameter,
+ DeploymentScriptsError,
+ EnvironmentVariable,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ManagedServiceIdentity,
+ ScriptConfigurationBase,
+ ScriptLog,
+ ScriptLogsList,
+ ScriptStatus,
+ StorageAccountConfiguration,
+ SystemData,
+ UserAssignedIdentity,
+)
+
+from ._deployment_scripts_client_enums import ( # type: ignore
+ CleanupOptions,
+ CreatedByType,
+ ManagedServiceIdentityType,
+ ScriptProvisioningState,
+ ScriptType,
+)
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__ = [
@@ -67,5 +78,5 @@
"ScriptProvisioningState",
"ScriptType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py
index b0bcd845b46d..880c1c38bda7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -13,7 +13,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -130,7 +129,7 @@ def __init__(
self.system_data = None
-class AzureCliScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzureCliScript(DeploymentScript):
"""Object model for the Azure CLI script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -493,9 +492,7 @@ def __init__(
self.outputs = None
-class AzureCliScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzureCliScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure CLI script object.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -660,7 +657,7 @@ def __init__(
self.outputs = None
-class AzurePowerShellScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScript(DeploymentScript):
"""Object model for the Azure PowerShell script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -858,9 +855,7 @@ def __init__(
self.az_power_shell_version = az_power_shell_version
-class AzurePowerShellScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure PowerShell script object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py
index 249e248d238e..2507cb553b76 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -335,7 +335,7 @@ def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -607,7 +607,7 @@ def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -678,7 +678,7 @@ def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -737,7 +737,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,
@@ -791,7 +791,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScr
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -865,7 +865,7 @@ def get_logs(self, resource_group_name: str, script_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -927,7 +927,7 @@ def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2020_10_01.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -989,7 +989,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._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/__init__.py
index b746eedf3a2f..731e09decae9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/__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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_configuration.py
index f466b3a19292..f4bed9fe3ee9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_deployment_scripts_client.py
index 3cc3b1d1c1f9..bbd58c529df4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/__init__.py
index 5acf3e5d4eca..fc22d8e0e292 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/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 ._deployment_scripts_client import DeploymentScriptsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_scripts_client import DeploymentScriptsClient # 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__ = [
"DeploymentScriptsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_configuration.py
index 74de59ab37b8..9bd0f22362c0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/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 DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentScriptsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentScriptsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_deployment_scripts_client.py
index 286e4496e72e..6e17a694414a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_deployment_scripts_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/_deployment_scripts_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentScriptsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DeploymentScriptsClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentScriptsClient:
"""The APIs listed in this specification can be used to manage Deployment Scripts resource through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/_operations.py
index 44f353103224..6fcbd6909dda 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -46,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -78,7 +77,7 @@ async def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -350,7 +349,7 @@ async def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -421,7 +420,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -465,9 +464,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, script_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, script_name: str, **kwargs: Any) -> None:
"""Deletes a deployment script. When operation completes, status code 200 returned without
content.
@@ -480,7 +477,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,
@@ -521,6 +518,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists all deployment scripts for a given subscription.
:return: An iterator like instance of either DeploymentScript or the result of cls(response)
@@ -534,7 +532,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -608,7 +606,7 @@ async def get_logs(self, resource_group_name: str, script_name: str, **kwargs: A
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -670,7 +668,7 @@ async def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -718,6 +716,7 @@ async def get_logs_default(
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentScript"]:
+ # pylint: disable=line-too-long
"""Lists deployments scripts.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -734,7 +733,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/__init__.py
index d46b4c53d868..8d9cb66b768b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/__init__.py
@@ -5,38 +5,49 @@
# 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 AzureCliScript
-from ._models_py3 import AzureCliScriptProperties
-from ._models_py3 import AzurePowerShellScript
-from ._models_py3 import AzurePowerShellScriptProperties
-from ._models_py3 import AzureResourceBase
-from ._models_py3 import ContainerConfiguration
-from ._models_py3 import ContainerGroupSubnetId
-from ._models_py3 import DeploymentScript
-from ._models_py3 import DeploymentScriptListResult
-from ._models_py3 import DeploymentScriptPropertiesBase
-from ._models_py3 import DeploymentScriptUpdateParameter
-from ._models_py3 import DeploymentScriptsError
-from ._models_py3 import EnvironmentVariable
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ManagedServiceIdentity
-from ._models_py3 import ScriptConfigurationBase
-from ._models_py3 import ScriptLog
-from ._models_py3 import ScriptLogsList
-from ._models_py3 import ScriptStatus
-from ._models_py3 import StorageAccountConfiguration
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentity
+from typing import TYPE_CHECKING
-from ._deployment_scripts_client_enums import CleanupOptions
-from ._deployment_scripts_client_enums import CreatedByType
-from ._deployment_scripts_client_enums import ManagedServiceIdentityType
-from ._deployment_scripts_client_enums import ScriptProvisioningState
-from ._deployment_scripts_client_enums import ScriptType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureCliScript,
+ AzureCliScriptProperties,
+ AzurePowerShellScript,
+ AzurePowerShellScriptProperties,
+ AzureResourceBase,
+ ContainerConfiguration,
+ ContainerGroupSubnetId,
+ DeploymentScript,
+ DeploymentScriptListResult,
+ DeploymentScriptPropertiesBase,
+ DeploymentScriptUpdateParameter,
+ DeploymentScriptsError,
+ EnvironmentVariable,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ManagedServiceIdentity,
+ ScriptConfigurationBase,
+ ScriptLog,
+ ScriptLogsList,
+ ScriptStatus,
+ StorageAccountConfiguration,
+ SystemData,
+ UserAssignedIdentity,
+)
+
+from ._deployment_scripts_client_enums import ( # type: ignore
+ CleanupOptions,
+ CreatedByType,
+ ManagedServiceIdentityType,
+ ScriptProvisioningState,
+ ScriptType,
+)
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__ = [
@@ -69,5 +80,5 @@
"ScriptProvisioningState",
"ScriptType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/_models_py3.py
index d054ebc7516b..56aec5ebdb9b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -13,7 +13,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -130,7 +129,7 @@ def __init__(
self.system_data = None
-class AzureCliScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzureCliScript(DeploymentScript):
"""Object model for the Azure CLI script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -493,9 +492,7 @@ def __init__(
self.outputs = None
-class AzureCliScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzureCliScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure CLI script object.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -660,7 +657,7 @@ def __init__(
self.outputs = None
-class AzurePowerShellScript(DeploymentScript): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScript(DeploymentScript):
"""Object model for the Azure PowerShell script.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -858,9 +855,7 @@ def __init__(
self.az_power_shell_version = az_power_shell_version
-class AzurePowerShellScriptProperties(
- DeploymentScriptPropertiesBase, ScriptConfigurationBase
-): # pylint: disable=too-many-instance-attributes
+class AzurePowerShellScriptProperties(DeploymentScriptPropertiesBase, ScriptConfigurationBase):
"""Properties of the Azure PowerShell script object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/__init__.py
index 3629550dcb98..3b66498dc268 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/__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 ._operations import DeploymentScriptsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentScriptsOperations # 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__ = [
"DeploymentScriptsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/_operations.py
index 956aa509fa4a..b1777602b667 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2023_08_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -335,7 +335,7 @@ def _create_initial(
deployment_script: Union[_models.DeploymentScript, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -607,7 +607,7 @@ def update(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -678,7 +678,7 @@ def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.DeploymentScript
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -737,7 +737,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,
@@ -791,7 +791,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScr
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -865,7 +865,7 @@ def get_logs(self, resource_group_name: str, script_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.ScriptLogsList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -927,7 +927,7 @@ def get_logs_default(
:rtype: ~azure.mgmt.resource.deploymentscripts.v2023_08_01.models.ScriptLog
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -989,7 +989,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._api_version or "2023-08-01"))
cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/__init__.py
index 855a759959e3..5bf78cf3940b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/__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 ._deployment_stacks_client import DeploymentStacksClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_stacks_client import DeploymentStacksClient # 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__ = [
"DeploymentStacksClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_configuration.py
index 4a7e4d0f960a..64a91adad3c2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_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 DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentStacksClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py
index d5c72f7a9367..3434106eb528 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentStacksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DeploymentStacksClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentStacksClient:
"""The APIs listed in this specification can be used to manage deployment stack resources through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/__init__.py
index 5a9967ee126d..9855d0496a24 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/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 ._deployment_stacks_client import DeploymentStacksClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_stacks_client import DeploymentStacksClient # 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__ = [
"DeploymentStacksClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_configuration.py
index a4c5ad25f574..284517a52d11 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/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 DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentStacksClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py
index 4ec2a36ede67..79c870f1f4f0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentStacksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DeploymentStacksClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentStacksClient:
"""The APIs listed in this specification can be used to manage deployment stack resources through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/__init__.py
index 0945e1f1e205..d94766889e59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/__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 ._operations import DeploymentStacksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentStacksOperations # 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__ = [
"DeploymentStacksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py
index 4edd0d0a2fcc..3ae7023d5f39 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -53,7 +53,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,6 +82,7 @@ def __init__(self, *args, **kwargs) -> None:
def list_at_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment Stacks within the specified resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -100,7 +101,7 @@ def list_at_resource_group(
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -164,6 +165,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_at_subscription(self, **kwargs: Any) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment Stacks within the specified subscription.
:return: An iterator like instance of either DeploymentStack or the result of cls(response)
@@ -179,7 +181,7 @@ def list_at_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -244,6 +246,7 @@ async def get_next(next_link=None):
def list_at_management_group(
self, management_group_id: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment Stacks within the specified management group.
:param management_group_id: Management Group. Required.
@@ -261,7 +264,7 @@ def list_at_management_group(
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -329,7 +332,7 @@ async def _create_or_update_at_resource_group_initial( # pylint: disable=name-t
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -401,6 +404,7 @@ async def begin_create_or_update_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -431,6 +435,7 @@ async def begin_create_or_update_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -458,6 +463,7 @@ async def begin_create_or_update_at_resource_group(
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -542,7 +548,7 @@ async def get_at_resource_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -595,7 +601,7 @@ async def _delete_at_resource_group_initial(
unmanage_action_resource_groups: Optional[Union[str, _models.UnmanageActionResourceGroupMode]] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -729,7 +735,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -799,6 +805,7 @@ async def begin_create_or_update_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param deployment_stack_name: Name of the deployment stack. Required.
@@ -825,6 +832,7 @@ async def begin_create_or_update_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param deployment_stack_name: Name of the deployment stack. Required.
@@ -845,6 +853,7 @@ async def begin_create_or_update_at_subscription(
async def begin_create_or_update_at_subscription(
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param deployment_stack_name: Name of the deployment stack. Required.
@@ -920,7 +929,7 @@ async def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -971,7 +980,7 @@ async def _delete_at_subscription_initial(
unmanage_action_resource_groups: Optional[Union[str, _models.UnmanageActionResourceGroupMode]] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1103,7 +1112,7 @@ async def _create_or_update_at_management_group_initial( # pylint: disable=name
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1174,6 +1183,7 @@ async def begin_create_or_update_at_management_group( # pylint: disable=name-to
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param management_group_id: Management Group. Required.
@@ -1203,6 +1213,7 @@ async def begin_create_or_update_at_management_group( # pylint: disable=name-to
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param management_group_id: Management Group. Required.
@@ -1229,6 +1240,7 @@ async def begin_create_or_update_at_management_group( # pylint: disable=name-to
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStack]:
+ # pylint: disable=line-too-long
"""Creates or updates a Deployment Stack.
:param management_group_id: Management Group. Required.
@@ -1311,7 +1323,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1364,7 +1376,7 @@ async def _delete_at_management_group_initial(
unmanage_action_management_groups: Optional[Union[str, _models.UnmanageActionManagementGroupMode]] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1516,7 +1528,7 @@ async def export_template_at_resource_group(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1574,7 +1586,7 @@ async def export_template_at_subscription(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1633,7 +1645,7 @@ async def export_template_at_management_group(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/__init__.py
index d588e61c6230..1634d01ff5a4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/__init__.py
@@ -5,37 +5,48 @@
# 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 AzureResourceBase
-from ._models_py3 import DenySettings
-from ._models_py3 import DeploymentStack
-from ._models_py3 import DeploymentStackListResult
-from ._models_py3 import DeploymentStackProperties
-from ._models_py3 import DeploymentStackPropertiesActionOnUnmanage
-from ._models_py3 import DeploymentStackTemplateDefinition
-from ._models_py3 import DeploymentStacksDebugSetting
-from ._models_py3 import DeploymentStacksError
-from ._models_py3 import DeploymentStacksParametersLink
-from ._models_py3 import DeploymentStacksTemplateLink
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ManagedResourceReference
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourceReferenceExtended
-from ._models_py3 import SystemData
+from typing import TYPE_CHECKING
-from ._deployment_stacks_client_enums import CreatedByType
-from ._deployment_stacks_client_enums import DenySettingsMode
-from ._deployment_stacks_client_enums import DenyStatusMode
-from ._deployment_stacks_client_enums import DeploymentStackProvisioningState
-from ._deployment_stacks_client_enums import DeploymentStacksDeleteDetachEnum
-from ._deployment_stacks_client_enums import ResourceStatusMode
-from ._deployment_stacks_client_enums import UnmanageActionManagementGroupMode
-from ._deployment_stacks_client_enums import UnmanageActionResourceGroupMode
-from ._deployment_stacks_client_enums import UnmanageActionResourceMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureResourceBase,
+ DenySettings,
+ DeploymentStack,
+ DeploymentStackListResult,
+ DeploymentStackProperties,
+ DeploymentStackPropertiesActionOnUnmanage,
+ DeploymentStackTemplateDefinition,
+ DeploymentStacksDebugSetting,
+ DeploymentStacksError,
+ DeploymentStacksParametersLink,
+ DeploymentStacksTemplateLink,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ManagedResourceReference,
+ ResourceReference,
+ ResourceReferenceExtended,
+ SystemData,
+)
+
+from ._deployment_stacks_client_enums import ( # type: ignore
+ CreatedByType,
+ DenySettingsMode,
+ DenyStatusMode,
+ DeploymentStackProvisioningState,
+ DeploymentStacksDeleteDetachEnum,
+ ResourceStatusMode,
+ UnmanageActionManagementGroupMode,
+ UnmanageActionResourceGroupMode,
+ UnmanageActionResourceMode,
+)
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__ = [
@@ -67,5 +78,5 @@
"UnmanageActionResourceGroupMode",
"UnmanageActionResourceMode",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/_models_py3.py
index d4ada2977cf2..964882cbbba2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -132,7 +131,7 @@ def __init__(
self.apply_to_child_scopes = apply_to_child_scopes
-class DeploymentStack(AzureResourceBase): # pylint: disable=too-many-instance-attributes
+class DeploymentStack(AzureResourceBase):
"""Deployment stack object.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -410,7 +409,7 @@ def __init__(self, *, error: Optional["_models.ErrorResponse"] = None, **kwargs:
self.error = error
-class DeploymentStackProperties(DeploymentStacksError): # pylint: disable=too-many-instance-attributes
+class DeploymentStackProperties(DeploymentStacksError):
"""Deployment stack properties.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/__init__.py
index 0945e1f1e205..d94766889e59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/__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 ._operations import DeploymentStacksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentStacksOperations # 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__ = [
"DeploymentStacksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py
index d82453ec43ff..6dc0fc409a41 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -691,7 +691,7 @@ def list_at_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -770,7 +770,7 @@ def list_at_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentSta
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -850,7 +850,7 @@ def list_at_management_group(self, management_group_id: str, **kwargs: Any) -> I
)
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -918,7 +918,7 @@ def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-lon
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1130,7 +1130,7 @@ def get_at_resource_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1183,7 +1183,7 @@ def _delete_at_resource_group_initial(
unmanage_action_resource_groups: Optional[Union[str, _models.UnmanageActionResourceGroupMode]] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1317,7 +1317,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1507,7 +1507,7 @@ def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1558,7 +1558,7 @@ def _delete_at_subscription_initial(
unmanage_action_resource_groups: Optional[Union[str, _models.UnmanageActionResourceGroupMode]] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1690,7 +1690,7 @@ def _create_or_update_at_management_group_initial( # pylint: disable=name-too-l
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1897,7 +1897,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1950,7 +1950,7 @@ def _delete_at_management_group_initial(
unmanage_action_management_groups: Optional[Union[str, _models.UnmanageActionManagementGroupMode]] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2102,7 +2102,7 @@ def export_template_at_resource_group(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2160,7 +2160,7 @@ def export_template_at_subscription(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2219,7 +2219,7 @@ def export_template_at_management_group(
~azure.mgmt.resource.deploymentstacks.v2022_08_01_preview.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/__init__.py
index 855a759959e3..5bf78cf3940b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/__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 ._deployment_stacks_client import DeploymentStacksClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_stacks_client import DeploymentStacksClient # 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__ = [
"DeploymentStacksClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_configuration.py
index eded6e3450a3..a20831c4cfe1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_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 DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentStacksClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_deployment_stacks_client.py
index 666af02a3305..7c42f1c96646 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_deployment_stacks_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_deployment_stacks_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentStacksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DeploymentStacksClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentStacksClient:
"""The APIs listed in this specification can be used to manage Deployment stack resources through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/__init__.py
index 5a9967ee126d..9855d0496a24 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/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 ._deployment_stacks_client import DeploymentStacksClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._deployment_stacks_client import DeploymentStacksClient # 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__ = [
"DeploymentStacksClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_configuration.py
index 62f4d41966fd..905fa81464a3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/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 DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class DeploymentStacksClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeploymentStacksClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_deployment_stacks_client.py
index 232e78a56dce..d472703c6653 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_deployment_stacks_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/_deployment_stacks_client.py
@@ -21,11 +21,10 @@
from .operations import DeploymentStacksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DeploymentStacksClient: # pylint: disable=client-accepts-api-version-keyword
+class DeploymentStacksClient:
"""The APIs listed in this specification can be used to manage Deployment stack resources through
the Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/__init__.py
index 0945e1f1e205..d94766889e59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/__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 ._operations import DeploymentStacksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentStacksOperations # 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__ = [
"DeploymentStacksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/_operations.py
index e523abc83eba..15ac1647f7dd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -56,7 +56,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -85,6 +85,7 @@ def __init__(self, *args, **kwargs) -> None:
def list_at_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment stacks within the specified Resource Group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -101,7 +102,7 @@ def list_at_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_at_subscription(self, **kwargs: Any) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment stacks within the specified Subscription.
:return: An iterator like instance of either DeploymentStack or the result of cls(response)
@@ -178,7 +180,7 @@ def list_at_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -243,6 +245,7 @@ async def get_next(next_link=None):
def list_at_management_group(
self, management_group_id: str, **kwargs: Any
) -> AsyncIterable["_models.DeploymentStack"]:
+ # pylint: disable=line-too-long
"""Lists all the Deployment stacks within the specified Management Group.
:param management_group_id: Management Group id. Required.
@@ -258,7 +261,7 @@ def list_at_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -326,7 +329,7 @@ async def _create_or_update_at_resource_group_initial( # pylint: disable=name-t
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -535,7 +538,7 @@ async def get_at_resource_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -588,7 +591,7 @@ async def _delete_at_resource_group_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -731,7 +734,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -918,7 +921,7 @@ async def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -969,7 +972,7 @@ async def _delete_at_subscription_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1110,7 +1113,7 @@ async def _create_or_update_at_management_group_initial( # pylint: disable=name
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1314,7 +1317,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1366,7 +1369,7 @@ async def _delete_at_management_group_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1520,7 +1523,7 @@ async def export_template_at_resource_group(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1576,7 +1579,7 @@ async def export_template_at_subscription(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1633,7 +1636,7 @@ async def export_template_at_management_group(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1682,7 +1685,7 @@ async def _validate_stack_at_resource_group_initial( # pylint: disable=name-too
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1757,6 +1760,7 @@ async def begin_validate_stack_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -1788,6 +1792,7 @@ async def begin_validate_stack_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -1816,6 +1821,7 @@ async def begin_validate_stack_at_resource_group(
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -1886,7 +1892,7 @@ def get_long_running_output(pipeline_response):
async def _validate_stack_at_subscription_initial(
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1959,6 +1965,7 @@ async def begin_validate_stack_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -1986,6 +1993,7 @@ async def begin_validate_stack_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2007,6 +2015,7 @@ async def begin_validate_stack_at_subscription(
async def begin_validate_stack_at_subscription(
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2077,7 +2086,7 @@ async def _validate_stack_at_management_group_initial( # pylint: disable=name-t
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2151,6 +2160,7 @@ async def begin_validate_stack_at_management_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
@@ -2181,6 +2191,7 @@ async def begin_validate_stack_at_management_group(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
@@ -2208,6 +2219,7 @@ async def begin_validate_stack_at_management_group(
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/__init__.py
index 3bf745d41b24..bfd4c3df4b12 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/__init__.py
@@ -5,41 +5,52 @@
# 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 ActionOnUnmanage
-from ._models_py3 import AzureResourceBase
-from ._models_py3 import DenySettings
-from ._models_py3 import DeploymentParameter
-from ._models_py3 import DeploymentStack
-from ._models_py3 import DeploymentStackListResult
-from ._models_py3 import DeploymentStackProperties
-from ._models_py3 import DeploymentStackTemplateDefinition
-from ._models_py3 import DeploymentStackValidateProperties
-from ._models_py3 import DeploymentStackValidateResult
-from ._models_py3 import DeploymentStacksDebugSetting
-from ._models_py3 import DeploymentStacksError
-from ._models_py3 import DeploymentStacksParametersLink
-from ._models_py3 import DeploymentStacksTemplateLink
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import KeyVaultParameterReference
-from ._models_py3 import KeyVaultReference
-from ._models_py3 import ManagedResourceReference
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourceReferenceExtended
-from ._models_py3 import SystemData
+from typing import TYPE_CHECKING
-from ._deployment_stacks_client_enums import CreatedByType
-from ._deployment_stacks_client_enums import DenySettingsMode
-from ._deployment_stacks_client_enums import DenyStatusMode
-from ._deployment_stacks_client_enums import DeploymentStackProvisioningState
-from ._deployment_stacks_client_enums import DeploymentStacksDeleteDetachEnum
-from ._deployment_stacks_client_enums import ResourceStatusMode
-from ._deployment_stacks_client_enums import UnmanageActionManagementGroupMode
-from ._deployment_stacks_client_enums import UnmanageActionResourceGroupMode
-from ._deployment_stacks_client_enums import UnmanageActionResourceMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ActionOnUnmanage,
+ AzureResourceBase,
+ DenySettings,
+ DeploymentParameter,
+ DeploymentStack,
+ DeploymentStackListResult,
+ DeploymentStackProperties,
+ DeploymentStackTemplateDefinition,
+ DeploymentStackValidateProperties,
+ DeploymentStackValidateResult,
+ DeploymentStacksDebugSetting,
+ DeploymentStacksError,
+ DeploymentStacksParametersLink,
+ DeploymentStacksTemplateLink,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ KeyVaultParameterReference,
+ KeyVaultReference,
+ ManagedResourceReference,
+ ResourceReference,
+ ResourceReferenceExtended,
+ SystemData,
+)
+
+from ._deployment_stacks_client_enums import ( # type: ignore
+ CreatedByType,
+ DenySettingsMode,
+ DenyStatusMode,
+ DeploymentStackProvisioningState,
+ DeploymentStacksDeleteDetachEnum,
+ ResourceStatusMode,
+ UnmanageActionManagementGroupMode,
+ UnmanageActionResourceGroupMode,
+ UnmanageActionResourceMode,
+)
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__ = [
@@ -75,5 +86,5 @@
"UnmanageActionResourceGroupMode",
"UnmanageActionResourceMode",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/_models_py3.py
index 452ab297c68a..963267c9e631 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -237,7 +236,7 @@ def __init__(
self.reference = reference
-class DeploymentStack(AzureResourceBase): # pylint: disable=too-many-instance-attributes
+class DeploymentStack(AzureResourceBase):
"""Deployment stack object.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -523,7 +522,7 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A
self.error = error
-class DeploymentStackProperties(DeploymentStacksError): # pylint: disable=too-many-instance-attributes
+class DeploymentStackProperties(DeploymentStacksError):
"""Deployment stack properties.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/__init__.py
index 0945e1f1e205..d94766889e59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/__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 ._operations import DeploymentStacksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentStacksOperations # 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__ = [
"DeploymentStacksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/_operations.py
index 10e3af6d48c0..3ff262731289 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2024_03_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -839,7 +839,7 @@ def list_at_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -916,7 +916,7 @@ def list_at_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentSta
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -994,7 +994,7 @@ def list_at_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-03-01"))
cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1062,7 +1062,7 @@ def _create_or_update_at_resource_group_initial( # pylint: disable=name-too-lon
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1270,7 +1270,7 @@ def get_at_resource_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1323,7 +1323,7 @@ def _delete_at_resource_group_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_at_subscription_initial( # pylint: disable=name-too-long
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1652,7 +1652,7 @@ def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1703,7 +1703,7 @@ def _delete_at_subscription_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1844,7 +1844,7 @@ def _create_or_update_at_management_group_initial( # pylint: disable=name-too-l
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2047,7 +2047,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStack
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2099,7 +2099,7 @@ def _delete_at_management_group_initial(
bypass_stack_out_of_sync_error: Optional[bool] = None,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2253,7 +2253,7 @@ def export_template_at_resource_group(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2309,7 +2309,7 @@ def export_template_at_subscription(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2366,7 +2366,7 @@ def export_template_at_management_group(
~azure.mgmt.resource.deploymentstacks.v2024_03_01.models.DeploymentStackTemplateDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2415,7 +2415,7 @@ def _validate_stack_at_resource_group_initial( # pylint: disable=name-too-long
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2490,6 +2490,7 @@ def begin_validate_stack_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2521,6 +2522,7 @@ def begin_validate_stack_at_resource_group(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2549,6 +2551,7 @@ def begin_validate_stack_at_resource_group(
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Resource Group scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2619,7 +2622,7 @@ def get_long_running_output(pipeline_response):
def _validate_stack_at_subscription_initial(
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2692,6 +2695,7 @@ def begin_validate_stack_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2719,6 +2723,7 @@ def begin_validate_stack_at_subscription(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2740,6 +2745,7 @@ def begin_validate_stack_at_subscription(
def begin_validate_stack_at_subscription(
self, deployment_stack_name: str, deployment_stack: Union[_models.DeploymentStack, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Subscription scoped Deployment stack template to verify its
acceptance to Azure Resource Manager.
@@ -2810,7 +2816,7 @@ def _validate_stack_at_management_group_initial( # pylint: disable=name-too-lon
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2884,6 +2890,7 @@ def begin_validate_stack_at_management_group(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
@@ -2914,6 +2921,7 @@ def begin_validate_stack_at_management_group(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
@@ -2941,6 +2949,7 @@ def begin_validate_stack_at_management_group(
deployment_stack: Union[_models.DeploymentStack, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.DeploymentStackValidateResult]:
+ # pylint: disable=line-too-long
"""Runs preflight validation on the Management Group scoped Deployment stack template to verify
its acceptance to Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/__init__.py
index db62bac61b6e..5f396af91593 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/__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 ._feature_client import FeatureClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._feature_client import FeatureClient # 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__ = [
"FeatureClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_configuration.py
index 91fdbec008b8..515fdfdbb168 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py
index a31ea60063f6..a59b2c6d4913 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py
@@ -21,11 +21,10 @@
from .operations import FeatureClientOperationsMixin, FeaturesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class FeatureClient(FeatureClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class FeatureClient(FeatureClientOperationsMixin):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to
control feature exposure to users. Resource providers typically use this mechanism to provide
public/private preview for new features prior to making them generally available. Users need to
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py
index a7defff18a11..81f463be6e5d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import FeatureClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/__init__.py
index 43af45c2778f..3b17bd37a7b6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/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 ._feature_client import FeatureClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._feature_client import FeatureClient # 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__ = [
"FeatureClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_configuration.py
index a567f419ebf8..2e5726569898 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py
index be91bbd71e56..5aefa16c71a9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py
@@ -21,11 +21,10 @@
from .operations import FeatureClientOperationsMixin, FeaturesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class FeatureClient(FeatureClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class FeatureClient(FeatureClientOperationsMixin):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to
control feature exposure to users. Resource providers typically use this mechanism to provide
public/private preview for new features prior to making them generally available. Users need to
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_vendor.py
index 5958d46d3b43..b3bb53cb44ab 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import FeatureClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/__init__.py
index f566b08e6dc8..b66431071e1b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import FeatureClientOperationsMixin
-from ._operations import FeaturesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import FeatureClientOperationsMixin # type: ignore
+from ._operations import FeaturesOperations # 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__ = [
"FeatureClientOperationsMixin",
"FeaturesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py
index bc769a5908c4..4a9d05d62040 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -69,7 +68,7 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -164,7 +163,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -243,7 +242,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> AsyncIterable
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -316,7 +315,7 @@ async def get(self, resource_provider_namespace: str, feature_name: str, **kwarg
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -372,7 +371,7 @@ async def register(
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -428,7 +427,7 @@ async def unregister(
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py
index ba6ccc60871a..e2816e56d1ce 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/__init__.py
@@ -5,15 +5,24 @@
# 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 FeatureOperationsListResult
-from ._models_py3 import FeatureProperties
-from ._models_py3 import FeatureResult
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ FeatureOperationsListResult,
+ FeatureProperties,
+ FeatureResult,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+)
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__ = [
@@ -24,5 +33,5 @@
"OperationDisplay",
"OperationListResult",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/_models_py3.py
index e36a8c371c3c..8c2dd1e652bf 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/__init__.py
index f566b08e6dc8..b66431071e1b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import FeatureClientOperationsMixin
-from ._operations import FeaturesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import FeatureClientOperationsMixin # type: ignore
+from ._operations import FeaturesOperations # 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__ = [
"FeatureClientOperationsMixin",
"FeaturesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py
index d7984b30755e..1603c446ca53 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -228,7 +227,7 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -323,7 +322,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -402,7 +401,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> Iterable["_mo
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -475,7 +474,7 @@ def get(self, resource_provider_namespace: str, feature_name: str, **kwargs: Any
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -529,7 +528,7 @@ def register(self, resource_provider_namespace: str, feature_name: str, **kwargs
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -583,7 +582,7 @@ def unregister(self, resource_provider_namespace: str, feature_name: str, **kwar
:rtype: ~azure.mgmt.resource.features.v2015_12_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/__init__.py
index db62bac61b6e..5f396af91593 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/__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 ._feature_client import FeatureClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._feature_client import FeatureClient # 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__ = [
"FeatureClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py
index 105c13f55b1e..3dea31c44254 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py
index d7245ac8e006..2a7182a7f349 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py
@@ -21,11 +21,10 @@
from .operations import FeatureClientOperationsMixin, FeaturesOperations, SubscriptionFeatureRegistrationsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class FeatureClient(FeatureClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class FeatureClient(FeatureClientOperationsMixin):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to
control feature exposure to users. Resource providers typically use this mechanism to provide
public/private preview for new features prior to making them generally available. Users need to
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py
index a7defff18a11..81f463be6e5d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import FeatureClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/__init__.py
index 43af45c2778f..3b17bd37a7b6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/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 ._feature_client import FeatureClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._feature_client import FeatureClient # 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__ = [
"FeatureClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_configuration.py
index b174d941cc5c..cde1e2fdc410 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py
index d51d13f63566..3291e05ceec8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py
@@ -21,11 +21,10 @@
from .operations import FeatureClientOperationsMixin, FeaturesOperations, SubscriptionFeatureRegistrationsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class FeatureClient(FeatureClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class FeatureClient(FeatureClientOperationsMixin):
"""Azure Feature Exposure Control (AFEC) provides a mechanism for the resource providers to
control feature exposure to users. Resource providers typically use this mechanism to provide
public/private preview for new features prior to making them generally available. Users need to
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_vendor.py
index 5958d46d3b43..b3bb53cb44ab 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import FeatureClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/__init__.py
index d90f2d645416..94a54798df3e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import FeatureClientOperationsMixin
-from ._operations import FeaturesOperations
-from ._operations import SubscriptionFeatureRegistrationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import FeatureClientOperationsMixin # type: ignore
+from ._operations import FeaturesOperations # type: ignore
+from ._operations import SubscriptionFeatureRegistrationsOperations # 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__ = [
@@ -19,5 +25,5 @@
"FeaturesOperations",
"SubscriptionFeatureRegistrationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py
index c8d240d50af4..b7b8d757c0e5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -46,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,7 +74,7 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -171,7 +170,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -251,7 +250,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> AsyncIterable
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -325,7 +324,7 @@ async def get(self, resource_provider_namespace: str, feature_name: str, **kwarg
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -382,7 +381,7 @@ async def register(
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -439,7 +438,7 @@ async def unregister(
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -517,7 +516,7 @@ async def get(
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.SubscriptionFeatureRegistration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -639,7 +638,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.SubscriptionFeatureRegistration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -698,9 +697,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, provider_namespace: str, feature_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, provider_namespace: str, feature_name: str, **kwargs: Any) -> None:
"""Deletes a feature registration.
:param provider_namespace: The provider namespace. Required.
@@ -711,7 +708,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,
@@ -754,6 +751,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list_by_subscription(
self, provider_namespace: str, **kwargs: Any
) -> AsyncIterable["_models.SubscriptionFeatureRegistration"]:
+ # pylint: disable=line-too-long
"""Returns subscription feature registrations for given subscription and provider namespace.
:param provider_namespace: The provider namespace. Required.
@@ -770,7 +768,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -834,6 +832,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_all_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SubscriptionFeatureRegistration"]:
+ # pylint: disable=line-too-long
"""Returns subscription feature registrations for given subscription.
:return: An iterator like instance of either SubscriptionFeatureRegistration or the result of
@@ -848,7 +847,7 @@ def list_all_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Subs
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/__init__.py
index 941c11097915..2c526158845f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/__init__.py
@@ -5,25 +5,36 @@
# 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 AuthorizationProfile
-from ._models_py3 import ErrorDefinition
-from ._models_py3 import ErrorResponse
-from ._models_py3 import FeatureOperationsListResult
-from ._models_py3 import FeatureProperties
-from ._models_py3 import FeatureResult
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ProxyResource
-from ._models_py3 import SubscriptionFeatureRegistration
-from ._models_py3 import SubscriptionFeatureRegistrationList
-from ._models_py3 import SubscriptionFeatureRegistrationProperties
+from typing import TYPE_CHECKING
-from ._feature_client_enums import SubscriptionFeatureRegistrationApprovalType
-from ._feature_client_enums import SubscriptionFeatureRegistrationState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AuthorizationProfile,
+ ErrorDefinition,
+ ErrorResponse,
+ FeatureOperationsListResult,
+ FeatureProperties,
+ FeatureResult,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ProxyResource,
+ SubscriptionFeatureRegistration,
+ SubscriptionFeatureRegistrationList,
+ SubscriptionFeatureRegistrationProperties,
+)
+
+from ._feature_client_enums import ( # type: ignore
+ SubscriptionFeatureRegistrationApprovalType,
+ SubscriptionFeatureRegistrationState,
+)
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__ = [
@@ -43,5 +54,5 @@
"SubscriptionFeatureRegistrationApprovalType",
"SubscriptionFeatureRegistrationState",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/_models_py3.py
index 87a67fbd4fcb..5e43737a1bae 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
@@ -413,9 +411,7 @@ def __init__(
self.value = value
-class SubscriptionFeatureRegistrationProperties(
- _serialization.Model
-): # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionFeatureRegistrationProperties(_serialization.Model): # pylint: disable=name-too-long
"""SubscriptionFeatureRegistrationProperties.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/__init__.py
index d90f2d645416..94a54798df3e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import FeatureClientOperationsMixin
-from ._operations import FeaturesOperations
-from ._operations import SubscriptionFeatureRegistrationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import FeatureClientOperationsMixin # type: ignore
+from ._operations import FeaturesOperations # type: ignore
+from ._operations import SubscriptionFeatureRegistrationsOperations # 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__ = [
@@ -19,5 +25,5 @@
"FeaturesOperations",
"SubscriptionFeatureRegistrationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py
index 7c1c375be682..ab7ee5f3df69 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +33,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -383,7 +383,7 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -479,7 +479,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -559,7 +559,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> Iterable["_mo
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -633,7 +633,7 @@ def get(self, resource_provider_namespace: str, feature_name: str, **kwargs: Any
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -688,7 +688,7 @@ def register(self, resource_provider_namespace: str, feature_name: str, **kwargs
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -743,7 +743,7 @@ def unregister(self, resource_provider_namespace: str, feature_name: str, **kwar
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.FeatureResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -819,7 +819,7 @@ def get(self, provider_namespace: str, feature_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.SubscriptionFeatureRegistration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -941,7 +941,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.features.v2021_07_01.models.SubscriptionFeatureRegistration
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1013,7 +1013,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,
@@ -1072,7 +1072,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1150,7 +1150,7 @@ def list_all_by_subscription(self, **kwargs: Any) -> Iterable["_models.Subscript
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01"))
cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/__init__.py
index a481ab161833..8405b984d233 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/__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 ._management_link_client import ManagementLinkClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_link_client import ManagementLinkClient # 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__ = [
"ManagementLinkClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_configuration.py
index f399a0b7e472..ef43ecd50932 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_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 ManagementLinkClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLinkClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLinkClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py
index e0aecfd3bebf..04f58cc9a2e6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, ResourceLinksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ManagementLinkClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLinkClient:
"""Azure resources can be linked together to form logical relationships. You can establish links
between resources belonging to different resource groups. However, all the linked resources
must belong to the same subscription. Each resource can be linked to 50 other resources. If any
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/__init__.py
index 92d287671ad1..2d5efa026a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/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 ._management_link_client import ManagementLinkClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_link_client import ManagementLinkClient # 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__ = [
"ManagementLinkClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_configuration.py
index 062c10430048..cfb1a1fc0ed9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/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 ManagementLinkClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLinkClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLinkClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py
index dd958858d2e5..43b169184b6f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, ResourceLinksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ManagementLinkClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLinkClient:
"""Azure resources can be linked together to form logical relationships. You can establish links
between resources belonging to different resource groups. However, all the linked resources
must belong to the same subscription. Each resource can be linked to 50 other resources. If any
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/__init__.py
index 387277369a5e..f1aa3c6ca1ff 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import ResourceLinksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import ResourceLinksOperations # 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__ = [
"Operations",
"ResourceLinksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py
index fdc8582efe88..9b721c360bec 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +79,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -161,7 +160,8 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, link_id: str, **kwargs: Any) -> None:
+ # pylint: disable=line-too-long
"""Deletes a resource link with the specified ID.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -174,7 +174,7 @@ async def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -214,6 +214,7 @@ async def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=
async def create_or_update(
self, link_id: str, parameters: _models.ResourceLink, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -236,6 +237,7 @@ async def create_or_update(
async def create_or_update(
self, link_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -258,6 +260,7 @@ async def create_or_update(
async def create_or_update(
self, link_id: str, parameters: Union[_models.ResourceLink, IO[bytes]], **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -273,7 +276,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -327,6 +330,7 @@ async def create_or_update(
@distributed_trace_async
async def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Gets a resource link with the specified ID.
:param link_id: The fully qualified Id of the resource link. For example,
@@ -337,7 +341,7 @@ async def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink:
:rtype: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -398,7 +402,7 @@ def list_at_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -484,7 +488,7 @@ def list_at_source_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py
index f5281fa67841..16e885e96822 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/__init__.py
@@ -5,16 +5,25 @@
# 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 Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ResourceLink
-from ._models_py3 import ResourceLinkFilter
-from ._models_py3 import ResourceLinkProperties
-from ._models_py3 import ResourceLinkResult
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ResourceLink,
+ ResourceLinkFilter,
+ ResourceLinkProperties,
+ ResourceLinkResult,
+)
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__ = [
@@ -26,5 +35,5 @@
"ResourceLinkProperties",
"ResourceLinkResult",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/_models_py3.py
index 5228dd0de370..6b78008a4bbe 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py
index 387277369a5e..f1aa3c6ca1ff 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import ResourceLinksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import ResourceLinksOperations # 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__ = [
"Operations",
"ResourceLinksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py
index 5b24a438d8c7..8c351d62bc58 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Literal, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -220,7 +219,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -302,6 +301,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ # pylint: disable=line-too-long
"""Deletes a resource link with the specified ID.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -314,7 +314,7 @@ def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=incons
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -354,6 +354,7 @@ def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=incons
def create_or_update(
self, link_id: str, parameters: _models.ResourceLink, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -376,6 +377,7 @@ def create_or_update(
def create_or_update(
self, link_id: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -398,6 +400,7 @@ def create_or_update(
def create_or_update(
self, link_id: str, parameters: Union[_models.ResourceLink, IO[bytes]], **kwargs: Any
) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Creates or updates a resource link between the specified resources.
:param link_id: The fully qualified ID of the resource link. Use the format,
@@ -413,7 +416,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -467,6 +470,7 @@ def create_or_update(
@distributed_trace
def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink:
+ # pylint: disable=line-too-long
"""Gets a resource link with the specified ID.
:param link_id: The fully qualified Id of the resource link. For example,
@@ -477,7 +481,7 @@ def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink:
:rtype: ~azure.mgmt.resource.links.v2016_09_01.models.ResourceLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -536,7 +540,7 @@ def list_at_subscription(self, filter: Optional[str] = None, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -622,7 +626,7 @@ def list_at_source_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/__init__.py
index 4a02cc9246e6..1e35dbc6c246 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/__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 ._management_lock_client import ManagementLockClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_lock_client import ManagementLockClient # 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__ = [
"ManagementLockClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_configuration.py
index cf9e9347ac2f..0c9e943f562c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_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 ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLockClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py
index 378d34fb4c32..0eb8b01baa23 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py
@@ -21,11 +21,10 @@
from .operations import ManagementLocksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ManagementLockClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLockClient:
"""ManagementLockClient.
:ivar management_locks: ManagementLocksOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/__init__.py
index 021d914862b0..fc55901ba15e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/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 ._management_lock_client import ManagementLockClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_lock_client import ManagementLockClient # 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__ = [
"ManagementLockClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_configuration.py
index 14dbec658afb..e7f0120d945f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/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 ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLockClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py
index c807b1e6db01..9fc0e9c17bac 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py
@@ -21,11 +21,10 @@
from .operations import ManagementLocksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ManagementLockClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLockClient:
"""ManagementLockClient.
:ivar management_locks: ManagementLocksOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/__init__.py
index 5fe90f3f7638..a7b0e0c70de7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/__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 ._operations import ManagementLocksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ManagementLocksOperations # 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__ = [
"ManagementLocksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py
index 5f5291e74d03..d0bec370a309 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -45,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -144,7 +144,7 @@ async def create_or_update_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -199,9 +199,7 @@ async def create_or_update_at_resource_group_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_resource_group_level( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, lock_name: str, **kwargs: Any
- ) -> None:
+ async def delete_at_resource_group_level(self, resource_group_name: str, lock_name: str, **kwargs: Any) -> None:
"""Deletes the management lock of a resource group.
:param resource_group_name: The resource group name. Required.
@@ -212,7 +210,7 @@ async def delete_at_resource_group_level( # 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,
@@ -264,7 +262,7 @@ async def get_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -416,7 +414,7 @@ async def create_or_update_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -475,7 +473,7 @@ async def create_or_update_at_resource_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_resource_level( # pylint: disable=inconsistent-return-statements
+ async def delete_at_resource_level(
self,
resource_group_name: str,
resource_provider_namespace: str,
@@ -503,7 +501,7 @@ async def delete_at_resource_level( # pylint: disable=inconsistent-return-state
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -602,7 +600,7 @@ async def create_or_update_at_subscription_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -656,9 +654,7 @@ async def create_or_update_at_subscription_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_subscription_level( # pylint: disable=inconsistent-return-statements
- self, lock_name: str, **kwargs: Any
- ) -> None:
+ async def delete_at_subscription_level(self, lock_name: str, **kwargs: Any) -> None:
"""Deletes the management lock of a subscription.
:param lock_name: The name of lock. Required.
@@ -667,7 +663,7 @@ async def delete_at_subscription_level( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -714,7 +710,7 @@ async def get(self, lock_name: str, **kwargs: Any) -> _models.ManagementLockObje
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -777,7 +773,7 @@ def list_at_resource_group_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -877,7 +873,7 @@ def list_at_resource_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -963,7 +959,7 @@ def list_at_subscription_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py
index 676442c81f85..8d9af71340f3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/__init__.py
@@ -5,13 +5,24 @@
# 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 ManagementLockListResult
-from ._models_py3 import ManagementLockObject
+from typing import TYPE_CHECKING
-from ._management_lock_client_enums import LockLevel
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ManagementLockListResult,
+ ManagementLockObject,
+)
+
+from ._management_lock_client_enums import ( # type: ignore
+ LockLevel,
+)
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__ = [
@@ -19,5 +30,5 @@
"ManagementLockObject",
"LockLevel",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_models_py3.py
index 8b016d48f716..5d24212328c3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/__init__.py
index 5fe90f3f7638..a7b0e0c70de7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/__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 ._operations import ManagementLocksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ManagementLocksOperations # 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__ = [
"ManagementLocksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py
index 138048ff75ca..eec37a90c43a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -505,7 +505,7 @@ def create_or_update_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -573,7 +573,7 @@ def delete_at_resource_group_level( # pylint: disable=inconsistent-return-state
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -625,7 +625,7 @@ def get_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -777,7 +777,7 @@ def create_or_update_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -864,7 +864,7 @@ def delete_at_resource_level( # 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,
@@ -963,7 +963,7 @@ def create_or_update_at_subscription_level(
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1028,7 +1028,7 @@ def delete_at_subscription_level( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1075,7 +1075,7 @@ def get(self, lock_name: str, **kwargs: Any) -> _models.ManagementLockObject:
:rtype: ~azure.mgmt.resource.locks.v2015_01_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1138,7 +1138,7 @@ def list_at_resource_group_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1238,7 +1238,7 @@ def list_at_resource_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1324,7 +1324,7 @@ def list_at_subscription_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/__init__.py
index 4a02cc9246e6..1e35dbc6c246 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/__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 ._management_lock_client import ManagementLockClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_lock_client import ManagementLockClient # 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__ = [
"ManagementLockClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_configuration.py
index 8ca0b1ae3981..63d7bb282044 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_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 ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLockClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py
index 0906da4116a2..aec2ef79f97e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py
@@ -21,11 +21,10 @@
from .operations import AuthorizationOperationsOperations, ManagementLocksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ManagementLockClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLockClient:
"""Azure resources can be locked to prevent other users in your organization from deleting or
modifying resources.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/__init__.py
index 021d914862b0..fc55901ba15e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/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 ._management_lock_client import ManagementLockClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._management_lock_client import ManagementLockClient # 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__ = [
"ManagementLockClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_configuration.py
index 43b0b84754e7..a1e5b2ac1f90 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/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 ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ManagementLockClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ManagementLockClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py
index 4296548522fd..a4b33a13f216 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py
@@ -21,11 +21,10 @@
from .operations import AuthorizationOperationsOperations, ManagementLocksOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ManagementLockClient: # pylint: disable=client-accepts-api-version-keyword
+class ManagementLockClient:
"""Azure resources can be locked to prevent other users in your organization from deleting or
modifying resources.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/__init__.py
index 3f16a5cf4b08..624473253c54 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import AuthorizationOperationsOperations
-from ._operations import ManagementLocksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import AuthorizationOperationsOperations # type: ignore
+from ._operations import ManagementLocksOperations # 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__ = [
"AuthorizationOperationsOperations",
"ManagementLocksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py
index b638bbd90627..031317f4d3c7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -51,7 +51,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -91,7 +91,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -263,7 +263,7 @@ async def create_or_update_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -318,9 +318,7 @@ async def create_or_update_at_resource_group_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_resource_group_level( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, lock_name: str, **kwargs: Any
- ) -> None:
+ async def delete_at_resource_group_level(self, resource_group_name: str, lock_name: str, **kwargs: Any) -> None:
"""Deletes a management lock at the resource group level.
To delete management locks, you must have access to Microsoft.Authorization/\\ * or
@@ -335,7 +333,7 @@ async def delete_at_resource_group_level( # 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,
@@ -387,7 +385,7 @@ async def get_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -439,6 +437,7 @@ async def create_or_update_by_scope(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -469,6 +468,7 @@ async def create_or_update_by_scope(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -493,6 +493,7 @@ async def create_or_update_by_scope(
async def create_or_update_by_scope(
self, scope: str, lock_name: str, parameters: Union[_models.ManagementLockObject, IO[bytes]], **kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -511,7 +512,7 @@ async def create_or_update_by_scope(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -565,9 +566,7 @@ async def create_or_update_by_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_by_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, lock_name: str, **kwargs: Any
- ) -> None:
+ async def delete_by_scope(self, scope: str, lock_name: str, **kwargs: Any) -> None:
"""Delete a management lock by scope.
:param scope: The scope for the lock. Required.
@@ -578,7 +577,7 @@ async def delete_by_scope( # 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,
@@ -627,7 +626,7 @@ async def get_by_scope(self, scope: str, lock_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -802,7 +801,7 @@ async def create_or_update_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -861,7 +860,7 @@ async def create_or_update_at_resource_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_resource_level( # pylint: disable=inconsistent-return-statements
+ async def delete_at_resource_level(
self,
resource_group_name: str,
resource_provider_namespace: str,
@@ -895,7 +894,7 @@ async def delete_at_resource_level( # pylint: disable=inconsistent-return-state
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -967,7 +966,7 @@ async def get_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1088,7 +1087,7 @@ async def create_or_update_at_subscription_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1142,9 +1141,7 @@ async def create_or_update_at_subscription_level(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_subscription_level( # pylint: disable=inconsistent-return-statements
- self, lock_name: str, **kwargs: Any
- ) -> None:
+ async def delete_at_subscription_level(self, lock_name: str, **kwargs: Any) -> None:
"""Deletes the management lock at the subscription level.
To delete management locks, you must have access to Microsoft.Authorization/\\ * or
@@ -1157,7 +1154,7 @@ async def delete_at_subscription_level( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1204,7 +1201,7 @@ async def get_at_subscription_level(self, lock_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1268,7 +1265,7 @@ def list_at_resource_group_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1368,7 +1365,7 @@ def list_at_resource_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1454,7 +1451,7 @@ def list_at_subscription_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1519,6 +1516,7 @@ async def get_next(next_link=None):
def list_by_scope(
self, scope: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.ManagementLockObject"]:
+ # pylint: disable=line-too-long
"""Gets all the management locks for a scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -1541,7 +1539,7 @@ def list_by_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py
index 5c31f16caec2..635bdfd36740 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/__init__.py
@@ -5,17 +5,28 @@
# 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 ManagementLockListResult
-from ._models_py3 import ManagementLockObject
-from ._models_py3 import ManagementLockOwner
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
+from typing import TYPE_CHECKING
-from ._management_lock_client_enums import LockLevel
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ManagementLockListResult,
+ ManagementLockObject,
+ ManagementLockOwner,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+)
+
+from ._management_lock_client_enums import ( # type: ignore
+ LockLevel,
+)
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__ = [
@@ -27,5 +38,5 @@
"OperationListResult",
"LockLevel",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/_models_py3.py
index ac8494419945..1933e25607a4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py
index 3f16a5cf4b08..624473253c54 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import AuthorizationOperationsOperations
-from ._operations import ManagementLocksOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import AuthorizationOperationsOperations # type: ignore
+from ._operations import ManagementLocksOperations # 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__ = [
"AuthorizationOperationsOperations",
"ManagementLocksOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py
index 30c52a61d29c..b67d46ce3160 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -616,7 +616,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -788,7 +788,7 @@ def create_or_update_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -860,7 +860,7 @@ def delete_at_resource_group_level( # pylint: disable=inconsistent-return-state
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -912,7 +912,7 @@ def get_at_resource_group_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -964,6 +964,7 @@ def create_or_update_by_scope(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -994,6 +995,7 @@ def create_or_update_by_scope(
content_type: str = "application/json",
**kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -1018,6 +1020,7 @@ def create_or_update_by_scope(
def create_or_update_by_scope(
self, scope: str, lock_name: str, parameters: Union[_models.ManagementLockObject, IO[bytes]], **kwargs: Any
) -> _models.ManagementLockObject:
+ # pylint: disable=line-too-long
"""Create or update a management lock by scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -1036,7 +1039,7 @@ def create_or_update_by_scope(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1103,7 +1106,7 @@ def delete_by_scope( # 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,
@@ -1152,7 +1155,7 @@ def get_by_scope(self, scope: str, lock_name: str, **kwargs: Any) -> _models.Man
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1327,7 +1330,7 @@ def create_or_update_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1420,7 +1423,7 @@ def delete_at_resource_level( # 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,
@@ -1492,7 +1495,7 @@ def get_at_resource_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1613,7 +1616,7 @@ def create_or_update_at_subscription_level(
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1682,7 +1685,7 @@ def delete_at_subscription_level( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1729,7 +1732,7 @@ def get_at_subscription_level(self, lock_name: str, **kwargs: Any) -> _models.Ma
:rtype: ~azure.mgmt.resource.locks.v2016_09_01.models.ManagementLockObject
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1793,7 +1796,7 @@ def list_at_resource_group_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1893,7 +1896,7 @@ def list_at_resource_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1979,7 +1982,7 @@ def list_at_subscription_level(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2044,6 +2047,7 @@ def get_next(next_link=None):
def list_by_scope(
self, scope: str, filter: Optional[str] = None, **kwargs: Any
) -> Iterable["_models.ManagementLockObject"]:
+ # pylint: disable=line-too-long
"""Gets all the management locks for a scope.
:param scope: The scope for the lock. When providing a scope for the assignment, use
@@ -2066,7 +2070,7 @@ def list_by_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/__init__.py
index e5d22f85da86..b5f21c6322ac 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/__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 ._application_client import ApplicationClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._application_client import ApplicationClient # 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__ = [
"ApplicationClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py
index d63e33b069a2..2a712af1f17a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py
@@ -26,11 +26,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ApplicationClient(ApplicationClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class ApplicationClient(ApplicationClientOperationsMixin):
"""ARM applications.
:ivar applications: ApplicationsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_configuration.py
index e72d5cf94750..ba34796dcf33 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_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 ApplicationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ApplicationClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ApplicationClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py
index 76e5f0c6cb3b..7459fec0a998 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import ApplicationClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/__init__.py
index f3eee99c42a5..0a6c2b1f1f57 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/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 ._application_client import ApplicationClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._application_client import ApplicationClient # 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__ = [
"ApplicationClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py
index e46b5cf28de5..0ba2c9f628fa 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py
@@ -26,11 +26,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ApplicationClient(ApplicationClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class ApplicationClient(ApplicationClientOperationsMixin):
"""ARM applications.
:ivar applications: ApplicationsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_configuration.py
index 4d89ff7a41c6..f52217f08866 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/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 ApplicationClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ApplicationClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ApplicationClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_vendor.py
index 0145ac1a5fc0..79b779257600 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import ApplicationClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/__init__.py
index 8eb99a2dc945..b6d36d40676d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import ApplicationClientOperationsMixin
-from ._operations import ApplicationsOperations
-from ._operations import ApplicationDefinitionsOperations
-from ._operations import JitRequestsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ApplicationClientOperationsMixin # type: ignore
+from ._operations import ApplicationsOperations # type: ignore
+from ._operations import ApplicationDefinitionsOperations # type: ignore
+from ._operations import JitRequestsOperations # 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__ = [
@@ -21,5 +27,5 @@
"ApplicationDefinitionsOperations",
"JitRequestsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py
index 275d39389079..f6ab1c695503 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -64,7 +64,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -93,7 +93,7 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -186,7 +186,7 @@ async def get(self, resource_group_name: str, application_name: str, **kwargs: A
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -232,7 +232,7 @@ async def get(self, resource_group_name: str, application_name: str, **kwargs: A
async def _delete_initial(
self, resource_group_name: str, application_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -342,7 +342,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Application, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -615,7 +615,7 @@ async def update(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -677,6 +677,7 @@ async def update(
@distributed_trace
def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Application"]:
+ # pylint: disable=line-too-long
"""Gets all the applications within a resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -693,7 +694,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._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -757,6 +758,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Application"]:
+ # pylint: disable=line-too-long
"""Gets all the applications within a subscription.
:return: An iterator like instance of either Application or the result of cls(response)
@@ -770,7 +772,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Applicat
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -844,7 +846,7 @@ async def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Applica
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -886,7 +888,7 @@ async def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Applica
return deserialized # type: ignore
async def _delete_by_id_initial(self, application_id: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -987,7 +989,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, application_id: str, parameters: Union[_models.Application, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1239,7 +1241,7 @@ async def update_by_id(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1298,7 +1300,7 @@ async def update_by_id(
async def _refresh_permissions_initial(
self, resource_group_name: str, application_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1437,7 +1439,7 @@ async def get(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.ApplicationDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1483,7 +1485,7 @@ async def get(
async def _delete_initial(
self, resource_group_name: str, application_definition_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1594,7 +1596,7 @@ async def _create_or_update_initial(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1664,6 +1666,7 @@ async def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1695,6 +1698,7 @@ async def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1723,6 +1727,7 @@ async def begin_create_or_update(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1791,6 +1796,7 @@ def get_long_running_output(pipeline_response):
def list_by_resource_group(
self, resource_group_name: str, **kwargs: Any
) -> AsyncIterable["_models.ApplicationDefinition"]:
+ # pylint: disable=line-too-long
"""Lists the managed application definitions in a resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1808,7 +1814,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1885,7 +1891,7 @@ async def get_by_id(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.ApplicationDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1931,7 +1937,7 @@ async def get_by_id(
async def _delete_by_id_initial(
self, resource_group_name: str, application_definition_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2041,7 +2047,7 @@ async def _create_or_update_by_id_initial(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2111,6 +2117,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2142,6 +2149,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2170,6 +2178,7 @@ async def begin_create_or_update_by_id(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2268,7 +2277,7 @@ async def get(self, resource_group_name: str, jit_request_name: str, **kwargs: A
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2318,7 +2327,7 @@ async def _create_or_update_initial(
parameters: Union[_models.JitRequestDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2388,6 +2397,7 @@ async def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.JitRequestDefinition]:
+ # pylint: disable=line-too-long
"""Creates or updates the JIT request.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2418,6 +2428,7 @@ async def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.JitRequestDefinition]:
+ # pylint: disable=line-too-long
"""Creates or updates the JIT request.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2445,6 +2456,7 @@ async def begin_create_or_update(
parameters: Union[_models.JitRequestDefinition, IO[bytes]],
**kwargs: Any
) -> AsyncLROPoller[_models.JitRequestDefinition]:
+ # pylint: disable=line-too-long
"""Creates or updates the JIT request.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2587,7 +2599,7 @@ async def update(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2643,9 +2655,7 @@ async def update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, jit_request_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, jit_request_name: str, **kwargs: Any) -> None:
"""Deletes the JIT request.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2657,7 +2667,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,
@@ -2705,7 +2715,7 @@ async def list_by_subscription(self, **kwargs: Any) -> _models.JitRequestDefinit
~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinitionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2760,7 +2770,7 @@ async def list_by_resource_group(
~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinitionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/__init__.py
index 7b139d32504d..4e1a1fb629ae 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/__init__.py
@@ -5,65 +5,76 @@
# 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 Application
-from ._models_py3 import ApplicationArtifact
-from ._models_py3 import ApplicationAuthorization
-from ._models_py3 import ApplicationBillingDetailsDefinition
-from ._models_py3 import ApplicationClientDetails
-from ._models_py3 import ApplicationDefinition
-from ._models_py3 import ApplicationDefinitionArtifact
-from ._models_py3 import ApplicationDefinitionListResult
-from ._models_py3 import ApplicationDeploymentPolicy
-from ._models_py3 import ApplicationJitAccessPolicy
-from ._models_py3 import ApplicationListResult
-from ._models_py3 import ApplicationManagementPolicy
-from ._models_py3 import ApplicationNotificationEndpoint
-from ._models_py3 import ApplicationNotificationPolicy
-from ._models_py3 import ApplicationPackageContact
-from ._models_py3 import ApplicationPackageLockingPolicyDefinition
-from ._models_py3 import ApplicationPackageSupportUrls
-from ._models_py3 import ApplicationPatchable
-from ._models_py3 import ApplicationPolicy
-from ._models_py3 import ApplicationPropertiesPatchable
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import GenericResource
-from ._models_py3 import Identity
-from ._models_py3 import JitApproverDefinition
-from ._models_py3 import JitAuthorizationPolicies
-from ._models_py3 import JitRequestDefinition
-from ._models_py3 import JitRequestDefinitionListResult
-from ._models_py3 import JitRequestPatchable
-from ._models_py3 import JitSchedulingPolicy
-from ._models_py3 import Operation
-from ._models_py3 import OperationAutoGenerated
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationDisplayAutoGenerated
-from ._models_py3 import OperationListResult
-from ._models_py3 import Plan
-from ._models_py3 import PlanPatchable
-from ._models_py3 import Resource
-from ._models_py3 import Sku
-from ._models_py3 import UserAssignedResourceIdentity
+from typing import TYPE_CHECKING
-from ._application_client_enums import ActionType
-from ._application_client_enums import ApplicationArtifactName
-from ._application_client_enums import ApplicationArtifactType
-from ._application_client_enums import ApplicationDefinitionArtifactName
-from ._application_client_enums import ApplicationLockLevel
-from ._application_client_enums import ApplicationManagementMode
-from ._application_client_enums import DeploymentMode
-from ._application_client_enums import JitApprovalMode
-from ._application_client_enums import JitApproverType
-from ._application_client_enums import JitRequestState
-from ._application_client_enums import JitSchedulingType
-from ._application_client_enums import Origin
-from ._application_client_enums import ProvisioningState
-from ._application_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Application,
+ ApplicationArtifact,
+ ApplicationAuthorization,
+ ApplicationBillingDetailsDefinition,
+ ApplicationClientDetails,
+ ApplicationDefinition,
+ ApplicationDefinitionArtifact,
+ ApplicationDefinitionListResult,
+ ApplicationDeploymentPolicy,
+ ApplicationJitAccessPolicy,
+ ApplicationListResult,
+ ApplicationManagementPolicy,
+ ApplicationNotificationEndpoint,
+ ApplicationNotificationPolicy,
+ ApplicationPackageContact,
+ ApplicationPackageLockingPolicyDefinition,
+ ApplicationPackageSupportUrls,
+ ApplicationPatchable,
+ ApplicationPolicy,
+ ApplicationPropertiesPatchable,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ GenericResource,
+ Identity,
+ JitApproverDefinition,
+ JitAuthorizationPolicies,
+ JitRequestDefinition,
+ JitRequestDefinitionListResult,
+ JitRequestPatchable,
+ JitSchedulingPolicy,
+ Operation,
+ OperationAutoGenerated,
+ OperationDisplay,
+ OperationDisplayAutoGenerated,
+ OperationListResult,
+ Plan,
+ PlanPatchable,
+ Resource,
+ Sku,
+ UserAssignedResourceIdentity,
+)
+
+from ._application_client_enums import ( # type: ignore
+ ActionType,
+ ApplicationArtifactName,
+ ApplicationArtifactType,
+ ApplicationDefinitionArtifactName,
+ ApplicationLockLevel,
+ ApplicationManagementMode,
+ DeploymentMode,
+ JitApprovalMode,
+ JitApproverType,
+ JitRequestState,
+ JitSchedulingType,
+ Origin,
+ ProvisioningState,
+ ResourceIdentityType,
+)
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__ = [
@@ -123,5 +134,5 @@
"ProvisioningState",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/_models_py3.py
index 8393bfa18a64..2eb0a2958ce1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -131,7 +130,7 @@ def __init__(
self.sku = sku
-class Application(GenericResource): # pylint: disable=too-many-instance-attributes
+class Application(GenericResource):
"""Information about managed application.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -472,7 +471,7 @@ def __init__(
self.application_id = application_id
-class ApplicationDefinition(GenericResource): # pylint: disable=too-many-instance-attributes
+class ApplicationDefinition(GenericResource):
"""Information about managed application definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1051,7 +1050,7 @@ def __init__(
self.government_cloud = government_cloud
-class ApplicationPatchable(GenericResource): # pylint: disable=too-many-instance-attributes
+class ApplicationPatchable(GenericResource):
"""Information about managed application.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1568,7 +1567,7 @@ def __init__(self, *, principal_id: str, role_definition_id: str, **kwargs: Any)
self.role_definition_id = role_definition_id
-class JitRequestDefinition(Resource): # pylint: disable=too-many-instance-attributes
+class JitRequestDefinition(Resource):
"""Information about JIT request definition.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/__init__.py
index 8eb99a2dc945..b6d36d40676d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import ApplicationClientOperationsMixin
-from ._operations import ApplicationsOperations
-from ._operations import ApplicationDefinitionsOperations
-from ._operations import JitRequestsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import ApplicationClientOperationsMixin # type: ignore
+from ._operations import ApplicationsOperations # type: ignore
+from ._operations import ApplicationDefinitionsOperations # type: ignore
+from ._operations import JitRequestsOperations # 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__ = [
@@ -21,5 +27,5 @@
"ApplicationDefinitionsOperations",
"JitRequestsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py
index fda0e707a692..0ed431191e20 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -37,7 +37,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -865,7 +865,7 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]:
)
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -958,7 +958,7 @@ def get(self, resource_group_name: str, application_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1002,7 +1002,7 @@ def get(self, resource_group_name: str, application_name: str, **kwargs: Any) ->
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, application_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1110,7 +1110,7 @@ def _create_or_update_initial(
parameters: Union[_models.Application, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1383,7 +1383,7 @@ def update(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1461,7 +1461,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._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1538,7 +1538,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Application"]
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1612,7 +1612,7 @@ def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Application:
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1654,7 +1654,7 @@ def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Application:
return deserialized # type: ignore
def _delete_by_id_initial(self, application_id: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1755,7 +1755,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, application_id: str, parameters: Union[_models.Application, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2007,7 +2007,7 @@ def update_by_id(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2066,7 +2066,7 @@ def update_by_id(
def _refresh_permissions_initial(
self, resource_group_name: str, application_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2205,7 +2205,7 @@ def get(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.ApplicationDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2251,7 +2251,7 @@ def get(
def _delete_initial(
self, resource_group_name: str, application_definition_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2362,7 +2362,7 @@ def _create_or_update_initial(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2432,6 +2432,7 @@ def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2463,6 +2464,7 @@ def begin_create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2491,6 +2493,7 @@ def begin_create_or_update(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2576,7 +2579,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ApplicationDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2653,7 +2656,7 @@ def get_by_id(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.ApplicationDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2699,7 +2702,7 @@ def get_by_id(
def _delete_by_id_initial(
self, resource_group_name: str, application_definition_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2809,7 +2812,7 @@ def _create_or_update_by_id_initial(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2879,6 +2882,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2910,6 +2914,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2938,6 +2943,7 @@ def begin_create_or_update_by_id(
parameters: Union[_models.ApplicationDefinition, IO[bytes]],
**kwargs: Any
) -> LROPoller[_models.ApplicationDefinition]:
+ # pylint: disable=line-too-long
"""Creates a new managed application definition.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -3036,7 +3042,7 @@ def get(self, resource_group_name: str, jit_request_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3086,7 +3092,7 @@ def _create_or_update_initial(
parameters: Union[_models.JitRequestDefinition, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3355,7 +3361,7 @@ def update(
:rtype: ~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3425,7 +3431,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,
@@ -3473,7 +3479,7 @@ def list_by_subscription(self, **kwargs: Any) -> _models.JitRequestDefinitionLis
~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinitionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3526,7 +3532,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _mo
~azure.mgmt.resource.managedapplications.v2019_07_01.models.JitRequestDefinitionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_configuration.py
index dd51f528f1e5..3668a4257c76 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py
index 266ace9d78b0..194b9f343ee0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_configuration.py
index 2a64930dfd20..6fb6461a7f81 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py
index 24f645c43b79..2942b4d5daba 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/__init__.py
index 07e31530091e..b9d4f0cdedd1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicyDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py
index 7b66a80ad51d..804841bcb245 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -47,7 +47,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -84,7 +84,7 @@ async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -210,7 +210,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -277,7 +277,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -324,6 +324,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
def list_for_resource_group(
self, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets policy assignments for the resource group.
:param resource_group_name: The name of the resource group that contains policy assignments.
@@ -344,7 +345,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -417,6 +418,7 @@ def list_for_resource(
filter: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets policy assignments for a resource.
:param resource_group_name: The name of the resource group containing the resource. The name is
@@ -445,7 +447,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -513,6 +515,7 @@ async def get_next(next_link=None):
@distributed_trace
def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets all the policy assignments for a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -530,7 +533,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -609,7 +612,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -738,7 +741,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -810,7 +813,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -935,7 +938,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -991,9 +994,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition.
:param policy_definition_name: The name of the policy definition to delete. Required.
@@ -1002,7 +1003,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,
@@ -1051,7 +1052,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1096,6 +1097,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
@distributed_trace
def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
+ # pylint: disable=line-too-long
"""Gets all the policy definitions for a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -1113,7 +1115,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
)
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py
index 506c980bd67b..e05fea653716 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/__init__.py
@@ -5,15 +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 ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyType,
+)
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__ = [
@@ -23,5 +34,5 @@
"PolicyDefinitionListResult",
"PolicyType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/_models_py3.py
index e62f3c3aac69..ff7da698d192 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/__init__.py
index 07e31530091e..b9d4f0cdedd1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicyDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py
index 99171f0d63d7..1f8c71259b02 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -464,7 +464,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -590,7 +590,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -657,7 +657,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -724,7 +724,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -825,7 +825,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -910,7 +910,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -989,7 +989,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1118,7 +1118,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1190,7 +1190,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1315,7 +1315,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1382,7 +1382,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,
@@ -1431,7 +1431,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2015_10_01_preview.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1493,7 +1493,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
)
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_configuration.py
index a74ad582a250..23335713fd14 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py
index 49ea6ac8ced6..3c7759c8d009 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_configuration.py
index 1ce0cda4bb60..a2254126e51d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py
index d6deeb9067bd..d704fba4ead1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/__init__.py
index 07e31530091e..b9d4f0cdedd1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicyDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py
index 3e8a4c8c941a..e7d317a1f29a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -47,7 +47,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -84,7 +84,7 @@ async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -207,7 +207,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -272,7 +272,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -335,7 +335,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -434,7 +434,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -517,7 +517,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -596,7 +596,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -722,7 +722,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -792,7 +792,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -914,7 +914,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -968,9 +968,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition.
:param policy_definition_name: The name of the policy definition to delete. Required.
@@ -979,7 +977,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,
@@ -1026,7 +1024,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1084,7 +1082,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py
index 506c980bd67b..e05fea653716 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/__init__.py
@@ -5,15 +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 ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyType,
+)
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__ = [
@@ -23,5 +34,5 @@
"PolicyDefinitionListResult",
"PolicyType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/_models_py3.py
index 7f505fda3540..346cf08874d2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/__init__.py
index 07e31530091e..b9d4f0cdedd1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicyDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py
index e1aa82656930..21d6a35cd476 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -464,7 +464,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -587,7 +587,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -652,7 +652,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -715,7 +715,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -814,7 +814,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -897,7 +897,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -976,7 +976,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1102,7 +1102,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1172,7 +1172,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1294,7 +1294,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1359,7 +1359,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,
@@ -1406,7 +1406,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2016_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1464,7 +1464,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_configuration.py
index 578da2244842..bf96f7247782 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py
index 82fe61a6a1d9..c352d9894d73 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_configuration.py
index a6d928b51716..36d864ebaa95 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py
index 4e337a5561c8..ba3bca5a9b0a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/__init__.py
index e6b1086b37ca..98fe07f8449d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyDefinitionsOperations
-from ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # 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__ = [
"PolicyDefinitionsOperations",
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py
index 70af179c3cda..3b210c27dd51 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -53,7 +53,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -139,7 +139,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -193,9 +193,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition.
:param policy_definition_name: The name of the policy definition to delete. Required.
@@ -204,7 +202,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,
@@ -251,7 +249,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -302,7 +300,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -415,7 +413,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -469,7 +467,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition at management group level.
@@ -482,7 +480,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -533,7 +531,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -589,7 +587,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -664,7 +662,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -742,7 +740,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -837,7 +835,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -962,7 +960,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1027,7 +1025,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1090,7 +1088,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1189,7 +1187,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1272,7 +1270,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1351,7 +1349,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1477,7 +1475,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1547,7 +1545,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py
index 411a45823afa..4c751900c445 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/__init__.py
@@ -5,16 +5,27 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyMode
-from ._policy_client_enums import PolicyType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyMode,
+ PolicyType,
+)
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__ = [
@@ -25,5 +36,5 @@
"PolicyMode",
"PolicyType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/_models_py3.py
index e77ee2dc9fbf..a6325a98c910 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/__init__.py
index e6b1086b37ca..98fe07f8449d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyDefinitionsOperations
-from ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # 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__ = [
"PolicyDefinitionsOperations",
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py
index ddb6dd0e610c..95feda37b38a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -670,7 +670,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -735,7 +735,7 @@ def 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,
@@ -782,7 +782,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -833,7 +833,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -946,7 +946,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1013,7 +1013,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1064,7 +1064,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,7 +1120,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1195,7 +1195,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1271,7 +1271,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1364,7 +1364,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1489,7 +1489,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1554,7 +1554,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1617,7 +1617,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1716,7 +1716,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1799,7 +1799,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1878,7 +1878,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2004,7 +2004,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2074,7 +2074,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2016_12_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_configuration.py
index 9067db80fc8a..ba7bcd575460 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py
index 9d79dc9db50e..33d35cd8aab1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_configuration.py
index 76596e4882a9..02b3abf9ce69 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py
index 764492e3da83..d5bb8a7611f7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/__init__.py
index a28325eff378..ccbc694debc9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py
index 58a3fea0eab6..6dc21f7ee466 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -53,7 +53,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,7 +92,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -221,7 +221,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -289,7 +289,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -337,6 +337,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
def list_for_resource_group(
self, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets policy assignments for the resource group.
:param resource_group_name: The name of the resource group that contains policy assignments.
@@ -357,7 +358,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -431,6 +432,7 @@ def list_for_resource(
filter: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets policy assignments for a resource.
:param resource_group_name: The name of the resource group containing the resource. The name is
@@ -459,7 +461,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -528,6 +530,7 @@ async def get_next(next_link=None):
@distributed_trace
def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.PolicyAssignment"]:
+ # pylint: disable=line-too-long
"""Gets all the policy assignments for a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -545,7 +548,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -625,7 +628,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -755,7 +758,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -828,7 +831,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -954,7 +957,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1011,9 +1014,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
:param policy_set_definition_name: The name of the policy set definition to delete. Required.
@@ -1022,7 +1023,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,
@@ -1072,7 +1073,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1126,7 +1127,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1171,6 +1172,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
+ # pylint: disable=line-too-long
"""Gets all the policy set definitions for a subscription.
:return: An iterator like instance of either PolicySetDefinition or the result of cls(response)
@@ -1186,7 +1188,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1249,6 +1251,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
+ # pylint: disable=line-too-long
"""Gets all the built in policy set definitions.
:return: An iterator like instance of either PolicySetDefinition or the result of cls(response)
@@ -1264,7 +1267,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1398,7 +1401,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1455,7 +1458,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition at management group level.
@@ -1468,7 +1471,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1522,7 +1525,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1570,6 +1573,7 @@ async def get_at_management_group(
def list_by_management_group(
self, management_group_id: str, **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinition"]:
+ # pylint: disable=line-too-long
"""Gets all the policy set definitions for a subscription at management group.
:param management_group_id: The ID of the management group. Required.
@@ -1587,7 +1591,7 @@ def list_by_management_group(
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py
index e5f848f9711a..ca346617d434 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py
@@ -5,18 +5,29 @@
# 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 ErrorResponse
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorResponse,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyType,
+)
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__ = [
@@ -29,5 +40,5 @@
"PolicySku",
"PolicyType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/_models_py3.py
index 4542c64ef767..e5cc28c2ffbe 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -63,7 +61,7 @@ def __init__(
self.error_message = error_message
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/__init__.py
index a28325eff378..ccbc694debc9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
"PolicyAssignmentsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py
index 68d40fc551b9..1e8631dbdfd0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -637,7 +637,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -766,7 +766,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -834,7 +834,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -902,7 +902,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1004,7 +1004,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1090,7 +1090,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
)
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1170,7 +1170,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1300,7 +1300,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1373,7 +1373,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1499,7 +1499,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1567,7 +1567,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,
@@ -1617,7 +1617,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1671,7 +1671,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1731,7 +1731,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1809,7 +1809,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1943,7 +1943,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2013,7 +2013,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2067,7 +2067,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2017_06_01_preview.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2132,7 +2132,7 @@ def list_by_management_group(
)
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_configuration.py
index 09c12a544919..b579f31581c7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py
index eb4cea6c9a57..bb2152b2224e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_configuration.py
index 125e8874a20f..4327185017ae 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py
index a63b603b1ba2..a4a8cef69b9a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py
index 82fc3bcb5fb3..498a63754844 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -63,7 +63,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,6 +92,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -111,7 +112,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -200,6 +202,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -233,6 +236,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -255,7 +259,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -311,6 +315,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -329,7 +334,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,7 +411,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -534,7 +539,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -631,7 +636,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -712,7 +717,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -847,7 +852,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -920,7 +925,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1052,7 +1057,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1106,9 +1111,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1119,7 +1122,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,
@@ -1168,7 +1171,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1221,7 +1224,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1346,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1397,7 +1400,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1412,7 +1415,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1469,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1524,7 +1527,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1601,7 +1604,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1681,7 +1684,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1833,7 +1836,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1888,9 +1891,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -1901,7 +1902,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,
@@ -1952,7 +1953,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2006,7 +2007,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2064,7 +2065,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2142,7 +2143,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2285,7 +2286,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2340,7 +2341,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2356,7 +2357,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2411,7 +2412,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2475,7 +2476,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/__init__.py
index 0d92baf2ca55..5d76e8cec43a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/__init__.py
@@ -5,21 +5,32 @@
# 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 ErrorResponse
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyMode
-from ._policy_client_enums import PolicyType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorResponse,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyMode,
+ PolicyType,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -35,5 +46,5 @@
"PolicyMode",
"PolicyType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/_models_py3.py
index 901e9e768ecb..5a2651e66211 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -63,7 +61,7 @@ def __init__(
self.error_message = error_message
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py
index 4cc3425a69d0..a6e203ed9728 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -901,6 +901,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -920,7 +921,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -974,6 +975,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1009,6 +1011,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1042,6 +1045,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1064,7 +1068,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,6 +1124,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1138,7 +1143,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1215,7 +1220,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1348,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1440,7 +1445,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1521,7 +1526,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1656,7 +1661,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1729,7 +1734,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1861,7 +1866,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1928,7 +1933,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,
@@ -1977,7 +1982,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2030,7 +2035,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2152,7 +2157,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2221,7 +2226,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2275,7 +2280,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2333,7 +2338,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2410,7 +2415,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2488,7 +2493,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2640,7 +2645,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2708,7 +2713,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,
@@ -2759,7 +2764,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2818,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2871,7 +2876,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2949,7 +2954,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3092,7 +3097,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3163,7 +3168,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3218,7 +3223,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_03_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3287,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_configuration.py
index b47da1966f39..fe315c09306b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py
index deece9648530..a7fae791ca8a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_configuration.py
index 55cc1b1d8f07..2b76bbe378f1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py
index 695c1abaec54..9387c4a3a244 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py
index ef00fb782ff8..364775f90e2b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -63,7 +63,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,6 +92,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -111,7 +112,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -200,6 +202,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -233,6 +236,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -255,7 +259,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -311,6 +315,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -329,7 +334,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,7 +411,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -534,7 +539,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -631,7 +636,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -712,7 +717,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -847,7 +852,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -920,7 +925,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1052,7 +1057,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1106,9 +1111,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1119,7 +1122,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,
@@ -1168,7 +1171,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1221,7 +1224,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1346,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1397,7 +1400,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1412,7 +1415,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1469,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1524,7 +1527,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1601,7 +1604,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1681,7 +1684,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1833,7 +1836,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1888,9 +1891,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -1901,7 +1902,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,
@@ -1952,7 +1953,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2006,7 +2007,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2064,7 +2065,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2142,7 +2143,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2285,7 +2286,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2340,7 +2341,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2356,7 +2357,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2411,7 +2412,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2475,7 +2476,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py
index 2f5f661ef614..fefa5842fb59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/__init__.py
@@ -5,23 +5,34 @@
# 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 ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyMode
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorResponse,
+ Identity,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyMode,
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -39,5 +50,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/_models_py3.py
index 975527d6b76f..77366b69da39 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -98,7 +96,7 @@ def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]]
self.type = type
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py
index eebf3e292835..77308d207fbb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -901,6 +901,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -920,7 +921,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -974,6 +975,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1009,6 +1011,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1042,6 +1045,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1064,7 +1068,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,6 +1124,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1138,7 +1143,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1215,7 +1220,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1348,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1440,7 +1445,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1521,7 +1526,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1656,7 +1661,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1729,7 +1734,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1861,7 +1866,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1928,7 +1933,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,
@@ -1977,7 +1982,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2030,7 +2035,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2152,7 +2157,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2221,7 +2226,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2275,7 +2280,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2333,7 +2338,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2410,7 +2415,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2488,7 +2493,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2640,7 +2645,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2708,7 +2713,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,
@@ -2759,7 +2764,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2818,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2871,7 +2876,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2949,7 +2954,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3092,7 +3097,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3163,7 +3168,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3218,7 +3223,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2018_05_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3287,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_configuration.py
index 780d21b2cb0e..712f4b8cb632 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py
index 301fb3ba0380..2d6d97951e02 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_configuration.py
index 58c64dad3519..985d17b15f42 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py
index c499617197bb..e66cf5e17dcc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py
index ce4b20c8edef..b94599a26633 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -63,7 +63,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,6 +92,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -111,7 +112,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -200,6 +202,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -233,6 +236,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -255,7 +259,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -311,6 +315,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -329,7 +334,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,7 +411,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -534,7 +539,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -631,7 +636,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -712,7 +717,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -847,7 +852,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -920,7 +925,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1052,7 +1057,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1106,9 +1111,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1119,7 +1122,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,
@@ -1168,7 +1171,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1221,7 +1224,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1346,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1397,7 +1400,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1412,7 +1415,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1469,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1524,7 +1527,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1601,7 +1604,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1681,7 +1684,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1833,7 +1836,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1888,9 +1891,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -1901,7 +1902,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,
@@ -1952,7 +1953,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2006,7 +2007,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2064,7 +2065,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2142,7 +2143,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2285,7 +2286,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2340,7 +2341,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2356,7 +2357,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2411,7 +2412,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2475,7 +2476,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/__init__.py
index 5f6ed1a20f0f..a0f5f4ed7fc8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/__init__.py
@@ -5,22 +5,33 @@
# 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 ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorResponse,
+ Identity,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -37,5 +48,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/_models_py3.py
index 3c4a83314856..f168d244f51b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -98,7 +96,7 @@ def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]]
self.type = type
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py
index 2b2efb3f27c1..677a64c9c6ca 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -901,6 +901,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -920,7 +921,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -974,6 +975,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1009,6 +1011,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1042,6 +1045,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1064,7 +1068,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,6 +1124,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1138,7 +1143,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1215,7 +1220,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1348,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1440,7 +1445,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1521,7 +1526,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1656,7 +1661,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1729,7 +1734,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1861,7 +1866,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1928,7 +1933,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,
@@ -1977,7 +1982,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2030,7 +2035,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2152,7 +2157,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2221,7 +2226,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2275,7 +2280,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2333,7 +2338,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2410,7 +2415,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2488,7 +2493,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2640,7 +2645,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2708,7 +2713,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,
@@ -2759,7 +2764,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2818,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2871,7 +2876,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2949,7 +2954,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3092,7 +3097,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3163,7 +3168,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3218,7 +3223,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_01_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3287,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_configuration.py
index 70ae57fb5083..61eebea31db5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py
index b0af60b4853a..74a9772244fc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py
index deb8ace20bd2..da1e40bcd74d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py
index 126c55e7a399..4a4fcedf888a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py
index 2ea151846bd4..6827717e0ecb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -63,7 +63,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,6 +92,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -111,7 +112,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -200,6 +202,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -233,6 +236,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -255,7 +259,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -311,6 +315,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -329,7 +334,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,7 +411,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -534,7 +539,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -631,7 +636,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -712,7 +717,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -847,7 +852,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -920,7 +925,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1052,7 +1057,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1106,9 +1111,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1119,7 +1122,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,
@@ -1168,7 +1171,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1221,7 +1224,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1346,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1397,7 +1400,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1412,7 +1415,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1469,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1524,7 +1527,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1601,7 +1604,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1681,7 +1684,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1833,7 +1836,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1888,9 +1891,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -1901,7 +1902,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,
@@ -1952,7 +1953,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2006,7 +2007,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2064,7 +2065,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2142,7 +2143,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2285,7 +2286,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2340,7 +2341,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2356,7 +2357,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2411,7 +2412,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2475,7 +2476,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/__init__.py
index 9e39c903cc4e..7b7677508ed5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/__init__.py
@@ -5,23 +5,34 @@
# 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 ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorResponse,
+ Identity,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ EnforcementMode,
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -39,5 +50,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_models_py3.py
index cf3c82a2c557..d4314d41113c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -98,7 +96,7 @@ def __init__(self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]]
self.type = type
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py
index c7724466858c..5dd65ab9b4f9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -901,6 +901,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -920,7 +921,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -974,6 +975,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1009,6 +1011,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1042,6 +1045,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1064,7 +1068,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,6 +1124,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1138,7 +1143,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1215,7 +1220,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,7 +1348,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1440,7 +1445,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1521,7 +1526,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1656,7 +1661,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1729,7 +1734,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1861,7 +1866,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1928,7 +1933,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,
@@ -1977,7 +1982,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2030,7 +2035,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2152,7 +2157,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2221,7 +2226,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2275,7 +2280,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2333,7 +2338,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2410,7 +2415,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2488,7 +2493,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2640,7 +2645,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2708,7 +2713,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,
@@ -2759,7 +2764,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2818,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2871,7 +2876,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2949,7 +2954,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3092,7 +3097,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3163,7 +3168,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3218,7 +3223,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3287,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py
index 7bbec1e4dbdc..613f257cad0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py
index 64472e498b61..49d2ddbf6bee 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_configuration.py
index c926ac5c2731..e58f2dd15a9f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py
index 565c01ec87b7..7bf24a98ce62 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py
index e6ec78252b46..d2d9da5821fa 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -64,7 +64,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -93,6 +93,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -112,7 +113,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -165,6 +166,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -200,6 +202,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -233,6 +236,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -255,7 +259,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -310,6 +314,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -328,7 +333,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +409,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -531,7 +536,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -627,7 +632,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -718,7 +723,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -798,7 +803,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -932,7 +937,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1004,7 +1009,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1135,7 +1140,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1189,9 +1194,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1202,7 +1205,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,
@@ -1251,7 +1254,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1304,7 +1307,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1426,7 +1429,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1480,7 +1483,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1495,7 +1498,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1549,7 +1552,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1607,7 +1610,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1684,7 +1687,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1764,7 +1767,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1916,7 +1919,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1970,9 +1973,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -1983,7 +1984,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,
@@ -2033,7 +2034,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2086,7 +2087,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2143,7 +2144,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2220,7 +2221,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2362,7 +2363,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2416,7 +2417,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2432,7 +2433,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2486,7 +2487,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2549,7 +2550,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/__init__.py
index e9c424666d69..8a73110c6944 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/__init__.py
@@ -5,29 +5,40 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import ParameterDefinitionsValue
-from ._models_py3 import ParameterDefinitionsValueMetadata
-from ._models_py3 import ParameterValuesValue
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionGroup
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySku
+from typing import TYPE_CHECKING
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import ParameterType
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ Identity,
+ ParameterDefinitionsValue,
+ ParameterDefinitionsValueMetadata,
+ ParameterValuesValue,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionGroup,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySku,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ EnforcementMode,
+ ParameterType,
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -51,5 +62,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/_models_py3.py
index 559721520bb4..3fd299408fbf 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -15,10 +14,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -244,7 +242,7 @@ def __init__(self, *, value: Optional[JSON] = None, **kwargs: Any) -> None:
self.value = value
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py
index cffc1cf441d3..01b8b96ffff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -943,6 +943,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -962,7 +963,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1015,6 +1016,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1050,6 +1052,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1083,6 +1086,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1105,7 +1109,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1160,6 +1164,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1178,7 +1183,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1254,7 +1259,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1381,7 +1386,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1477,7 +1482,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1568,7 +1573,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1648,7 +1653,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1782,7 +1787,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1854,7 +1859,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1985,7 +1990,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2052,7 +2057,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,
@@ -2101,7 +2106,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2154,7 +2159,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2276,7 +2281,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2345,7 +2350,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2399,7 +2404,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2457,7 +2462,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2534,7 +2539,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2612,7 +2617,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2764,7 +2769,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2831,7 +2836,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,
@@ -2881,7 +2886,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2934,7 +2939,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2991,7 +2996,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3068,7 +3073,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3210,7 +3215,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3280,7 +3285,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3334,7 +3339,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2019_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3397,7 +3402,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_configuration.py
index c27f590f9768..f97313a14d7c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py
index ab7e3cb312ec..b61c1aa861b0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyExemptionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To exempt your resources from policy evaluation and non-compliance state, you can create an
exemption at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_configuration.py
index 4b3f8b19aefd..bb41d338ca40 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py
index b0fa6c9e470f..cfd5fa3a12be 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyExemptionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To exempt your resources from policy evaluation and non-compliance state, you can create an
exemption at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/__init__.py
index 39de337183d5..47c451f102a8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/__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 ._operations import PolicyExemptionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyExemptionsOperations # 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__ = [
"PolicyExemptionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py
index a6cbb82d94d1..e83193bd9177 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -41,7 +40,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -67,9 +66,8 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, scope: str, policy_exemption_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> None:
+ # pylint: disable=line-too-long
"""Deletes a policy exemption.
This operation deletes a policy exemption, given its name and the scope it was created in. The
@@ -89,7 +87,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,
@@ -138,6 +136,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -174,6 +173,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -208,6 +208,7 @@ async def create_or_update(
parameters: Union[_models.PolicyExemption, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -232,7 +233,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -289,6 +290,7 @@ async def create_or_update(
@distributed_trace_async
async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Retrieves a policy exemption.
This operation retrieves a single policy exemption, given its name and the scope it was created
@@ -307,7 +309,7 @@ async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _m
:rtype: ~azure.mgmt.resource.policy.v2020_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -387,7 +389,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -489,7 +491,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -623,7 +625,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -729,7 +731,7 @@ def list_for_management_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/__init__.py
index b8a6766077de..f928780da4ee 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/__init__.py
@@ -5,17 +5,28 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import PolicyExemption
-from ._models_py3 import PolicyExemptionListResult
-from ._models_py3 import SystemData
+from typing import TYPE_CHECKING
-from ._policy_client_enums import CreatedByType
-from ._policy_client_enums import ExemptionCategory
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ PolicyExemption,
+ PolicyExemptionListResult,
+ SystemData,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ CreatedByType,
+ ExemptionCategory,
+)
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__ = [
@@ -27,5 +38,5 @@
"CreatedByType",
"ExemptionCategory",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/_models_py3.py
index 0f00929f8e72..7cfe24757068 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -97,7 +95,7 @@ def __init__(self, **kwargs: Any) -> None:
self.additional_info = None
-class PolicyExemption(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyExemption(_serialization.Model):
"""The policy exemption.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/__init__.py
index 39de337183d5..47c451f102a8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/__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 ._operations import PolicyExemptionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyExemptionsOperations # 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__ = [
"PolicyExemptionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py
index 36ac5dfe912b..ed275e3a266c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -291,6 +291,7 @@ def __init__(self, *args, **kwargs):
def delete( # pylint: disable=inconsistent-return-statements
self, scope: str, policy_exemption_name: str, **kwargs: Any
) -> None:
+ # pylint: disable=line-too-long
"""Deletes a policy exemption.
This operation deletes a policy exemption, given its name and the scope it was created in. The
@@ -310,7 +311,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,
@@ -359,6 +360,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -395,6 +397,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -429,6 +432,7 @@ def create_or_update(
parameters: Union[_models.PolicyExemption, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -453,7 +457,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -510,6 +514,7 @@ def create_or_update(
@distributed_trace
def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Retrieves a policy exemption.
This operation retrieves a single policy exemption, given its name and the scope it was created
@@ -528,7 +533,7 @@ def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.
:rtype: ~azure.mgmt.resource.policy.v2020_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -608,7 +613,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -710,7 +715,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -844,7 +849,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -950,7 +955,7 @@ def list_for_management_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_configuration.py
index 3ddfa2e71d0b..ff581cb7b68f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py
index 946a487218b0..8a976bd8a4ee 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py
@@ -26,11 +26,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_configuration.py
index fca8de4338ab..7f41accc8e7f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py
index 73b9ffcb3961..d79800a18fd4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py
@@ -26,11 +26,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/__init__.py
index e0d9228f911f..b603c66b4d96 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import DataPolicyManifestsOperations
-from ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DataPolicyManifestsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -21,5 +27,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py
index 5edba186e2c0..544e661b896c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -66,7 +66,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -103,7 +103,7 @@ async def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.D
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.DataPolicyManifest
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -169,7 +169,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.DataPolicyManifestListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -254,6 +254,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -273,7 +274,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -326,6 +327,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -361,6 +363,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -394,6 +397,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -416,7 +420,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -471,6 +475,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -489,7 +494,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +580,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -713,7 +718,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -820,7 +825,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -923,7 +928,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1004,7 +1009,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1138,7 +1143,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1210,7 +1215,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1341,7 +1346,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1395,9 +1400,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1408,7 +1411,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,
@@ -1457,7 +1460,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1510,7 +1513,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1632,7 +1635,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1686,7 +1689,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1701,7 +1704,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1755,7 +1758,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1836,7 +1839,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1933,7 +1936,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2037,7 +2040,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2191,7 +2194,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2245,9 +2248,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -2258,7 +2259,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,
@@ -2308,7 +2309,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2361,7 +2362,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2441,7 +2442,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2536,7 +2537,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2680,7 +2681,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2734,7 +2735,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2750,7 +2751,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2804,7 +2805,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2888,7 +2889,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py
index aa14165b7556..21ae5227ab68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/__init__.py
@@ -5,42 +5,53 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import DataEffect
-from ._models_py3 import DataManifestCustomResourceFunctionDefinition
-from ._models_py3 import DataPolicyManifest
-from ._models_py3 import DataPolicyManifestListResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import NonComplianceMessage
-from ._models_py3 import ParameterDefinitionsValue
-from ._models_py3 import ParameterDefinitionsValueMetadata
-from ._models_py3 import ParameterValuesValue
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionGroup
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import ResourceTypeAliases
+from typing import TYPE_CHECKING
-from ._policy_client_enums import AliasPathAttributes
-from ._policy_client_enums import AliasPathTokenType
-from ._policy_client_enums import AliasPatternType
-from ._policy_client_enums import AliasType
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import ParameterType
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ DataEffect,
+ DataManifestCustomResourceFunctionDefinition,
+ DataPolicyManifest,
+ DataPolicyManifestListResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ Identity,
+ NonComplianceMessage,
+ ParameterDefinitionsValue,
+ ParameterDefinitionsValueMetadata,
+ ParameterValuesValue,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyDefinition,
+ PolicyDefinitionGroup,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ ResourceTypeAliases,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ EnforcementMode,
+ ParameterType,
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -77,5 +88,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py
index ac11d306e23a..64167b9faf77 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -287,7 +286,7 @@ def __init__(
self.allow_custom_properties = allow_custom_properties
-class DataPolicyManifest(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DataPolicyManifest(_serialization.Model):
"""The data policy manifest.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -705,7 +704,7 @@ def __init__(self, *, value: Optional[JSON] = None, **kwargs: Any) -> None:
self.value = value
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/__init__.py
index e0d9228f911f..b603c66b4d96 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import DataPolicyManifestsOperations
-from ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DataPolicyManifestsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -21,5 +27,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py
index eacda53dc794..cc25deb72383 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1045,7 +1045,7 @@ def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.DataPol
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.DataPolicyManifest
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1111,7 +1111,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.DataPolicyManifestListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1194,6 +1194,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -1213,7 +1214,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1266,6 +1267,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1301,6 +1303,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1334,6 +1337,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1356,7 +1360,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1411,6 +1415,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1429,7 +1434,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1515,7 +1520,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1653,7 +1658,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1760,7 +1765,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1863,7 +1868,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1944,7 +1949,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2078,7 +2083,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2150,7 +2155,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2281,7 +2286,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2348,7 +2353,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,
@@ -2397,7 +2402,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2450,7 +2455,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2572,7 +2577,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2641,7 +2646,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2695,7 +2700,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2776,7 +2781,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2873,7 +2878,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2977,7 +2982,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3131,7 +3136,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3198,7 +3203,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,
@@ -3248,7 +3253,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3301,7 +3306,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3381,7 +3386,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3476,7 +3481,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3620,7 +3625,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3690,7 +3695,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3744,7 +3749,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2020_09_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3828,7 +3833,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_configuration.py
index 54dd9ee95477..66991a1b6b77 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py
index 37b52a19baf1..f0c2c7e51c56 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_configuration.py
index 33b5aa4d0dec..5b4cbc90b444 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py
index 959940e2841c..4a6af43f3c93 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations, PolicyDefinitionsOperations, PolicySetDefinitionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py
index 557486ef5d46..ad71cbb7b9f9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -66,7 +66,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -95,6 +95,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -114,7 +115,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -167,6 +168,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -202,6 +204,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -235,6 +238,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -257,7 +261,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -312,6 +316,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -330,7 +335,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -381,6 +386,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -416,6 +422,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -449,6 +456,7 @@ async def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -472,7 +480,7 @@ async def update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -570,7 +578,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -708,7 +716,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -815,7 +823,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -918,7 +926,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -999,7 +1007,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1133,7 +1141,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1205,7 +1213,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1338,7 +1346,7 @@ async def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1481,7 +1489,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1535,9 +1543,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -1548,7 +1554,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,
@@ -1597,7 +1603,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1650,7 +1656,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1772,7 +1778,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1826,7 +1832,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1841,7 +1847,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1895,7 +1901,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1976,7 +1982,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2073,7 +2079,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2177,7 +2183,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2331,7 +2337,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2385,9 +2391,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -2398,7 +2402,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,
@@ -2448,7 +2452,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2501,7 +2505,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2581,7 +2585,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2676,7 +2680,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2820,7 +2824,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2874,7 +2878,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, policy_set_definition_name: str, management_group_id: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2890,7 +2894,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2944,7 +2948,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3028,7 +3032,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/__init__.py
index 4e6eaadb6ca9..9e4f79ab1155 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/__init__.py
@@ -5,33 +5,44 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import NonComplianceMessage
-from ._models_py3 import ParameterDefinitionsValue
-from ._models_py3 import ParameterDefinitionsValueMetadata
-from ._models_py3 import ParameterValuesValue
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyAssignmentUpdate
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionGroup
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentitiesValue
+from typing import TYPE_CHECKING
-from ._policy_client_enums import CreatedByType
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import ParameterType
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ Identity,
+ NonComplianceMessage,
+ ParameterDefinitionsValue,
+ ParameterDefinitionsValueMetadata,
+ ParameterValuesValue,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyAssignmentUpdate,
+ PolicyDefinition,
+ PolicyDefinitionGroup,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ SystemData,
+ UserAssignedIdentitiesValue,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ CreatedByType,
+ EnforcementMode,
+ ParameterType,
+ PolicyType,
+ ResourceIdentityType,
+)
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__ = [
@@ -59,5 +70,5 @@
"PolicyType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/_models_py3.py
index fdd693707df5..5217a9761bdb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -330,7 +329,7 @@ def __init__(self, *, value: Optional[JSON] = None, **kwargs: Any) -> None:
self.value = value
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -528,7 +527,7 @@ def __init__(
self.identity = identity
-class PolicyDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyDefinition(_serialization.Model):
"""The policy definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -782,7 +781,7 @@ def __init__(
self.group_names = group_names
-class PolicySetDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicySetDefinition(_serialization.Model):
"""The policy set definition.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/__init__.py
index 1ffc98049cc4..799ae6da3a0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import PolicyAssignmentsOperations
-from ._operations import PolicyDefinitionsOperations
-from ._operations import PolicySetDefinitionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # type: ignore
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # 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__ = [
@@ -19,5 +25,5 @@
"PolicyDefinitionsOperations",
"PolicySetDefinitionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py
index f95e214bf0f8..6086c493478d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1047,6 +1047,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -1066,7 +1067,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1119,6 +1120,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1154,6 +1156,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1187,6 +1190,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -1209,7 +1213,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1264,6 +1268,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -1282,7 +1287,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1333,6 +1338,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -1368,6 +1374,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -1401,6 +1408,7 @@ def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -1424,7 +1432,7 @@ def update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1522,7 +1530,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1660,7 +1668,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1767,7 +1775,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1870,7 +1878,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1951,7 +1959,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2085,7 +2093,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2157,7 +2165,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2290,7 +2298,7 @@ def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2433,7 +2441,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2500,7 +2508,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,
@@ -2549,7 +2557,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2602,7 +2610,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2724,7 +2732,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2793,7 +2801,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2847,7 +2855,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2928,7 +2936,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3025,7 +3033,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3129,7 +3137,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3283,7 +3291,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3350,7 +3358,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,
@@ -3400,7 +3408,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3453,7 +3461,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3533,7 +3541,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3628,7 +3636,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3772,7 +3780,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3842,7 +3850,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3896,7 +3904,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2021_06_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3980,7 +3988,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_configuration.py
index 5ac432955670..74397f94bb6b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py
index bfc7976cff0c..33b6d4bbdc2c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_configuration.py
index d540a753bb8e..ecdbff91e8bf 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py
index 1546668736b9..db689d960540 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyAssignmentsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/__init__.py
index 560ad80775cb..47ccd9e0685e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/__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 ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # 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__ = [
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py
index 35d937edbc3c..155e5ef0a4ac 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -46,7 +46,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -75,6 +75,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -94,7 +95,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -147,6 +148,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -182,6 +184,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -215,6 +218,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -237,7 +241,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -292,6 +296,7 @@ async def create(
@distributed_trace_async
async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -310,7 +315,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -361,6 +366,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -396,6 +402,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -429,6 +436,7 @@ async def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -452,7 +460,7 @@ async def update(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -550,7 +558,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -688,7 +696,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -795,7 +803,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -898,7 +906,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -979,7 +987,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1113,7 +1121,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1185,7 +1193,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1318,7 +1326,7 @@ async def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/__init__.py
index 9cd0f711dfac..dd4d1c60ab42 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/__init__.py
@@ -5,28 +5,39 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import NonComplianceMessage
-from ._models_py3 import Override
-from ._models_py3 import ParameterValuesValue
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyAssignmentUpdate
-from ._models_py3 import ResourceSelector
-from ._models_py3 import Selector
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentitiesValue
+from typing import TYPE_CHECKING
-from ._policy_client_enums import CreatedByType
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import OverrideKind
-from ._policy_client_enums import ResourceIdentityType
-from ._policy_client_enums import SelectorKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ Identity,
+ NonComplianceMessage,
+ Override,
+ ParameterValuesValue,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyAssignmentUpdate,
+ ResourceSelector,
+ Selector,
+ SystemData,
+ UserAssignedIdentitiesValue,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ CreatedByType,
+ EnforcementMode,
+ OverrideKind,
+ ResourceIdentityType,
+ SelectorKind,
+)
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__ = [
@@ -49,5 +60,5 @@
"ResourceIdentityType",
"SelectorKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/_models_py3.py
index 378a318ce85a..7b46b984a7f1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -258,7 +256,7 @@ def __init__(self, *, value: Optional[JSON] = None, **kwargs: Any) -> None:
self.value = value
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/__init__.py
index 560ad80775cb..47ccd9e0685e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/__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 ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyAssignmentsOperations # 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__ = [
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py
index 0c7526903ed7..ec38dd7a1dfc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -441,6 +441,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -460,7 +461,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -513,6 +514,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -548,6 +550,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -581,6 +584,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -603,7 +607,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -658,6 +662,7 @@ def create(
@distributed_trace
def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -676,7 +681,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -727,6 +732,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -762,6 +768,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -795,6 +802,7 @@ def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -818,7 +826,7 @@ def update(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -916,7 +924,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1054,7 +1062,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1161,7 +1169,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1264,7 +1272,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1345,7 +1353,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1479,7 +1487,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1551,7 +1559,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1684,7 +1692,7 @@ def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2022_06_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_configuration.py
index 1bc86c0044e0..b05e3d7a2c21 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py
index 9ea7cde53ee4..b5eab4d992ce 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyExemptionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To exempt your resources from policy evaluation and non-compliance state, you can create an
exemption at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_configuration.py
index a6e1cd862b52..7dbd2bd13722 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py
index a25054cc7966..f1178fd9efb0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import PolicyExemptionsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To exempt your resources from policy evaluation and non-compliance state, you can create an
exemption at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/__init__.py
index 39de337183d5..47c451f102a8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/__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 ._operations import PolicyExemptionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyExemptionsOperations # 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__ = [
"PolicyExemptionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py
index 5db9eb06b0aa..a506a4f7b9bc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -68,9 +67,8 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, scope: str, policy_exemption_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> None:
+ # pylint: disable=line-too-long
"""Deletes a policy exemption.
This operation deletes a policy exemption, given its name and the scope it was created in. The
@@ -90,7 +88,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,
@@ -139,6 +137,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -175,6 +174,7 @@ async def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -209,6 +209,7 @@ async def create_or_update(
parameters: Union[_models.PolicyExemption, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -233,7 +234,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -290,6 +291,7 @@ async def create_or_update(
@distributed_trace_async
async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Retrieves a policy exemption.
This operation retrieves a single policy exemption, given its name and the scope it was created
@@ -308,7 +310,7 @@ async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _m
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -361,6 +363,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -394,6 +397,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -425,6 +429,7 @@ async def update(
parameters: Union[_models.PolicyExemptionUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -446,7 +451,7 @@ async def update(
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -538,7 +543,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -640,7 +645,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -774,7 +779,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -880,7 +885,7 @@ def list_for_management_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/__init__.py
index 60489bb31a2a..b0ec71ae6575 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/__init__.py
@@ -5,22 +5,33 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import PolicyExemption
-from ._models_py3 import PolicyExemptionListResult
-from ._models_py3 import PolicyExemptionUpdate
-from ._models_py3 import ResourceSelector
-from ._models_py3 import Selector
-from ._models_py3 import SystemData
+from typing import TYPE_CHECKING
-from ._policy_client_enums import AssignmentScopeValidation
-from ._policy_client_enums import CreatedByType
-from ._policy_client_enums import ExemptionCategory
-from ._policy_client_enums import SelectorKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ PolicyExemption,
+ PolicyExemptionListResult,
+ PolicyExemptionUpdate,
+ ResourceSelector,
+ Selector,
+ SystemData,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ AssignmentScopeValidation,
+ CreatedByType,
+ ExemptionCategory,
+ SelectorKind,
+)
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__ = [
@@ -37,5 +48,5 @@
"ExemptionCategory",
"SelectorKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/_models_py3.py
index 1c8332449ff3..2721e8a41ea9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -97,7 +95,7 @@ def __init__(self, **kwargs: Any) -> None:
self.additional_info = None
-class PolicyExemption(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyExemption(_serialization.Model):
"""The policy exemption.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/__init__.py
index 39de337183d5..47c451f102a8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/__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 ._operations import PolicyExemptionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyExemptionsOperations # 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__ = [
"PolicyExemptionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py
index 914b70885036..1ceb65e5e833 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -321,6 +321,7 @@ def __init__(self, *args, **kwargs):
def delete( # pylint: disable=inconsistent-return-statements
self, scope: str, policy_exemption_name: str, **kwargs: Any
) -> None:
+ # pylint: disable=line-too-long
"""Deletes a policy exemption.
This operation deletes a policy exemption, given its name and the scope it was created in. The
@@ -340,7 +341,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,
@@ -389,6 +390,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -425,6 +427,7 @@ def create_or_update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -459,6 +462,7 @@ def create_or_update(
parameters: Union[_models.PolicyExemption, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Creates or updates a policy exemption.
This operation creates or updates a policy exemption with the given scope and name. Policy
@@ -483,7 +487,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -540,6 +544,7 @@ def create_or_update(
@distributed_trace
def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Retrieves a policy exemption.
This operation retrieves a single policy exemption, given its name and the scope it was created
@@ -558,7 +563,7 @@ def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models.
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -611,6 +616,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -644,6 +650,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -675,6 +682,7 @@ def update(
parameters: Union[_models.PolicyExemptionUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyExemption:
+ # pylint: disable=line-too-long
"""Updates a policy exemption.
This operation updates a policy exemption with the given scope and name.
@@ -696,7 +704,7 @@ def update(
:rtype: ~azure.mgmt.resource.policy.v2022_07_01_preview.models.PolicyExemption
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -788,7 +796,7 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -890,7 +898,7 @@ def list_for_resource_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1024,7 +1032,7 @@ def list_for_resource(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1130,7 +1138,7 @@ def list_for_management_group(
)
cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_configuration.py
index 87a02a164e66..04b46e0cc9f8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py
index 21b55283ea50..a2907e70f353 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import VariableValuesOperations, VariablesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To use in policy authoring you can create a variable at a scope. Variables created at a scope
can be shared between multiple policy definitions.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_configuration.py
index 24c47e19cdb6..99edfbb92204 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py
index 63a0c37cd3e9..8b7e58091844 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py
@@ -21,11 +21,10 @@
from .operations import VariableValuesOperations, VariablesOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To use in policy authoring you can create a variable at a scope. Variables created at a scope
can be shared between multiple policy definitions.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/__init__.py
index 5ba7c16bfd34..eba6adad398e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import VariablesOperations
-from ._operations import VariableValuesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import VariablesOperations # type: ignore
+from ._operations import VariableValuesOperations # 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__ = [
"VariablesOperations",
"VariableValuesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py
index 4db26f976a2e..3399a6a42121 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -50,7 +50,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, variable_name: str, **kwargs: Any) -> None:
"""Deletes a variable.
This operation deletes a variable, given its name and the subscription it was created in. The
@@ -89,7 +89,7 @@ async def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: di
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -188,7 +188,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -256,7 +256,7 @@ async def get(self, variable_name: str, **kwargs: Any) -> _models.Variable:
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -300,9 +300,7 @@ async def get(self, variable_name: str, **kwargs: Any) -> _models.Variable:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
- self, management_group_id: str, variable_name: str, **kwargs: Any
- ) -> None:
+ async def delete_at_management_group(self, management_group_id: str, variable_name: str, **kwargs: Any) -> None:
"""Deletes a variable.
This operation deletes a variable, given its name and the management group it was created in.
@@ -317,7 +315,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -438,7 +436,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -510,7 +508,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -572,7 +570,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Variable"]:
)
cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -653,7 +651,7 @@ def list_for_management_group(self, management_group_id: str, **kwargs: Any) ->
)
cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -735,9 +733,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, variable_name: str, variable_value_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, variable_name: str, variable_value_name: str, **kwargs: Any) -> None:
"""Deletes a variable value.
This operation deletes a variable value, given its name, the subscription it was created in,
@@ -752,7 +748,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,
@@ -875,7 +871,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -946,7 +942,7 @@ async def get(self, variable_name: str, variable_value_name: str, **kwargs: Any)
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1012,7 +1008,7 @@ def list(self, variable_name: str, **kwargs: Any) -> AsyncIterable["_models.Vari
)
cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1099,7 +1095,7 @@ def list_for_management_group(
)
cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1161,7 +1157,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, management_group_id: str, variable_name: str, variable_value_name: str, **kwargs: Any
) -> None:
"""Deletes a variable value.
@@ -1180,7 +1176,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1312,7 +1308,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1387,7 +1383,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py
index 75717eb9c606..00c949032606 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/__init__.py
@@ -5,20 +5,31 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import PolicyVariableColumn
-from ._models_py3 import PolicyVariableValueColumnValue
-from ._models_py3 import SystemData
-from ._models_py3 import Variable
-from ._models_py3 import VariableListResult
-from ._models_py3 import VariableValue
-from ._models_py3 import VariableValueListResult
+from typing import TYPE_CHECKING
-from ._policy_client_enums import CreatedByType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ PolicyVariableColumn,
+ PolicyVariableValueColumnValue,
+ SystemData,
+ Variable,
+ VariableListResult,
+ VariableValue,
+ VariableValueListResult,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ CreatedByType,
+)
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 +44,5 @@
"VariableValueListResult",
"CreatedByType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/_models_py3.py
index caa2f41a1a28..335c3144eb3a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/__init__.py
index 5ba7c16bfd34..eba6adad398e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import VariablesOperations
-from ._operations import VariableValuesOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import VariablesOperations # type: ignore
+from ._operations import VariableValuesOperations # 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__ = [
"VariablesOperations",
"VariableValuesOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py
index 38ee6a7ecbb3..2a8a50b5ff68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -554,7 +554,7 @@ def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: disable=
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -653,7 +653,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -721,7 +721,7 @@ def get(self, variable_name: str, **kwargs: Any) -> _models.Variable:
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -782,7 +782,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -903,7 +903,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -973,7 +973,7 @@ def get_at_management_group(self, management_group_id: str, variable_name: str,
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.Variable
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1035,7 +1035,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Variable"]:
)
cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1116,7 +1116,7 @@ def list_for_management_group(self, management_group_id: str, **kwargs: Any) ->
)
cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1215,7 +1215,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,
@@ -1338,7 +1338,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1409,7 +1409,7 @@ def get(self, variable_name: str, variable_value_name: str, **kwargs: Any) -> _m
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1475,7 +1475,7 @@ def list(self, variable_name: str, **kwargs: Any) -> Iterable["_models.VariableV
)
cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1562,7 +1562,7 @@ def list_for_management_group(
)
cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1643,7 +1643,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1775,7 +1775,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1850,7 +1850,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2022_08_01_preview.models.VariableValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/__init__.py
index d2ac4ef91ca4..02f33f3e073a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/__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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_configuration.py
index 97c0d4da5d04..b5d1fa519d9b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_policy_client.py
index 5abeab04ce46..85553f39d1d0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_policy_client.py
@@ -27,11 +27,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/__init__.py
index 67097cd4cd1b..18537e83bff7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/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 ._policy_client import PolicyClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._policy_client import PolicyClient # 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__ = [
"PolicyClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_configuration.py
index 0305aa6d6edd..2e08939d52a6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_policy_client.py
index 69911a55d685..85a7d770bb59 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_policy_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/_policy_client.py
@@ -27,11 +27,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class PolicyClient: # pylint: disable=client-accepts-api-version-keyword
+class PolicyClient:
"""To manage and control access to your resources, you can define customized policies and assign
them at a scope.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/__init__.py
index 8cb3bc87b219..93b833ce18c8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/__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 ._operations import PolicyDefinitionsOperations
-from ._operations import PolicyDefinitionVersionsOperations
-from ._operations import PolicySetDefinitionsOperations
-from ._operations import PolicySetDefinitionVersionsOperations
-from ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicyDefinitionVersionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionVersionsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # 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__ = [
@@ -23,5 +29,5 @@
"PolicySetDefinitionVersionsOperations",
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/_operations.py
index 6afe91845f15..27ec41bb6e3a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -92,7 +92,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -187,7 +187,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -241,9 +241,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy definition in a subscription.
This operation deletes the policy definition in the given subscription with the given name.
@@ -254,7 +252,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,
@@ -303,7 +301,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -356,7 +354,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -478,7 +476,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -532,7 +530,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, management_group_id: str, policy_definition_name: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -547,7 +545,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -601,7 +599,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -682,7 +680,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -779,7 +777,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -883,7 +881,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -977,7 +975,7 @@ async def list_all_builtins(self, **kwargs: Any) -> _models.PolicyDefinitionVers
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1032,7 +1030,7 @@ async def list_all_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1083,7 +1081,7 @@ async def list_all(self, **kwargs: Any) -> _models.PolicyDefinitionVersionListRe
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1212,7 +1210,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1267,9 +1265,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_definition_name: str, policy_definition_version: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_definition_name: str, policy_definition_version: str, **kwargs: Any) -> None:
"""Deletes a policy definition version in a subscription.
This operation deletes the policy definition version in the given subscription with the given
@@ -1285,7 +1281,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,
@@ -1342,7 +1338,7 @@ async def get(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1402,7 +1398,7 @@ async def get_built_in(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1544,7 +1540,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1599,7 +1595,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, management_group_name: str, policy_definition_name: str, policy_definition_version: str, **kwargs: Any
) -> None:
"""Deletes a policy definition in a management group.
@@ -1619,7 +1615,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1679,7 +1675,7 @@ async def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1747,7 +1743,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1835,7 +1831,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1925,7 +1921,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2079,7 +2075,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2133,9 +2129,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, **kwargs: Any) -> None:
"""Deletes a policy set definition.
This operation deletes the policy set definition in the given subscription with the given name.
@@ -2146,7 +2140,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,
@@ -2184,7 +2178,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace_async
- async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicySetDefinition:
+ async def get(
+ self, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicySetDefinition:
"""Retrieves a policy set definition.
This operation retrieves the policy set definition in the given subscription with the given
@@ -2192,11 +2188,15 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2213,6 +2213,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
_request = build_policy_set_definitions_get_request(
policy_set_definition_name=policy_set_definition_name,
subscription_id=self._config.subscription_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -2238,18 +2239,24 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P
return deserialized # type: ignore
@distributed_trace_async
- async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicySetDefinition:
+ async def get_built_in(
+ self, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicySetDefinition:
"""Retrieves a built in policy set definition.
This operation retrieves the built-in policy set definition with the given name.
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2265,6 +2272,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
_request = build_policy_set_definitions_get_built_in_request(
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -2291,7 +2299,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) ->
@distributed_trace
def list(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinition"]:
"""Retrieves the policy set definitions for a subscription.
@@ -2315,6 +2323,10 @@ def list(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -2329,7 +2341,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2343,6 +2355,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_request(
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -2393,7 +2406,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_built_in(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinition"]:
"""Retrieves built-in policy set definitions.
@@ -2410,6 +2423,10 @@ def list_built_in(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -2424,7 +2441,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2437,6 +2454,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_built_in_request(
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -2568,7 +2586,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2622,7 +2640,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, management_group_id: str, policy_set_definition_name: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition.
@@ -2638,7 +2656,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2677,7 +2695,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
@distributed_trace_async
async def get_at_management_group(
- self, management_group_id: str, policy_set_definition_name: str, **kwargs: Any
+ self, management_group_id: str, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
) -> _models.PolicySetDefinition:
"""Retrieves a policy set definition.
@@ -2688,11 +2706,15 @@ async def get_at_management_group(
:type management_group_id: str
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2709,6 +2731,7 @@ async def get_at_management_group(
_request = build_policy_set_definitions_get_at_management_group_request(
management_group_id=management_group_id,
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -2735,7 +2758,12 @@ async def get_at_management_group(
@distributed_trace
def list_by_management_group(
- self, management_group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_id: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinition"]:
"""Retrieves all policy set definitions in management group.
@@ -2762,6 +2790,10 @@ def list_by_management_group(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -2776,7 +2808,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2790,6 +2822,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_by_management_group_request(
management_group_id=management_group_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -2870,7 +2903,7 @@ async def list_all_builtins(self, **kwargs: Any) -> _models.PolicySetDefinitionV
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2925,7 +2958,7 @@ async def list_all_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2976,7 +3009,7 @@ async def list_all(self, **kwargs: Any) -> _models.PolicySetDefinitionVersionLis
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3105,7 +3138,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3160,9 +3193,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
- ) -> None:
+ async def delete(self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any) -> None:
"""Deletes a policy set definition version.
This operation deletes the policy set definition version in the given subscription with the
@@ -3178,7 +3209,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,
@@ -3218,7 +3249,11 @@ async def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace_async
async def get(
- self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a policy set definition version.
@@ -3231,11 +3266,15 @@ async def get(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3253,6 +3292,7 @@ async def get(
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
subscription_id=self._config.subscription_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -3279,7 +3319,11 @@ async def get(
@distributed_trace_async
async def get_built_in(
- self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a built in policy set definition version.
@@ -3292,11 +3336,15 @@ async def get_built_in(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3313,6 +3361,7 @@ async def get_built_in(
_request = build_policy_set_definition_versions_get_built_in_request(
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -3339,8 +3388,9 @@ async def get_built_in(
@distributed_trace
def list(
- self, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self, policy_set_definition_name: str, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinitionVersion"]:
+ # pylint: disable=line-too-long
"""Retrieves the policy set definition versions for a given policy set definition in a
subscription.
@@ -3349,6 +3399,10 @@ def list(
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -3364,7 +3418,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3378,6 +3432,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_request(
policy_set_definition_name=policy_set_definition_name,
subscription_id=self._config.subscription_id,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -3428,8 +3483,9 @@ async def get_next(next_link=None):
@distributed_trace
def list_built_in(
- self, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self, policy_set_definition_name: str, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinitionVersion"]:
+ # pylint: disable=line-too-long
"""Retrieves built-in policy set definition versions.
This operation retrieves a list of all the built-in policy set definition versions for the
@@ -3437,6 +3493,10 @@ def list_built_in(
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -3452,7 +3512,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3465,6 +3525,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_built_in_request(
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -3614,7 +3675,7 @@ async def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3669,7 +3730,7 @@ async def create_or_update_at_management_group(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_management_group( # pylint: disable=inconsistent-return-statements
+ async def delete_at_management_group(
self, management_group_name: str, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
) -> None:
"""Deletes a policy set definition version.
@@ -3690,7 +3751,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3730,7 +3791,12 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta
@distributed_trace_async
async def get_at_management_group(
- self, management_group_name: str, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ management_group_name: str,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a policy set definition version.
@@ -3746,11 +3812,15 @@ async def get_at_management_group(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3768,6 +3838,7 @@ async def get_at_management_group(
management_group_name=management_group_name,
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -3794,8 +3865,14 @@ async def get_at_management_group(
@distributed_trace
def list_by_management_group(
- self, management_group_name: str, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_name: str,
+ policy_set_definition_name: str,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
) -> AsyncIterable["_models.PolicySetDefinitionVersion"]:
+ # pylint: disable=line-too-long
"""Retrieves all policy set definition versions for a given policy set definition in a management
group.
@@ -3807,6 +3884,10 @@ def list_by_management_group(
:type management_group_name: str
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -3822,7 +3903,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3836,6 +3917,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_by_management_group_request(
management_group_name=management_group_name,
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -3909,6 +3991,7 @@ def __init__(self, *args, **kwargs) -> None:
async def delete(
self, scope: str, policy_assignment_name: str, **kwargs: Any
) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -3928,7 +4011,7 @@ async def delete(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3981,6 +4064,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -4016,6 +4100,7 @@ async def create(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -4049,6 +4134,7 @@ async def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -4071,7 +4157,7 @@ async def create(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4125,7 +4211,10 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ async def get(
+ self, scope: str, policy_assignment_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -4140,11 +4229,15 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
:type scope: str
:param policy_assignment_name: The name of the policy assignment to get. Required.
:type policy_assignment_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicyAssignment or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4161,6 +4254,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _
_request = build_policy_assignments_get_request(
scope=scope,
policy_assignment_name=policy_assignment_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -4195,6 +4289,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -4230,6 +4325,7 @@ async def update(
content_type: str = "application/json",
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -4263,6 +4359,7 @@ async def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -4286,7 +4383,7 @@ async def update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4341,7 +4438,12 @@ async def update(
@distributed_trace
def list_for_resource_group(
- self, resource_group_name: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ resource_group_name: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a resource group.
@@ -4370,6 +4472,10 @@ def list_for_resource_group(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4384,7 +4490,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4399,6 +4505,7 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4456,6 +4563,7 @@ def list_for_resource(
resource_type: str,
resource_name: str,
filter: Optional[str] = None,
+ expand: Optional[str] = None,
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
@@ -4508,6 +4616,10 @@ def list_for_resource(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4522,7 +4634,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4541,6 +4653,7 @@ def prepare_request(next_link=None):
resource_name=resource_name,
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4591,7 +4704,12 @@ async def get_next(next_link=None):
@distributed_trace
def list_for_management_group(
- self, management_group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_id: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a management group.
@@ -4615,6 +4733,10 @@ def list_for_management_group(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4629,7 +4751,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4643,6 +4765,7 @@ def prepare_request(next_link=None):
_request = build_policy_assignments_list_for_management_group_request(
management_group_id=management_group_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4693,7 +4816,7 @@ async def get_next(next_link=None):
@distributed_trace
def list(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a subscription.
@@ -4718,6 +4841,10 @@ def list(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4732,7 +4859,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4746,6 +4873,7 @@ def prepare_request(next_link=None):
_request = build_policy_assignments_list_request(
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4813,7 +4941,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4947,7 +5075,7 @@ async def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5000,7 +5128,9 @@ async def create_by_id(
return deserialized # type: ignore
@distributed_trace_async
- async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyAssignment:
+ async def get_by_id(
+ self, policy_assignment_id: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicyAssignment:
"""Retrieves the policy assignment with the given ID.
The operation retrieves the policy assignment with the given ID. Policy assignment IDs have
@@ -5015,11 +5145,15 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
:param policy_assignment_id: The ID of the policy assignment to get. Use the format
'{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Required.
:type policy_assignment_id: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicyAssignment or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5035,6 +5169,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P
_request = build_policy_assignments_get_by_id_request(
policy_assignment_id=policy_assignment_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -5152,7 +5287,7 @@ async def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/__init__.py
index f986b2b36b12..04548f1617bc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/__init__.py
@@ -5,42 +5,53 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import Identity
-from ._models_py3 import NonComplianceMessage
-from ._models_py3 import Override
-from ._models_py3 import ParameterDefinitionsValue
-from ._models_py3 import ParameterDefinitionsValueMetadata
-from ._models_py3 import ParameterValuesValue
-from ._models_py3 import PolicyAssignment
-from ._models_py3 import PolicyAssignmentListResult
-from ._models_py3 import PolicyAssignmentUpdate
-from ._models_py3 import PolicyDefinition
-from ._models_py3 import PolicyDefinitionGroup
-from ._models_py3 import PolicyDefinitionListResult
-from ._models_py3 import PolicyDefinitionReference
-from ._models_py3 import PolicyDefinitionVersion
-from ._models_py3 import PolicyDefinitionVersionListResult
-from ._models_py3 import PolicySetDefinition
-from ._models_py3 import PolicySetDefinitionListResult
-from ._models_py3 import PolicySetDefinitionVersion
-from ._models_py3 import PolicySetDefinitionVersionListResult
-from ._models_py3 import ResourceSelector
-from ._models_py3 import Selector
-from ._models_py3 import SystemData
-from ._models_py3 import UserAssignedIdentitiesValue
+from typing import TYPE_CHECKING
-from ._policy_client_enums import CreatedByType
-from ._policy_client_enums import EnforcementMode
-from ._policy_client_enums import OverrideKind
-from ._policy_client_enums import ParameterType
-from ._policy_client_enums import PolicyType
-from ._policy_client_enums import ResourceIdentityType
-from ._policy_client_enums import SelectorKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ Identity,
+ NonComplianceMessage,
+ Override,
+ ParameterDefinitionsValue,
+ ParameterDefinitionsValueMetadata,
+ ParameterValuesValue,
+ PolicyAssignment,
+ PolicyAssignmentListResult,
+ PolicyAssignmentUpdate,
+ PolicyDefinition,
+ PolicyDefinitionGroup,
+ PolicyDefinitionListResult,
+ PolicyDefinitionReference,
+ PolicyDefinitionVersion,
+ PolicyDefinitionVersionListResult,
+ PolicySetDefinition,
+ PolicySetDefinitionListResult,
+ PolicySetDefinitionVersion,
+ PolicySetDefinitionVersionListResult,
+ ResourceSelector,
+ Selector,
+ SystemData,
+ UserAssignedIdentitiesValue,
+)
+
+from ._policy_client_enums import ( # type: ignore
+ CreatedByType,
+ EnforcementMode,
+ OverrideKind,
+ ParameterType,
+ PolicyType,
+ ResourceIdentityType,
+ SelectorKind,
+)
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__ = [
@@ -77,5 +88,5 @@
"ResourceIdentityType",
"SelectorKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/_models_py3.py
index 16769ab89c92..3117b52fcd9f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -382,7 +381,7 @@ def __init__(self, *, value: Optional[JSON] = None, **kwargs: Any) -> None:
self.value = value
-class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyAssignment(_serialization.Model):
"""The policy assignment.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -407,6 +406,12 @@ class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instan
:vartype policy_definition_id: str
:ivar definition_version: The version of the policy definition to use.
:vartype definition_version: str
+ :ivar latest_definition_version: The latest version of the policy definition available. This is
+ only present if requested via the $expand query parameter.
+ :vartype latest_definition_version: str
+ :ivar effective_definition_version: The effective version of the policy definition in use. This
+ is only present if requested via the $expand query parameter.
+ :vartype effective_definition_version: str
:ivar scope: The scope for the policy assignment.
:vartype scope: str
:ivar not_scopes: The policy's excluded scopes.
@@ -440,6 +445,8 @@ class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instan
"type": {"readonly": True},
"name": {"readonly": True},
"system_data": {"readonly": True},
+ "latest_definition_version": {"readonly": True},
+ "effective_definition_version": {"readonly": True},
"scope": {"readonly": True},
}
@@ -453,6 +460,8 @@ class PolicyAssignment(_serialization.Model): # pylint: disable=too-many-instan
"display_name": {"key": "properties.displayName", "type": "str"},
"policy_definition_id": {"key": "properties.policyDefinitionId", "type": "str"},
"definition_version": {"key": "properties.definitionVersion", "type": "str"},
+ "latest_definition_version": {"key": "properties.latestDefinitionVersion", "type": "str"},
+ "effective_definition_version": {"key": "properties.effectiveDefinitionVersion", "type": "str"},
"scope": {"key": "properties.scope", "type": "str"},
"not_scopes": {"key": "properties.notScopes", "type": "[str]"},
"parameters": {"key": "properties.parameters", "type": "{ParameterValuesValue}"},
@@ -531,6 +540,8 @@ def __init__(
self.display_name = display_name
self.policy_definition_id = policy_definition_id
self.definition_version = definition_version
+ self.latest_definition_version = None
+ self.effective_definition_version = None
self.scope = None
self.not_scopes = not_scopes
self.parameters = parameters
@@ -625,7 +636,7 @@ def __init__(
self.overrides = overrides
-class PolicyDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyDefinition(_serialization.Model):
"""The policy definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -837,12 +848,20 @@ def __init__(
class PolicyDefinitionReference(_serialization.Model):
"""The policy definition reference.
+ Variables are only populated by the server, and will be ignored when sending a request.
+
All required parameters must be populated in order to send to server.
:ivar policy_definition_id: The ID of the policy definition or policy set definition. Required.
:vartype policy_definition_id: str
:ivar definition_version: The version of the policy definition to use.
:vartype definition_version: str
+ :ivar latest_definition_version: The latest version of the policy definition available. This is
+ only present if requested via the $expand query parameter.
+ :vartype latest_definition_version: str
+ :ivar effective_definition_version: The effective version of the policy definition in use. This
+ is only present if requested via the $expand query parameter.
+ :vartype effective_definition_version: str
:ivar parameters: The parameter values for the referenced policy rule. The keys are the
parameter names.
:vartype parameters: dict[str,
@@ -856,11 +875,15 @@ class PolicyDefinitionReference(_serialization.Model):
_validation = {
"policy_definition_id": {"required": True},
+ "latest_definition_version": {"readonly": True},
+ "effective_definition_version": {"readonly": True},
}
_attribute_map = {
"policy_definition_id": {"key": "policyDefinitionId", "type": "str"},
"definition_version": {"key": "definitionVersion", "type": "str"},
+ "latest_definition_version": {"key": "latestDefinitionVersion", "type": "str"},
+ "effective_definition_version": {"key": "effectiveDefinitionVersion", "type": "str"},
"parameters": {"key": "parameters", "type": "{ParameterValuesValue}"},
"policy_definition_reference_id": {"key": "policyDefinitionReferenceId", "type": "str"},
"group_names": {"key": "groupNames", "type": "[str]"},
@@ -895,12 +918,14 @@ def __init__(
super().__init__(**kwargs)
self.policy_definition_id = policy_definition_id
self.definition_version = definition_version
+ self.latest_definition_version = None
+ self.effective_definition_version = None
self.parameters = parameters
self.policy_definition_reference_id = policy_definition_reference_id
self.group_names = group_names
-class PolicyDefinitionVersion(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicyDefinitionVersion(_serialization.Model):
"""The ID of the policy definition version.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1041,7 +1066,7 @@ def __init__(
self.next_link = next_link
-class PolicySetDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicySetDefinition(_serialization.Model):
"""The policy set definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1195,7 +1220,7 @@ def __init__(
self.next_link = next_link
-class PolicySetDefinitionVersion(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class PolicySetDefinitionVersion(_serialization.Model):
"""The policy set definition version.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/__init__.py
index 8cb3bc87b219..93b833ce18c8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/__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 ._operations import PolicyDefinitionsOperations
-from ._operations import PolicyDefinitionVersionsOperations
-from ._operations import PolicySetDefinitionsOperations
-from ._operations import PolicySetDefinitionVersionsOperations
-from ._operations import PolicyAssignmentsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PolicyDefinitionsOperations # type: ignore
+from ._operations import PolicyDefinitionVersionsOperations # type: ignore
+from ._operations import PolicySetDefinitionsOperations # type: ignore
+from ._operations import PolicySetDefinitionVersionsOperations # type: ignore
+from ._operations import PolicyAssignmentsOperations # 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__ = [
@@ -23,5 +29,5 @@
"PolicySetDefinitionVersionsOperations",
"PolicyAssignmentsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/_operations.py
index ce05a369f40c..eb4f0ca3309b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2023_04_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -868,7 +868,7 @@ def build_policy_set_definitions_delete_request( # pylint: disable=name-too-lon
def build_policy_set_definitions_get_request(
- policy_set_definition_name: str, subscription_id: str, **kwargs: Any
+ policy_set_definition_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -894,6 +894,8 @@ def build_policy_set_definitions_get_request(
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -903,7 +905,7 @@ def build_policy_set_definitions_get_request(
def build_policy_set_definitions_get_built_in_request( # pylint: disable=name-too-long
- policy_set_definition_name: str, **kwargs: Any
+ policy_set_definition_name: str, *, expand: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -927,6 +929,8 @@ def build_policy_set_definitions_get_built_in_request( # pylint: disable=name-t
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -936,7 +940,12 @@ def build_policy_set_definitions_get_built_in_request( # pylint: disable=name-t
def build_policy_set_definitions_list_request( # pylint: disable=name-too-long
- subscription_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -958,6 +967,8 @@ def build_policy_set_definitions_list_request( # pylint: disable=name-too-long
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -968,7 +979,7 @@ def build_policy_set_definitions_list_request( # pylint: disable=name-too-long
def build_policy_set_definitions_list_built_in_request( # pylint: disable=name-too-long
- *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ *, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -983,6 +994,8 @@ def build_policy_set_definitions_list_built_in_request( # pylint: disable=name-
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -1066,7 +1079,7 @@ def build_policy_set_definitions_delete_at_management_group_request( # pylint:
def build_policy_set_definitions_get_at_management_group_request( # pylint: disable=name-too-long
- management_group_id: str, policy_set_definition_name: str, **kwargs: Any
+ management_group_id: str, policy_set_definition_name: str, *, expand: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1092,6 +1105,8 @@ def build_policy_set_definitions_get_at_management_group_request( # pylint: dis
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -1101,7 +1116,12 @@ def build_policy_set_definitions_get_at_management_group_request( # pylint: dis
def build_policy_set_definitions_list_by_management_group_request( # pylint: disable=name-too-long
- management_group_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ management_group_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1124,6 +1144,8 @@ def build_policy_set_definitions_list_by_management_group_request( # pylint: di
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -1294,7 +1316,12 @@ def build_policy_set_definition_versions_delete_request( # pylint: disable=name
def build_policy_set_definition_versions_get_request( # pylint: disable=name-too-long
- policy_set_definition_name: str, policy_definition_version: str, subscription_id: str, **kwargs: Any
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ subscription_id: str,
+ *,
+ expand: Optional[str] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1323,6 +1350,8 @@ def build_policy_set_definition_versions_get_request( # pylint: disable=name-to
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -1332,7 +1361,7 @@ def build_policy_set_definition_versions_get_request( # pylint: disable=name-to
def build_policy_set_definition_versions_get_built_in_request( # pylint: disable=name-too-long
- policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ policy_set_definition_name: str, policy_definition_version: str, *, expand: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1360,6 +1389,8 @@ def build_policy_set_definition_versions_get_built_in_request( # pylint: disabl
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -1369,7 +1400,12 @@ def build_policy_set_definition_versions_get_built_in_request( # pylint: disabl
def build_policy_set_definition_versions_list_request( # pylint: disable=name-too-long
- policy_set_definition_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any
+ policy_set_definition_name: str,
+ subscription_id: str,
+ *,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1396,6 +1432,8 @@ def build_policy_set_definition_versions_list_request( # pylint: disable=name-t
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -1406,7 +1444,7 @@ def build_policy_set_definition_versions_list_request( # pylint: disable=name-t
def build_policy_set_definition_versions_list_built_in_request( # pylint: disable=name-too-long
- policy_set_definition_name: str, *, top: Optional[int] = None, **kwargs: Any
+ policy_set_definition_name: str, *, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1431,6 +1469,8 @@ def build_policy_set_definition_versions_list_built_in_request( # pylint: disab
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -1524,7 +1564,12 @@ def build_policy_set_definition_versions_delete_at_management_group_request( #
def build_policy_set_definition_versions_get_at_management_group_request( # pylint: disable=name-too-long
- management_group_name: str, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ management_group_name: str,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ *,
+ expand: Optional[str] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1555,6 +1600,8 @@ def build_policy_set_definition_versions_get_at_management_group_request( # pyl
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -1564,7 +1611,12 @@ def build_policy_set_definition_versions_get_at_management_group_request( # pyl
def build_policy_set_definition_versions_list_by_management_group_request( # pylint: disable=name-too-long
- management_group_name: str, policy_set_definition_name: str, *, top: Optional[int] = None, **kwargs: Any
+ management_group_name: str,
+ policy_set_definition_name: str,
+ *,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1593,6 +1645,8 @@ def build_policy_set_definition_versions_list_by_management_group_request( # py
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
@@ -1663,7 +1717,9 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name:
return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
-def build_policy_assignments_get_request(scope: str, policy_assignment_name: str, **kwargs: Any) -> HttpRequest:
+def build_policy_assignments_get_request(
+ scope: str, policy_assignment_name: str, *, expand: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1684,6 +1740,8 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -1729,6 +1787,7 @@ def build_policy_assignments_list_for_resource_group_request( # pylint: disable
subscription_id: str,
*,
filter: Optional[str] = None,
+ expand: Optional[str] = None,
top: Optional[int] = None,
**kwargs: Any,
) -> HttpRequest:
@@ -1755,6 +1814,8 @@ def build_policy_assignments_list_for_resource_group_request( # pylint: disable
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -1774,6 +1835,7 @@ def build_policy_assignments_list_for_resource_request( # pylint: disable=name-
subscription_id: str,
*,
filter: Optional[str] = None,
+ expand: Optional[str] = None,
top: Optional[int] = None,
**kwargs: Any,
) -> HttpRequest:
@@ -1804,6 +1866,8 @@ def build_policy_assignments_list_for_resource_request( # pylint: disable=name-
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -1815,7 +1879,12 @@ def build_policy_assignments_list_for_resource_request( # pylint: disable=name-
def build_policy_assignments_list_for_management_group_request( # pylint: disable=name-too-long
- management_group_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ management_group_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1837,6 +1906,8 @@ def build_policy_assignments_list_for_management_group_request( # pylint: disab
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -1848,7 +1919,12 @@ def build_policy_assignments_list_for_management_group_request( # pylint: disab
def build_policy_assignments_list_request(
- subscription_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1869,6 +1945,8 @@ def build_policy_assignments_list_request(
# Construct parameters
if filter is not None:
_params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True)
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
if top is not None:
_params["$top"] = _SERIALIZER.query("top", top, "int", maximum=1000, minimum=1)
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
@@ -1935,7 +2013,7 @@ def build_policy_assignments_create_by_id_request( # pylint: disable=name-too-l
def build_policy_assignments_get_by_id_request( # pylint: disable=name-too-long
- policy_assignment_id: str, **kwargs: Any
+ policy_assignment_id: str, *, expand: Optional[str] = None, **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
@@ -1952,6 +2030,8 @@ def build_policy_assignments_get_by_id_request( # pylint: disable=name-too-long
_url: str = _url.format(**path_format_arguments) # type: ignore
# Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
@@ -2079,7 +2159,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2146,7 +2226,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,
@@ -2195,7 +2275,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2248,7 +2328,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2370,7 +2450,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2439,7 +2519,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2493,7 +2573,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2574,7 +2654,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2671,7 +2751,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2775,7 +2855,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2869,7 +2949,7 @@ def list_all_builtins(self, **kwargs: Any) -> _models.PolicyDefinitionVersionLis
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2924,7 +3004,7 @@ def list_all_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2975,7 +3055,7 @@ def list_all(self, **kwargs: Any) -> _models.PolicyDefinitionVersionListResult:
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3104,7 +3184,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3177,7 +3257,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,
@@ -3234,7 +3314,7 @@ def get(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3294,7 +3374,7 @@ def get_built_in(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3436,7 +3516,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3511,7 +3591,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3571,7 +3651,7 @@ def get_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3639,7 +3719,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3727,7 +3807,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3817,7 +3897,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3971,7 +4051,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4038,7 +4118,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,
@@ -4076,7 +4156,9 @@ def delete( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@distributed_trace
- def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicySetDefinition:
+ def get(
+ self, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicySetDefinition:
"""Retrieves a policy set definition.
This operation retrieves the policy set definition in the given subscription with the given
@@ -4084,11 +4166,15 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4105,6 +4191,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
_request = build_policy_set_definitions_get_request(
policy_set_definition_name=policy_set_definition_name,
subscription_id=self._config.subscription_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -4130,18 +4217,24 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS
return deserialized # type: ignore
@distributed_trace
- def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicySetDefinition:
+ def get_built_in(
+ self, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicySetDefinition:
"""Retrieves a built in policy set definition.
This operation retrieves the built-in policy set definition with the given name.
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4157,6 +4250,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
_request = build_policy_set_definitions_get_built_in_request(
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -4183,7 +4277,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model
@distributed_trace
def list(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> Iterable["_models.PolicySetDefinition"]:
"""Retrieves the policy set definitions for a subscription.
@@ -4207,6 +4301,10 @@ def list(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4221,7 +4319,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4235,6 +4333,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_request(
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4285,7 +4384,7 @@ def get_next(next_link=None):
@distributed_trace
def list_built_in(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> Iterable["_models.PolicySetDefinition"]:
"""Retrieves built-in policy set definitions.
@@ -4302,6 +4401,10 @@ def list_built_in(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4316,7 +4419,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4329,6 +4432,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_built_in_request(
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4460,7 +4564,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4530,7 +4634,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4569,7 +4673,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
@distributed_trace
def get_at_management_group(
- self, management_group_id: str, policy_set_definition_name: str, **kwargs: Any
+ self, management_group_id: str, policy_set_definition_name: str, expand: Optional[str] = None, **kwargs: Any
) -> _models.PolicySetDefinition:
"""Retrieves a policy set definition.
@@ -4580,11 +4684,15 @@ def get_at_management_group(
:type management_group_id: str
:param policy_set_definition_name: The name of the policy set definition to get. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinition or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinition
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4601,6 +4709,7 @@ def get_at_management_group(
_request = build_policy_set_definitions_get_at_management_group_request(
management_group_id=management_group_id,
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -4627,7 +4736,12 @@ def get_at_management_group(
@distributed_trace
def list_by_management_group(
- self, management_group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_id: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> Iterable["_models.PolicySetDefinition"]:
"""Retrieves all policy set definitions in management group.
@@ -4654,6 +4768,10 @@ def list_by_management_group(
$filter='category -eq {value}' is provided, the returned list only includes all policy set
definitions whose category match the {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -4668,7 +4786,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4682,6 +4800,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definitions_list_by_management_group_request(
management_group_id=management_group_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -4762,7 +4881,7 @@ def list_all_builtins(self, **kwargs: Any) -> _models.PolicySetDefinitionVersion
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4817,7 +4936,7 @@ def list_all_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4868,7 +4987,7 @@ def list_all(self, **kwargs: Any) -> _models.PolicySetDefinitionVersionListResul
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4997,7 +5116,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5070,7 +5189,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,
@@ -5110,7 +5229,11 @@ def delete( # pylint: disable=inconsistent-return-statements
@distributed_trace
def get(
- self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any,
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a policy set definition version.
@@ -5123,11 +5246,15 @@ def get(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5145,6 +5272,7 @@ def get(
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
subscription_id=self._config.subscription_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -5171,7 +5299,11 @@ def get(
@distributed_trace
def get_built_in(
- self, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any,
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a built in policy set definition version.
@@ -5184,11 +5316,15 @@ def get_built_in(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5205,6 +5341,7 @@ def get_built_in(
_request = build_policy_set_definition_versions_get_built_in_request(
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -5231,7 +5368,7 @@ def get_built_in(
@distributed_trace
def list(
- self, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self, policy_set_definition_name: str, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> Iterable["_models.PolicySetDefinitionVersion"]:
"""Retrieves the policy set definition versions for a given policy set definition in a
subscription.
@@ -5241,6 +5378,10 @@ def list(
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -5256,7 +5397,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5270,6 +5411,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_request(
policy_set_definition_name=policy_set_definition_name,
subscription_id=self._config.subscription_id,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -5320,7 +5462,7 @@ def get_next(next_link=None):
@distributed_trace
def list_built_in(
- self, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self, policy_set_definition_name: str, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> Iterable["_models.PolicySetDefinitionVersion"]:
"""Retrieves built-in policy set definition versions.
@@ -5329,6 +5471,10 @@ def list_built_in(
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -5344,7 +5490,7 @@ def list_built_in(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5357,6 +5503,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_built_in_request(
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -5506,7 +5653,7 @@ def create_or_update_at_management_group(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5582,7 +5729,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5622,7 +5769,12 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement
@distributed_trace
def get_at_management_group(
- self, management_group_name: str, policy_set_definition_name: str, policy_definition_version: str, **kwargs: Any
+ self,
+ management_group_name: str,
+ policy_set_definition_name: str,
+ policy_definition_version: str,
+ expand: Optional[str] = None,
+ **kwargs: Any,
) -> _models.PolicySetDefinitionVersion:
"""Retrieves a policy set definition version.
@@ -5638,11 +5790,15 @@ def get_at_management_group(
x is the major version number, y is the minor version number, and z is the patch number.
Required.
:type policy_definition_version: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicySetDefinitionVersion or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicySetDefinitionVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5660,6 +5816,7 @@ def get_at_management_group(
management_group_name=management_group_name,
policy_set_definition_name=policy_set_definition_name,
policy_definition_version=policy_definition_version,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -5686,7 +5843,12 @@ def get_at_management_group(
@distributed_trace
def list_by_management_group(
- self, management_group_name: str, policy_set_definition_name: str, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_name: str,
+ policy_set_definition_name: str,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> Iterable["_models.PolicySetDefinitionVersion"]:
"""Retrieves all policy set definition versions for a given policy set definition in a management
group.
@@ -5699,6 +5861,10 @@ def list_by_management_group(
:type management_group_name: str
:param policy_set_definition_name: The name of the policy set definition. Required.
:type policy_set_definition_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -5714,7 +5880,7 @@ def list_by_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicySetDefinitionVersionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5728,6 +5894,7 @@ def prepare_request(next_link=None):
_request = build_policy_set_definition_versions_list_by_management_group_request(
management_group_name=management_group_name,
policy_set_definition_name=policy_set_definition_name,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -5799,6 +5966,7 @@ def __init__(self, *args, **kwargs):
@distributed_trace
def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]:
+ # pylint: disable=line-too-long
"""Deletes a policy assignment.
This operation deletes a policy assignment, given its name and the scope it was created in. The
@@ -5818,7 +5986,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5871,6 +6039,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -5906,6 +6075,7 @@ def create(
content_type: str = "application/json",
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -5939,6 +6109,7 @@ def create(
parameters: Union[_models.PolicyAssignment, IO[bytes]],
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Creates or updates a policy assignment.
This operation creates or updates a policy assignment with the given scope and name. Policy
@@ -5961,7 +6132,7 @@ def create(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6015,7 +6186,10 @@ def create(
return deserialized # type: ignore
@distributed_trace
- def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment:
+ def get(
+ self, scope: str, policy_assignment_name: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Retrieves a policy assignment.
This operation retrieves a single policy assignment, given its name and the scope it was
@@ -6030,11 +6204,15 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
:type scope: str
:param policy_assignment_name: The name of the policy assignment to get. Required.
:type policy_assignment_name: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicyAssignment or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6051,6 +6229,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models
_request = build_policy_assignments_get_request(
scope=scope,
policy_assignment_name=policy_assignment_name,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -6085,6 +6264,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -6120,6 +6300,7 @@ def update(
content_type: str = "application/json",
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -6153,6 +6334,7 @@ def update(
parameters: Union[_models.PolicyAssignmentUpdate, IO[bytes]],
**kwargs: Any,
) -> _models.PolicyAssignment:
+ # pylint: disable=line-too-long
"""Updates a policy assignment.
This operation updates a policy assignment with the given scope and name. Policy assignments
@@ -6176,7 +6358,7 @@ def update(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6231,7 +6413,12 @@ def update(
@distributed_trace
def list_for_resource_group(
- self, resource_group_name: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ resource_group_name: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> Iterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a resource group.
@@ -6260,6 +6447,10 @@ def list_for_resource_group(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -6274,7 +6465,7 @@ def list_for_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6289,6 +6480,7 @@ def prepare_request(next_link=None):
resource_group_name=resource_group_name,
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -6346,6 +6538,7 @@ def list_for_resource(
resource_type: str,
resource_name: str,
filter: Optional[str] = None,
+ expand: Optional[str] = None,
top: Optional[int] = None,
**kwargs: Any,
) -> Iterable["_models.PolicyAssignment"]:
@@ -6398,6 +6591,10 @@ def list_for_resource(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -6412,7 +6609,7 @@ def list_for_resource(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6431,6 +6628,7 @@ def prepare_request(next_link=None):
resource_name=resource_name,
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -6481,7 +6679,12 @@ def get_next(next_link=None):
@distributed_trace
def list_for_management_group(
- self, management_group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self,
+ management_group_id: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any,
) -> Iterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a management group.
@@ -6505,6 +6708,10 @@ def list_for_management_group(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -6519,7 +6726,7 @@ def list_for_management_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6533,6 +6740,7 @@ def prepare_request(next_link=None):
_request = build_policy_assignments_list_for_management_group_request(
management_group_id=management_group_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -6583,7 +6791,7 @@ def get_next(next_link=None):
@distributed_trace
def list(
- self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> Iterable["_models.PolicyAssignment"]:
"""Retrieves all policy assignments that apply to a subscription.
@@ -6608,6 +6816,10 @@ def list(
$filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy
assignments of the policy definition whose id is {value}. Default value is None.
:type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:param top: Maximum number of records to return. When the $top filter is not provided, it will
return 500 records. Default value is None.
:type top: int
@@ -6622,7 +6834,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01"))
cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6636,6 +6848,7 @@ def prepare_request(next_link=None):
_request = build_policy_assignments_list_request(
subscription_id=self._config.subscription_id,
filter=filter,
+ expand=expand,
top=top,
api_version=api_version,
headers=_headers,
@@ -6703,7 +6916,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment or None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6837,7 +7050,7 @@ def create_by_id(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6890,7 +7103,9 @@ def create_by_id(
return deserialized # type: ignore
@distributed_trace
- def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyAssignment:
+ def get_by_id(
+ self, policy_assignment_id: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.PolicyAssignment:
"""Retrieves the policy assignment with the given ID.
The operation retrieves the policy assignment with the given ID. Policy assignment IDs have
@@ -6905,11 +7120,15 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
:param policy_assignment_id: The ID of the policy assignment to get. Use the format
'{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Required.
:type policy_assignment_id: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Supported values are 'LatestDefinitionVersion, EffectiveDefinitionVersion'. Default value is
+ None.
+ :type expand: str
:return: PolicyAssignment or the result of cls(response)
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6925,6 +7144,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA
_request = build_policy_assignments_get_by_id_request(
policy_assignment_id=policy_assignment_id,
+ expand=expand,
api_version=api_version,
headers=_headers,
params=_params,
@@ -7042,7 +7262,7 @@ def update_by_id(
:rtype: ~azure.mgmt.resource.policy.v2023_04_01.models.PolicyAssignment
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/__init__.py
index 10b87602dc4b..afa2f3e705c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/__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 ._resource_private_link_client import ResourcePrivateLinkClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_private_link_client import ResourcePrivateLinkClient # 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__ = [
"ResourcePrivateLinkClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py
index 6b082e087ea8..8920b8621163 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_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 ResourcePrivateLinkClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourcePrivateLinkClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourcePrivateLinkClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py
index 464816888e3d..15f90e551bfd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py
@@ -21,11 +21,10 @@
from .operations import PrivateLinkAssociationOperations, ResourceManagementPrivateLinkOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourcePrivateLinkClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourcePrivateLinkClient:
"""Provides operations for managing private link resources.
:ivar private_link_association: PrivateLinkAssociationOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/__init__.py
index 0b5585e28fa4..bea0c4df00b3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/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 ._resource_private_link_client import ResourcePrivateLinkClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_private_link_client import ResourcePrivateLinkClient # 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__ = [
"ResourcePrivateLinkClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py
index a73177f0334e..fbb54af88edf 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/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 ResourcePrivateLinkClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourcePrivateLinkClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourcePrivateLinkClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py
index f469dc4e4dca..b157c32ebaa3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py
@@ -21,11 +21,10 @@
from .operations import PrivateLinkAssociationOperations, ResourceManagementPrivateLinkOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourcePrivateLinkClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourcePrivateLinkClient:
"""Provides operations for managing private link resources.
:ivar private_link_association: PrivateLinkAssociationOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/__init__.py
index 3c3a9edb0711..39e87c00bee0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PrivateLinkAssociationOperations
-from ._operations import ResourceManagementPrivateLinkOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PrivateLinkAssociationOperations # type: ignore
+from ._operations import ResourceManagementPrivateLinkOperations # 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__ = [
"PrivateLinkAssociationOperations",
"ResourceManagementPrivateLinkOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py
index 676df9222ee5..695198583d53 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -140,7 +139,7 @@ async def put(
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -205,7 +204,7 @@ async def get(self, group_id: str, pla_id: str, **kwargs: Any) -> _models.Privat
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -247,9 +246,7 @@ async def get(self, group_id: str, pla_id: str, **kwargs: Any) -> _models.Privat
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, group_id: str, pla_id: str, **kwargs: Any
- ) -> None:
+ async def delete(self, group_id: str, pla_id: str, **kwargs: Any) -> None:
"""Delete a PrivateLinkAssociation.
:param group_id: The management group ID. Required.
@@ -260,7 +257,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,
@@ -307,7 +304,7 @@ async def list(self, group_id: str, **kwargs: Any) -> _models.PrivateLinkAssocia
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociationGetResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -447,7 +444,7 @@ async def put(
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -516,7 +513,7 @@ async def get(
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -559,9 +556,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, rmpl_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, rmpl_name: str, **kwargs: Any) -> None:
"""Delete a resource management private link.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -573,7 +568,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,
@@ -620,7 +615,7 @@ async def list(self, **kwargs: Any) -> _models.ResourceManagementPrivateLinkList
~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLinkListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -674,7 +669,7 @@ async def list_by_resource_group(
~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLinkListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/__init__.py
index 2984e2a83dff..f1a9ad64c7a5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/__init__.py
@@ -5,22 +5,33 @@
# 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 ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import PrivateLinkAssociation
-from ._models_py3 import PrivateLinkAssociationGetResult
-from ._models_py3 import PrivateLinkAssociationObject
-from ._models_py3 import PrivateLinkAssociationProperties
-from ._models_py3 import PrivateLinkAssociationPropertiesExpanded
-from ._models_py3 import ResourceManagementPrivateLink
-from ._models_py3 import ResourceManagementPrivateLinkEndpointConnections
-from ._models_py3 import ResourceManagementPrivateLinkListResult
-from ._models_py3 import ResourceManagementPrivateLinkLocation
+from typing import TYPE_CHECKING
-from ._resource_private_link_client_enums import PublicNetworkAccessOptions
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ PrivateLinkAssociation,
+ PrivateLinkAssociationGetResult,
+ PrivateLinkAssociationObject,
+ PrivateLinkAssociationProperties,
+ PrivateLinkAssociationPropertiesExpanded,
+ ResourceManagementPrivateLink,
+ ResourceManagementPrivateLinkEndpointConnections,
+ ResourceManagementPrivateLinkListResult,
+ ResourceManagementPrivateLinkLocation,
+)
+
+from ._resource_private_link_client_enums import ( # type: ignore
+ PublicNetworkAccessOptions,
+)
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__ = [
@@ -37,5 +48,5 @@
"ResourceManagementPrivateLinkLocation",
"PublicNetworkAccessOptions",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/_models_py3.py
index 2f96dc4c65ef..8c87c69c2be6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/__init__.py
index 3c3a9edb0711..39e87c00bee0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import PrivateLinkAssociationOperations
-from ._operations import ResourceManagementPrivateLinkOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import PrivateLinkAssociationOperations # type: ignore
+from ._operations import ResourceManagementPrivateLinkOperations # 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__ = [
"PrivateLinkAssociationOperations",
"ResourceManagementPrivateLinkOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py
index 16fcc5d1c0b1..2c9ddef49d1c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
@@ -30,7 +29,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -418,7 +417,7 @@ def put(
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -483,7 +482,7 @@ def get(self, group_id: str, pla_id: str, **kwargs: Any) -> _models.PrivateLinkA
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -538,7 +537,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,
@@ -585,7 +584,7 @@ def list(self, group_id: str, **kwargs: Any) -> _models.PrivateLinkAssociationGe
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.PrivateLinkAssociationGetResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -725,7 +724,7 @@ def put(
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -792,7 +791,7 @@ def get(self, resource_group_name: str, rmpl_name: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLink
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -849,7 +848,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,
@@ -896,7 +895,7 @@ def list(self, **kwargs: Any) -> _models.ResourceManagementPrivateLinkListResult
~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLinkListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -950,7 +949,7 @@ def list_by_resource_group(
~azure.mgmt.resource.privatelinks.v2020_05_01.models.ResourceManagementPrivateLinkListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py
index 8056a497c527..75c7a8cccd17 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py
@@ -56,7 +56,7 @@ class ResourceManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
- DEFAULT_API_VERSION = '2022-09-01'
+ DEFAULT_API_VERSION = '2024-07-01'
_PROFILE_TAG = "azure.mgmt.resource.resources.ResourceManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
@@ -125,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-01-01: :mod:`v2021_01_01.models`
* 2021-04-01: :mod:`v2021_04_01.models`
* 2022-09-01: :mod:`v2022_09_01.models`
+ * 2024-07-01: :mod:`v2024_07_01.models`
"""
if api_version == '2016-02-01':
from .v2016_02_01 import models
@@ -174,6 +175,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2022-09-01':
from .v2022_09_01 import models
return models
+ elif api_version == '2024-07-01':
+ from .v2024_07_01 import models
+ return models
raise ValueError("API version {} is not available".format(api_version))
@property
@@ -196,6 +200,7 @@ def deployment_operations(self):
* 2021-01-01: :class:`DeploymentOperationsOperations`
* 2021-04-01: :class:`DeploymentOperationsOperations`
* 2022-09-01: :class:`DeploymentOperationsOperations`
+ * 2024-07-01: :class:`DeploymentOperationsOperations`
"""
api_version = self._get_api_version('deployment_operations')
if api_version == '2016-02-01':
@@ -230,6 +235,8 @@ def deployment_operations(self):
from .v2021_04_01.operations import DeploymentOperationsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import DeploymentOperationsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import DeploymentOperationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deployment_operations'".format(api_version))
self._config.api_version = api_version
@@ -255,6 +262,7 @@ def deployments(self):
* 2021-01-01: :class:`DeploymentsOperations`
* 2021-04-01: :class:`DeploymentsOperations`
* 2022-09-01: :class:`DeploymentsOperations`
+ * 2024-07-01: :class:`DeploymentsOperations`
"""
api_version = self._get_api_version('deployments')
if api_version == '2016-02-01':
@@ -289,6 +297,8 @@ def deployments(self):
from .v2021_04_01.operations import DeploymentsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import DeploymentsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import DeploymentsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deployments'".format(api_version))
self._config.api_version = api_version
@@ -310,6 +320,7 @@ def operations(self):
* 2021-01-01: :class:`Operations`
* 2021-04-01: :class:`Operations`
* 2022-09-01: :class:`Operations`
+ * 2024-07-01: :class:`Operations`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-05-01':
@@ -336,6 +347,8 @@ def operations(self):
from .v2021_04_01.operations import Operations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import Operations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
@@ -349,6 +362,7 @@ def provider_resource_types(self):
* 2021-01-01: :class:`ProviderResourceTypesOperations`
* 2021-04-01: :class:`ProviderResourceTypesOperations`
* 2022-09-01: :class:`ProviderResourceTypesOperations`
+ * 2024-07-01: :class:`ProviderResourceTypesOperations`
"""
api_version = self._get_api_version('provider_resource_types')
if api_version == '2020-10-01':
@@ -359,6 +373,8 @@ def provider_resource_types(self):
from .v2021_04_01.operations import ProviderResourceTypesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ProviderResourceTypesOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import ProviderResourceTypesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'provider_resource_types'".format(api_version))
self._config.api_version = api_version
@@ -384,6 +400,7 @@ def providers(self):
* 2021-01-01: :class:`ProvidersOperations`
* 2021-04-01: :class:`ProvidersOperations`
* 2022-09-01: :class:`ProvidersOperations`
+ * 2024-07-01: :class:`ProvidersOperations`
"""
api_version = self._get_api_version('providers')
if api_version == '2016-02-01':
@@ -418,6 +435,8 @@ def providers(self):
from .v2021_04_01.operations import ProvidersOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ProvidersOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import ProvidersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'providers'".format(api_version))
self._config.api_version = api_version
@@ -443,6 +462,7 @@ def resource_groups(self):
* 2021-01-01: :class:`ResourceGroupsOperations`
* 2021-04-01: :class:`ResourceGroupsOperations`
* 2022-09-01: :class:`ResourceGroupsOperations`
+ * 2024-07-01: :class:`ResourceGroupsOperations`
"""
api_version = self._get_api_version('resource_groups')
if api_version == '2016-02-01':
@@ -477,6 +497,8 @@ def resource_groups(self):
from .v2021_04_01.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ResourceGroupsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import ResourceGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'resource_groups'".format(api_version))
self._config.api_version = api_version
@@ -502,6 +524,7 @@ def resources(self):
* 2021-01-01: :class:`ResourcesOperations`
* 2021-04-01: :class:`ResourcesOperations`
* 2022-09-01: :class:`ResourcesOperations`
+ * 2024-07-01: :class:`ResourcesOperations`
"""
api_version = self._get_api_version('resources')
if api_version == '2016-02-01':
@@ -536,6 +559,8 @@ def resources(self):
from .v2021_04_01.operations import ResourcesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ResourcesOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import ResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'resources'".format(api_version))
self._config.api_version = api_version
@@ -561,6 +586,7 @@ def tags(self):
* 2021-01-01: :class:`TagsOperations`
* 2021-04-01: :class:`TagsOperations`
* 2022-09-01: :class:`TagsOperations`
+ * 2024-07-01: :class:`TagsOperations`
"""
api_version = self._get_api_version('tags')
if api_version == '2016-02-01':
@@ -595,6 +621,8 @@ def tags(self):
from .v2021_04_01.operations import TagsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import TagsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from .v2024_07_01.operations import TagsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'tags'".format(api_version))
self._config.api_version = api_version
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py
index 36d3f728696c..87e6487a4ddd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py
@@ -56,7 +56,7 @@ class ResourceManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
- DEFAULT_API_VERSION = '2022-09-01'
+ DEFAULT_API_VERSION = '2024-07-01'
_PROFILE_TAG = "azure.mgmt.resource.resources.ResourceManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
@@ -125,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-01-01: :mod:`v2021_01_01.models`
* 2021-04-01: :mod:`v2021_04_01.models`
* 2022-09-01: :mod:`v2022_09_01.models`
+ * 2024-07-01: :mod:`v2024_07_01.models`
"""
if api_version == '2016-02-01':
from ..v2016_02_01 import models
@@ -174,6 +175,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2022-09-01':
from ..v2022_09_01 import models
return models
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01 import models
+ return models
raise ValueError("API version {} is not available".format(api_version))
@property
@@ -196,6 +200,7 @@ def deployment_operations(self):
* 2021-01-01: :class:`DeploymentOperationsOperations`
* 2021-04-01: :class:`DeploymentOperationsOperations`
* 2022-09-01: :class:`DeploymentOperationsOperations`
+ * 2024-07-01: :class:`DeploymentOperationsOperations`
"""
api_version = self._get_api_version('deployment_operations')
if api_version == '2016-02-01':
@@ -230,6 +235,8 @@ def deployment_operations(self):
from ..v2021_04_01.aio.operations import DeploymentOperationsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import DeploymentOperationsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import DeploymentOperationsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deployment_operations'".format(api_version))
self._config.api_version = api_version
@@ -255,6 +262,7 @@ def deployments(self):
* 2021-01-01: :class:`DeploymentsOperations`
* 2021-04-01: :class:`DeploymentsOperations`
* 2022-09-01: :class:`DeploymentsOperations`
+ * 2024-07-01: :class:`DeploymentsOperations`
"""
api_version = self._get_api_version('deployments')
if api_version == '2016-02-01':
@@ -289,6 +297,8 @@ def deployments(self):
from ..v2021_04_01.aio.operations import DeploymentsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import DeploymentsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import DeploymentsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deployments'".format(api_version))
self._config.api_version = api_version
@@ -310,6 +320,7 @@ def operations(self):
* 2021-01-01: :class:`Operations`
* 2021-04-01: :class:`Operations`
* 2022-09-01: :class:`Operations`
+ * 2024-07-01: :class:`Operations`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-05-01':
@@ -336,6 +347,8 @@ def operations(self):
from ..v2021_04_01.aio.operations import Operations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import Operations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
@@ -349,6 +362,7 @@ def provider_resource_types(self):
* 2021-01-01: :class:`ProviderResourceTypesOperations`
* 2021-04-01: :class:`ProviderResourceTypesOperations`
* 2022-09-01: :class:`ProviderResourceTypesOperations`
+ * 2024-07-01: :class:`ProviderResourceTypesOperations`
"""
api_version = self._get_api_version('provider_resource_types')
if api_version == '2020-10-01':
@@ -359,6 +373,8 @@ def provider_resource_types(self):
from ..v2021_04_01.aio.operations import ProviderResourceTypesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ProviderResourceTypesOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import ProviderResourceTypesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'provider_resource_types'".format(api_version))
self._config.api_version = api_version
@@ -384,6 +400,7 @@ def providers(self):
* 2021-01-01: :class:`ProvidersOperations`
* 2021-04-01: :class:`ProvidersOperations`
* 2022-09-01: :class:`ProvidersOperations`
+ * 2024-07-01: :class:`ProvidersOperations`
"""
api_version = self._get_api_version('providers')
if api_version == '2016-02-01':
@@ -418,6 +435,8 @@ def providers(self):
from ..v2021_04_01.aio.operations import ProvidersOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ProvidersOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import ProvidersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'providers'".format(api_version))
self._config.api_version = api_version
@@ -443,6 +462,7 @@ def resource_groups(self):
* 2021-01-01: :class:`ResourceGroupsOperations`
* 2021-04-01: :class:`ResourceGroupsOperations`
* 2022-09-01: :class:`ResourceGroupsOperations`
+ * 2024-07-01: :class:`ResourceGroupsOperations`
"""
api_version = self._get_api_version('resource_groups')
if api_version == '2016-02-01':
@@ -477,6 +497,8 @@ def resource_groups(self):
from ..v2021_04_01.aio.operations import ResourceGroupsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ResourceGroupsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import ResourceGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'resource_groups'".format(api_version))
self._config.api_version = api_version
@@ -502,6 +524,7 @@ def resources(self):
* 2021-01-01: :class:`ResourcesOperations`
* 2021-04-01: :class:`ResourcesOperations`
* 2022-09-01: :class:`ResourcesOperations`
+ * 2024-07-01: :class:`ResourcesOperations`
"""
api_version = self._get_api_version('resources')
if api_version == '2016-02-01':
@@ -536,6 +559,8 @@ def resources(self):
from ..v2021_04_01.aio.operations import ResourcesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ResourcesOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import ResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'resources'".format(api_version))
self._config.api_version = api_version
@@ -561,6 +586,7 @@ def tags(self):
* 2021-01-01: :class:`TagsOperations`
* 2021-04-01: :class:`TagsOperations`
* 2022-09-01: :class:`TagsOperations`
+ * 2024-07-01: :class:`TagsOperations`
"""
api_version = self._get_api_version('tags')
if api_version == '2016-02-01':
@@ -595,6 +621,8 @@ def tags(self):
from ..v2021_04_01.aio.operations import TagsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import TagsOperations as OperationClass
+ elif api_version == '2024-07-01':
+ from ..v2024_07_01.aio.operations import TagsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'tags'".format(api_version))
self._config.api_version = api_version
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py
index 26e6ab083a79..81014b4b9ee0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/models.py
@@ -4,4 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
-from .v2022_09_01.models import *
+from .v2024_07_01.models import *
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_configuration.py
index bd866a5a40c9..87d026e1f6e2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py
index 0a742cadfb34..ffd9d06eff8c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""ResourceManagementClient.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_configuration.py
index 09923df96b52..60cf7e6fb1e3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py
index 49ccc917882e..47ceadc0a788 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""ResourceManagementClient.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/__init__.py
index 6575e1ca984d..11a7ff572a6c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import ResourcesOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py
index 2d8e0cbeef61..96500502a37f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -73,7 +73,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -102,7 +102,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -215,7 +215,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -261,7 +261,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -462,7 +462,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -505,9 +505,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancel a currently running template deployment.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -519,7 +517,7 @@ async def cancel( # 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,
@@ -633,7 +631,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -702,7 +700,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -768,7 +766,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -841,7 +839,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -916,7 +914,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -967,7 +965,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1030,7 +1028,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1107,7 +1105,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1179,6 +1177,7 @@ def list_resources(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all of the resources under a subscription.
:param resource_group_name: Query parameters. If null is passed returns all resource groups.
@@ -1205,7 +1204,7 @@ def list_resources(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1280,7 +1279,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1376,7 +1375,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1430,7 +1429,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1537,7 +1536,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1645,7 +1644,7 @@ async def patch(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1757,7 +1756,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1832,7 +1831,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1918,7 +1917,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2087,6 +2086,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all of the resources under a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -2110,7 +2110,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2203,7 +2203,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2245,7 +2245,7 @@ async def check_existence(
return 200 <= response.status_code <= 299
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self,
resource_group_name: str,
resource_provider_namespace: str,
@@ -2274,7 +2274,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,
@@ -2427,7 +2427,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2494,7 +2494,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2753,7 +2753,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2819,9 +2819,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Delete a subscription resource tag value.
:param tag_name: The name of the tag. Required.
@@ -2832,7 +2830,7 @@ async def delete_value( # 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,
@@ -2882,7 +2880,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2934,7 +2932,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2976,7 +2974,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Delete a subscription resource tag.
:param tag_name: The name of the tag. Required.
@@ -2985,7 +2983,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3037,7 +3035,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3135,7 +3133,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3202,7 +3200,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py
index 97827bbfe579..14d35ff2d1b7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/__init__.py
@@ -5,59 +5,70 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+)
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__ = [
@@ -111,5 +122,5 @@
"TemplateLink",
"DeploymentMode",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py
index e70c49bd910b..5fc45a79fb93 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -16,10 +16,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -535,7 +534,7 @@ def __init__(
self.debug_setting = debug_setting
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -838,7 +837,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -927,7 +926,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/__init__.py
index 6575e1ca984d..11a7ff572a6c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import ResourcesOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py
index bbf987ef770c..912ad7b87f96 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1170,7 +1170,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1283,7 +1283,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1329,7 +1329,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1530,7 +1530,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1587,7 +1587,7 @@ def cancel( # 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,
@@ -1701,7 +1701,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1770,7 +1770,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1836,7 +1836,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1909,7 +1909,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1984,7 +1984,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2035,7 +2035,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2098,7 +2098,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2173,7 +2173,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2271,7 +2271,7 @@ def list_resources(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2346,7 +2346,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2442,7 +2442,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2496,7 +2496,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2603,7 +2603,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2711,7 +2711,7 @@ def patch(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2823,7 +2823,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2898,7 +2898,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2984,7 +2984,7 @@ def __init__(self, *args, **kwargs):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3176,7 +3176,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3269,7 +3269,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3340,7 +3340,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,
@@ -3493,7 +3493,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3560,7 +3560,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3819,7 +3819,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3898,7 +3898,7 @@ def delete_value( # 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,
@@ -3948,7 +3948,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4000,7 +4000,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4051,7 +4051,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4103,7 +4103,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4201,7 +4201,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2016_02_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4268,7 +4268,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_configuration.py
index 3c59f57eae0d..67bfbf75c176 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py
index c71d5c4ddcc1..6a9d7abfa7fb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_configuration.py
index f60f72f439bf..c20fb6382b2e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py
index 663f3bed55f7..c2e21cd6ae14 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/__init__.py
index 6575e1ca984d..11a7ff572a6c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import ResourcesOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py
index 29b536537661..2ee1ac3252e8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -78,7 +78,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -107,7 +107,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -229,7 +229,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -275,7 +275,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -482,7 +482,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -525,9 +525,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -544,7 +542,7 @@ async def cancel( # 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,
@@ -661,7 +659,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -730,7 +728,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExportResult
: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 list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -871,7 +869,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -947,7 +945,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -999,7 +997,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1064,7 +1062,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1141,7 +1139,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1213,6 +1211,7 @@ def list_resources(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -1238,7 +1237,7 @@ def list_resources(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1313,7 +1312,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1407,7 +1406,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1461,7 +1460,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1571,7 +1570,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1683,7 +1682,7 @@ async def patch(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1793,7 +1792,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1868,7 +1867,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1954,7 +1953,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2138,6 +2137,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -2161,7 +2161,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2254,7 +2254,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2305,7 +2305,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2437,7 +2437,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2677,7 +2677,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2936,7 +2936,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2982,6 +2982,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2995,7 +2996,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3032,7 +3033,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3078,6 +3079,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3132,7 +3134,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3198,6 +3200,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3229,6 +3232,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3254,6 +3258,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3321,7 +3326,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3387,6 +3392,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3418,6 +3424,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3443,6 +3450,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3509,6 +3517,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3522,7 +3531,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3583,9 +3592,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -3596,7 +3603,7 @@ async def delete_value( # 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,
@@ -3646,7 +3653,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3702,7 +3709,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3744,7 +3751,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -3755,7 +3762,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3807,7 +3814,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3905,7 +3912,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3972,7 +3979,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py
index 7eb1a47e67ce..70b93b0209b6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/__init__.py
@@ -5,60 +5,71 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+)
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__ = [
@@ -113,5 +124,5 @@
"ZoneMapping",
"DeploymentMode",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py
index 1486ff81aab4..019dc4d7dcc4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -550,7 +549,7 @@ def __init__(
self.debug_setting = debug_setting
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -849,7 +848,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -939,7 +938,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/__init__.py
index 6575e1ca984d..11a7ff572a6c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import ResourcesOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py
index 0bbecb0a7fae..550f54e01384 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1301,7 +1301,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1423,7 +1423,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1469,7 +1469,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1676,7 +1676,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1738,7 +1738,7 @@ def cancel( # 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,
@@ -1855,7 +1855,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1924,7 +1924,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1992,7 +1992,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2065,7 +2065,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2141,7 +2141,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2193,7 +2193,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2258,7 +2258,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2333,7 +2333,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2430,7 +2430,7 @@ def list_resources(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2505,7 +2505,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2599,7 +2599,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2653,7 +2653,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2763,7 +2763,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2875,7 +2875,7 @@ def patch(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2985,7 +2985,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3060,7 +3060,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3146,7 +3146,7 @@ def __init__(self, *args, **kwargs):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3353,7 +3353,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3446,7 +3446,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3497,7 +3497,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3629,7 +3629,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3869,7 +3869,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4128,7 +4128,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4174,6 +4174,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4187,7 +4188,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4224,7 +4225,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4270,6 +4271,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4324,7 +4326,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4390,6 +4392,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4421,6 +4424,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4446,6 +4450,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4513,7 +4518,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4579,6 +4584,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4610,6 +4616,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4635,6 +4642,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4701,6 +4709,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4714,7 +4723,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4788,7 +4797,7 @@ def delete_value( # 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,
@@ -4838,7 +4847,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4894,7 +4903,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4947,7 +4956,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4999,7 +5008,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5097,7 +5106,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2016_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5164,7 +5173,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_configuration.py
index fc382ca0098d..22a6dfc66a5e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py
index 162985bbadbf..5b1f8d9708b9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_configuration.py
index fa755db31a9f..9650bf3db095 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py
index 0cdc9fba87cb..dfcea1ba87bc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/__init__.py
index 341afb220882..c471a197f624 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py
index 2109b613e546..71d70190da61 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -79,7 +79,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -108,7 +108,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -230,7 +230,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -276,7 +276,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -483,7 +483,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -526,9 +526,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -545,7 +543,7 @@ async def cancel( # 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,
@@ -662,7 +660,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -731,7 +729,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -799,7 +797,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -872,7 +870,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -948,7 +946,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1000,7 +998,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1065,7 +1063,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1142,7 +1140,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1214,6 +1212,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -1239,7 +1238,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1306,7 +1305,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1489,7 +1488,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1679,6 +1678,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -1702,7 +1702,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1795,7 +1795,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1846,7 +1846,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1978,7 +1978,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2218,7 +2218,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2477,7 +2477,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2523,6 +2523,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2536,7 +2537,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2573,7 +2574,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2619,6 +2620,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2673,7 +2675,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2739,6 +2741,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2770,6 +2773,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2795,6 +2799,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2862,7 +2867,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2928,6 +2933,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2959,6 +2965,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2984,6 +2991,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3050,6 +3058,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3063,7 +3072,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3134,7 +3143,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3228,7 +3237,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3291,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3392,7 +3401,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3505,7 +3514,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3615,7 +3624,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3690,7 +3699,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3774,9 +3783,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -3787,7 +3794,7 @@ async def delete_value( # 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,
@@ -3837,7 +3844,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3893,7 +3900,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3935,7 +3942,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -3946,7 +3953,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3998,7 +4005,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4096,7 +4103,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4163,7 +4170,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py
index 21f51217dbfa..b1e2de85fa67 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/__init__.py
@@ -5,61 +5,72 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+)
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__ = [
@@ -115,5 +126,5 @@
"ZoneMapping",
"DeploymentMode",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py
index 5cebcd68fd02..40a4e38cc620 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -550,7 +549,7 @@ def __init__(
self.debug_setting = debug_setting
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -849,7 +848,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -939,7 +938,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/__init__.py
index 341afb220882..c471a197f624 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py
index 44512556f4b3..ea917d48d1b0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1337,7 +1337,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1459,7 +1459,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1505,7 +1505,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1712,7 +1712,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1774,7 +1774,7 @@ def cancel( # 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,
@@ -1891,7 +1891,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1960,7 +1960,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2028,7 +2028,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2101,7 +2101,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2177,7 +2177,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2229,7 +2229,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2294,7 +2294,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2369,7 +2369,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2466,7 +2466,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2533,7 +2533,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2716,7 +2716,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2929,7 +2929,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3022,7 +3022,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3073,7 +3073,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3205,7 +3205,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3445,7 +3445,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3704,7 +3704,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3750,6 +3750,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3763,7 +3764,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3800,7 +3801,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3846,6 +3847,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3900,7 +3902,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3966,6 +3968,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3997,6 +4000,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4022,6 +4026,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4089,7 +4094,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4155,6 +4160,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4186,6 +4192,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4211,6 +4218,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4277,6 +4285,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4290,7 +4299,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4361,7 +4370,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4455,7 +4464,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4509,7 +4518,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4619,7 +4628,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4732,7 +4741,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4842,7 +4851,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4917,7 +4926,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5014,7 +5023,7 @@ def delete_value( # 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,
@@ -5064,7 +5073,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5120,7 +5129,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5173,7 +5182,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5225,7 +5234,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5323,7 +5332,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2017_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5390,7 +5399,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_configuration.py
index 4ec889fc54d8..c0338373e896 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py
index 0b2120d98b31..1b916a267e40 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_configuration.py
index 2d3f686350e0..8e70450fa197 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py
index daae3d2bc670..81b55872ec8e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py
@@ -28,11 +28,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword
+class ResourceManagementClient:
"""Provides operations for working with resources and resource groups.
:ivar deployments: DeploymentsOperations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/__init__.py
index 341afb220882..c471a197f624 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py
index bb9d337901db..693c2a1ec2e1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -79,7 +79,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -108,7 +108,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -230,7 +230,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -276,7 +276,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -483,7 +483,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -526,9 +526,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -545,7 +543,7 @@ async def cancel( # 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,
@@ -662,7 +660,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -731,7 +729,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -799,7 +797,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -872,7 +870,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -948,7 +946,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1000,7 +998,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1065,7 +1063,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1142,7 +1140,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1214,6 +1212,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -1239,7 +1238,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1306,7 +1305,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1489,7 +1488,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1679,6 +1678,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation. Default value is None.
@@ -1700,7 +1700,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1793,7 +1793,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1844,7 +1844,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1976,7 +1976,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2216,7 +2216,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2475,7 +2475,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2521,6 +2521,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2534,7 +2535,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2571,7 +2572,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2617,6 +2618,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2671,7 +2673,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2737,6 +2739,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2768,6 +2771,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2793,6 +2797,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2860,7 +2865,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2926,6 +2931,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2957,6 +2963,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -2982,6 +2989,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3048,6 +3056,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3061,7 +3070,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3132,7 +3141,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3226,7 +3235,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3280,7 +3289,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3390,7 +3399,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3503,7 +3512,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3613,7 +3622,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3688,7 +3697,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3772,9 +3781,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -3785,7 +3792,7 @@ async def delete_value( # 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,
@@ -3835,7 +3842,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3891,7 +3898,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3933,7 +3940,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -3944,7 +3951,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3996,7 +4003,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4094,7 +4101,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4161,7 +4168,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py
index 29d11429a2d5..dfea7cf2c5f1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/__init__.py
@@ -5,65 +5,76 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+ OnErrorDeploymentType,
+ ResourceIdentityType,
+)
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__ = [
@@ -123,5 +134,5 @@
"OnErrorDeploymentType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py
index 3642eba171f0..54293d999923 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -559,7 +558,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -867,7 +866,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -957,7 +956,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py
index 341afb220882..c471a197f624 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/__init__.py
@@ -5,16 +5,22 @@
# 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 ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -25,5 +31,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py
index a5aa8ced7709..bd4817cd866b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -1337,7 +1337,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1459,7 +1459,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1505,7 +1505,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1712,7 +1712,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1774,7 +1774,7 @@ def cancel( # 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,
@@ -1891,7 +1891,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1960,7 +1960,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2028,7 +2028,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2101,7 +2101,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2177,7 +2177,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2229,7 +2229,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2294,7 +2294,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2369,7 +2369,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2466,7 +2466,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2533,7 +2533,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2716,7 +2716,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2927,7 +2927,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3020,7 +3020,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3071,7 +3071,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3203,7 +3203,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3443,7 +3443,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3702,7 +3702,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3748,6 +3748,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3761,7 +3762,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3798,7 +3799,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3844,6 +3845,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3898,7 +3900,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3964,6 +3966,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3995,6 +3998,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4020,6 +4024,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4087,7 +4092,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4153,6 +4158,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4184,6 +4190,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4209,6 +4216,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4275,6 +4283,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4288,7 +4297,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4359,7 +4368,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4453,7 +4462,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4507,7 +4516,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4617,7 +4626,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4730,7 +4739,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4840,7 +4849,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4915,7 +4924,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5012,7 +5021,7 @@ def delete_value( # 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,
@@ -5062,7 +5071,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5118,7 +5127,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5171,7 +5180,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5223,7 +5232,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5321,7 +5330,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2018_02_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5388,7 +5397,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_configuration.py
index 74146fba7f5f..6112d63e73cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py
index eee2d2900693..01407832dc36 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_configuration.py
index 9b83aec03065..116c5820aee1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py
index 6215acf10b94..23765007756b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py
index 35dcaa3a987c..02e8eba8eba9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -90,7 +90,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -131,7 +131,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -212,7 +212,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -325,7 +325,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -366,7 +366,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -548,7 +548,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -590,9 +590,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -606,7 +604,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -702,7 +700,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -767,7 +765,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -831,7 +829,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -896,7 +894,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1018,7 +1016,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1064,7 +1062,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1271,7 +1269,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1314,9 +1312,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1333,7 +1329,7 @@ async def cancel( # 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,
@@ -1450,7 +1446,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1519,7 +1515,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1587,7 +1583,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1660,7 +1656,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1736,7 +1732,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1788,7 +1784,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1853,7 +1849,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1930,7 +1926,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2002,6 +1998,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -2040,7 +2037,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2107,7 +2104,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2290,7 +2287,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2480,6 +2477,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -2516,7 +2514,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2609,7 +2607,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2660,7 +2658,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2792,7 +2790,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3032,7 +3030,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3291,7 +3289,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3337,6 +3335,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3350,7 +3349,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3387,7 +3386,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3433,6 +3432,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3487,7 +3487,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3553,6 +3553,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3584,6 +3585,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3609,6 +3611,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3676,7 +3679,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3742,6 +3745,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3773,6 +3777,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3798,6 +3803,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3864,6 +3870,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3877,7 +3884,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3948,7 +3955,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4048,7 +4055,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4102,7 +4109,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4212,7 +4219,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4325,7 +4332,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4435,7 +4442,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4512,7 +4519,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4596,9 +4603,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -4609,7 +4614,7 @@ async def delete_value( # 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,
@@ -4659,7 +4664,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4715,7 +4720,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4757,7 +4762,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -4768,7 +4773,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4820,7 +4825,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4915,7 +4920,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4978,7 +4983,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5057,7 +5062,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5124,7 +5129,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py
index df50c93f5041..ab697ee9c480 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/__init__.py
@@ -5,69 +5,80 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+ OnErrorDeploymentType,
+ ResourceIdentityType,
+)
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__ = [
@@ -131,5 +142,5 @@
"OnErrorDeploymentType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py
index 425edbc02f76..536b5d5610cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -608,7 +607,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -916,7 +915,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1006,7 +1005,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py
index 8ce934b37d21..523362f119d7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -1675,7 +1675,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1756,7 +1756,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1869,7 +1869,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1910,7 +1910,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2092,7 +2092,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2150,7 +2150,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2246,7 +2246,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2311,7 +2311,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2375,7 +2375,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2438,7 +2438,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2560,7 +2560,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2606,7 +2606,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2813,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2875,7 +2875,7 @@ def cancel( # 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,
@@ -2992,7 +2992,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3061,7 +3061,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3129,7 +3129,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3202,7 +3202,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3278,7 +3278,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3330,7 +3330,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3395,7 +3395,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3470,7 +3470,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3580,7 +3580,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3647,7 +3647,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3830,7 +3830,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4056,7 +4056,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4149,7 +4149,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4200,7 +4200,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4332,7 +4332,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4572,7 +4572,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4831,7 +4831,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4877,6 +4877,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4890,7 +4891,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4927,7 +4928,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4973,6 +4974,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5027,7 +5029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5093,6 +5095,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5124,6 +5127,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5149,6 +5153,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5216,7 +5221,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5282,6 +5287,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5313,6 +5319,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5338,6 +5345,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5404,6 +5412,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5417,7 +5426,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5488,7 +5497,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5588,7 +5597,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5642,7 +5651,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5752,7 +5761,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5865,7 +5874,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5975,7 +5984,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6052,7 +6061,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6149,7 +6158,7 @@ def delete_value( # 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,
@@ -6199,7 +6208,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6255,7 +6264,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6308,7 +6317,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6360,7 +6369,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6455,7 +6464,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6518,7 +6527,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6597,7 +6606,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2018_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6664,7 +6673,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_configuration.py
index ed46dbeca9d1..fc58df254bbe 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py
index aa0d95a5b4a7..4b589eb6b235 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_configuration.py
index 678b021bb35c..8cd63e902339 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py
index e0bd8768d0c0..f63e8abd1d48 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py
index 0cfffde1fe73..da9c061fb114 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -90,7 +90,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -131,7 +131,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -212,7 +212,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -325,7 +325,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -366,7 +366,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -548,7 +548,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -590,9 +590,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -606,7 +604,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -702,7 +700,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -767,7 +765,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -831,7 +829,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -896,7 +894,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1018,7 +1016,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1064,7 +1062,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1271,7 +1269,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1314,9 +1312,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1333,7 +1329,7 @@ async def cancel( # 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,
@@ -1450,7 +1446,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1519,7 +1515,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1587,7 +1583,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1660,7 +1656,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1736,7 +1732,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1788,7 +1784,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1853,7 +1849,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1930,7 +1926,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2002,6 +1998,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -2040,7 +2037,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2107,7 +2104,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2290,7 +2287,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2480,6 +2477,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -2516,7 +2514,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2609,7 +2607,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2660,7 +2658,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2792,7 +2790,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3032,7 +3030,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3291,7 +3289,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3337,6 +3335,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3350,7 +3349,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3387,7 +3386,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3433,6 +3432,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3487,7 +3487,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3553,6 +3553,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3584,6 +3585,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3609,6 +3611,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3676,7 +3679,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3742,6 +3745,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3773,6 +3777,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3798,6 +3803,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3864,6 +3870,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -3877,7 +3884,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3948,7 +3955,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4048,7 +4055,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4102,7 +4109,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4212,7 +4219,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4325,7 +4332,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4435,7 +4442,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4512,7 +4519,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4596,9 +4603,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -4609,7 +4614,7 @@ async def delete_value( # 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,
@@ -4659,7 +4664,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4715,7 +4720,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4757,7 +4762,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -4768,7 +4773,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4820,7 +4825,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4915,7 +4920,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4978,7 +4983,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5057,7 +5062,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5124,7 +5129,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py
index df50c93f5041..ab697ee9c480 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/__init__.py
@@ -5,69 +5,80 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+ OnErrorDeploymentType,
+ ResourceIdentityType,
+)
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__ = [
@@ -131,5 +142,5 @@
"OnErrorDeploymentType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py
index 34ee99c03d1b..b735941a50fc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -608,7 +607,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -916,7 +915,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1006,7 +1005,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py
index 0796bdfef54f..eb26181779f4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -1675,7 +1675,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1756,7 +1756,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1869,7 +1869,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1910,7 +1910,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2092,7 +2092,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2150,7 +2150,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2246,7 +2246,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2311,7 +2311,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2375,7 +2375,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2438,7 +2438,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2560,7 +2560,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2606,7 +2606,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2813,7 +2813,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2875,7 +2875,7 @@ def cancel( # 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,
@@ -2992,7 +2992,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3061,7 +3061,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3129,7 +3129,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3202,7 +3202,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3278,7 +3278,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3330,7 +3330,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3395,7 +3395,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3470,7 +3470,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3580,7 +3580,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3647,7 +3647,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3830,7 +3830,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4056,7 +4056,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4149,7 +4149,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4200,7 +4200,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4332,7 +4332,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4572,7 +4572,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4831,7 +4831,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4877,6 +4877,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4890,7 +4891,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4927,7 +4928,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4973,6 +4974,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5027,7 +5029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5093,6 +5095,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5124,6 +5127,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5149,6 +5153,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5216,7 +5221,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5282,6 +5287,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5313,6 +5319,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5338,6 +5345,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5404,6 +5412,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5417,7 +5426,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5488,7 +5497,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5588,7 +5597,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5642,7 +5651,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5752,7 +5761,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5865,7 +5874,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5975,7 +5984,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6052,7 +6061,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6149,7 +6158,7 @@ def delete_value( # 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,
@@ -6199,7 +6208,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6255,7 +6264,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6308,7 +6317,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6360,7 +6369,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6455,7 +6464,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6518,7 +6527,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6597,7 +6606,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_03_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6664,7 +6673,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_configuration.py
index d9f41feb7bb8..55ce9dcc6aab 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py
index 577db94a289a..bc234d8c9e1d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_configuration.py
index 01d69682ff6b..e89ca89b833e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py
index 2336632e002e..9f0f4e0c0cd4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py
index a9091e7e8f60..2eea075db62c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -100,7 +100,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -141,7 +141,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -224,7 +224,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -346,7 +346,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -387,7 +387,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -587,7 +587,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -629,9 +629,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -647,7 +645,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -756,7 +754,7 @@ async def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -823,7 +821,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -889,7 +887,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -952,7 +950,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1065,7 +1063,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1106,7 +1104,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1288,7 +1286,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1330,9 +1328,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1346,7 +1342,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1442,7 +1438,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1507,7 +1503,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1571,7 +1567,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1636,7 +1632,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1758,7 +1754,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1804,7 +1800,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2011,7 +2007,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2054,9 +2050,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2073,7 +2067,7 @@ async def cancel( # 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,
@@ -2190,7 +2184,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2259,7 +2253,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2327,7 +2321,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2400,7 +2394,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2476,7 +2470,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2528,7 +2522,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2593,7 +2587,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2670,7 +2664,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2742,6 +2736,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -2780,7 +2775,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2847,7 +2842,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3030,7 +3025,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3220,6 +3215,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -3256,7 +3252,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3349,7 +3345,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3400,7 +3396,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3532,7 +3528,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3772,7 +3768,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4031,7 +4027,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4077,6 +4073,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4090,7 +4087,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4127,7 +4124,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4173,6 +4170,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4227,7 +4225,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4293,6 +4291,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4324,6 +4323,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4349,6 +4349,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4416,7 +4417,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4482,6 +4483,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4513,6 +4515,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4538,6 +4541,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4604,6 +4608,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4617,7 +4622,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4688,7 +4693,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4788,7 +4793,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4842,7 +4847,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4952,7 +4957,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5065,7 +5070,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5175,7 +5180,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5252,7 +5257,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5336,9 +5341,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -5349,7 +5352,7 @@ async def delete_value( # 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,
@@ -5399,7 +5402,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5455,7 +5458,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5497,7 +5500,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -5508,7 +5511,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5560,7 +5563,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5657,7 +5660,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5722,7 +5725,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5798,7 +5801,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5861,7 +5864,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5940,7 +5943,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6007,7 +6010,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py
index df50c93f5041..ab697ee9c480 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/__init__.py
@@ -5,69 +5,80 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+ OnErrorDeploymentType,
+ ResourceIdentityType,
+)
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__ = [
@@ -131,5 +142,5 @@
"OnErrorDeploymentType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py
index 0f666a919c46..078515dcb1f9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -613,7 +612,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -926,7 +925,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1016,7 +1015,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py
index 7c833c0bd88c..43d6af8c1431 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -1987,7 +1987,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2070,7 +2070,7 @@ def __init__(self, *args, **kwargs):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2192,7 +2192,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2233,7 +2233,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2433,7 +2433,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2493,7 +2493,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2602,7 +2602,7 @@ def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2669,7 +2669,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2735,7 +2735,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2798,7 +2798,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2911,7 +2911,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2952,7 +2952,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3134,7 +3134,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3192,7 +3192,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3288,7 +3288,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3353,7 +3353,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3417,7 +3417,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3480,7 +3480,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3602,7 +3602,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3648,7 +3648,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3855,7 +3855,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3917,7 +3917,7 @@ def cancel( # 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,
@@ -4034,7 +4034,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4103,7 +4103,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4171,7 +4171,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4244,7 +4244,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4320,7 +4320,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4372,7 +4372,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4437,7 +4437,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4512,7 +4512,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4622,7 +4622,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4689,7 +4689,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4872,7 +4872,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5098,7 +5098,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5191,7 +5191,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5242,7 +5242,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5374,7 +5374,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5614,7 +5614,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5873,7 +5873,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5919,6 +5919,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -5932,7 +5933,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5969,7 +5970,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6015,6 +6016,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6069,7 +6071,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6135,6 +6137,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6166,6 +6169,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6191,6 +6195,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6258,7 +6263,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6324,6 +6329,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6355,6 +6361,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6380,6 +6387,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6446,6 +6454,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6459,7 +6468,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6530,7 +6539,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6630,7 +6639,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6684,7 +6693,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6794,7 +6803,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6907,7 +6916,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7017,7 +7026,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7094,7 +7103,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7191,7 +7200,7 @@ def delete_value( # 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,
@@ -7241,7 +7250,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7297,7 +7306,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7350,7 +7359,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7402,7 +7411,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7499,7 +7508,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7564,7 +7573,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7640,7 +7649,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7703,7 +7712,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7782,7 +7791,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7849,7 +7858,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_configuration.py
index 2479ac0e7718..889c59129728 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py
index e1fd1c87bfc0..afb0cd591069 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_configuration.py
index 321aad78afe4..cfb11fb39a5a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py
index 2d1ded723725..b58092794907 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py
index a3c5eea30d95..bc7ed4d18c0d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -102,7 +102,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -143,7 +143,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -226,7 +226,7 @@ def __init__(self, *args, **kwargs) -> None:
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -348,7 +348,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -389,7 +389,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -589,7 +589,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -631,9 +631,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -649,7 +647,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -758,7 +756,7 @@ async def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -825,7 +823,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -891,7 +889,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -954,7 +952,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1067,7 +1065,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1108,7 +1106,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1290,7 +1288,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1332,9 +1330,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1348,7 +1344,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1444,7 +1440,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1509,7 +1505,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1573,7 +1569,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1638,7 +1634,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1760,7 +1756,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1806,7 +1802,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2013,7 +2009,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2056,9 +2052,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2075,7 +2069,7 @@ async def cancel( # 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,
@@ -2192,7 +2186,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2261,7 +2255,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2329,7 +2323,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2402,7 +2396,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2478,7 +2472,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2530,7 +2524,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2595,7 +2589,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2681,7 +2675,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2757,7 +2751,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2814,7 +2808,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2885,6 +2879,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -2923,7 +2918,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2990,7 +2985,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3173,7 +3168,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3363,6 +3358,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -3399,7 +3395,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3492,7 +3488,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3543,7 +3539,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3675,7 +3671,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3915,7 +3911,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4174,7 +4170,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4220,6 +4216,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4233,7 +4230,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4270,7 +4267,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4316,6 +4313,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4370,7 +4368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4436,6 +4434,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4467,6 +4466,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4492,6 +4492,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4559,7 +4560,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4625,6 +4626,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4656,6 +4658,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4681,6 +4684,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4747,6 +4751,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -4760,7 +4765,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4831,7 +4836,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4931,7 +4936,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4985,7 +4990,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5095,7 +5100,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5208,7 +5213,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5318,7 +5323,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5395,7 +5400,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5479,9 +5484,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -5492,7 +5495,7 @@ async def delete_value( # 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,
@@ -5542,7 +5545,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5598,7 +5601,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5640,7 +5643,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -5651,7 +5654,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5703,7 +5706,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5800,7 +5803,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5865,7 +5868,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5941,7 +5944,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6004,7 +6007,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6083,7 +6086,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6150,7 +6153,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py
index df50c93f5041..ab697ee9c480 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/__init__.py
@@ -5,69 +5,80 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceManagementErrorWithDetails
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import ResourceIdentityType
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceManagementErrorWithDetails,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ DeploymentMode,
+ OnErrorDeploymentType,
+ ResourceIdentityType,
+)
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__ = [
@@ -131,5 +142,5 @@
"OnErrorDeploymentType",
"ResourceIdentityType",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py
index 147318c8d4db..34d3019b5486 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -613,7 +612,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -926,7 +925,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1016,7 +1015,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py
index 041f996b194d..71ada24c2a00 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2040,7 +2040,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2123,7 +2123,7 @@ def __init__(self, *args, **kwargs):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2245,7 +2245,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2286,7 +2286,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2486,7 +2486,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2546,7 +2546,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2655,7 +2655,7 @@ def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2722,7 +2722,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2788,7 +2788,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2851,7 +2851,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2964,7 +2964,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3005,7 +3005,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3187,7 +3187,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3245,7 +3245,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3341,7 +3341,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3406,7 +3406,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3470,7 +3470,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3533,7 +3533,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3655,7 +3655,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3701,7 +3701,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3908,7 +3908,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3970,7 +3970,7 @@ def cancel( # 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,
@@ -4087,7 +4087,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4156,7 +4156,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4224,7 +4224,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4297,7 +4297,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4373,7 +4373,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4425,7 +4425,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4490,7 +4490,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4576,7 +4576,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4650,7 +4650,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4707,7 +4707,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4816,7 +4816,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4883,7 +4883,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5066,7 +5066,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5292,7 +5292,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5385,7 +5385,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5436,7 +5436,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5568,7 +5568,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5808,7 +5808,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6067,7 +6067,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6113,6 +6113,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6126,7 +6127,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6163,7 +6164,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6209,6 +6210,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6263,7 +6265,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6329,6 +6331,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6360,6 +6363,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6385,6 +6389,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6452,7 +6457,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6518,6 +6523,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6549,6 +6555,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6574,6 +6581,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6640,6 +6648,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6653,7 +6662,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6724,7 +6733,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6824,7 +6833,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6878,7 +6887,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6988,7 +6997,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7101,7 +7110,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7211,7 +7220,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7288,7 +7297,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7385,7 +7394,7 @@ def delete_value( # 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,
@@ -7435,7 +7444,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7491,7 +7500,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7544,7 +7553,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7596,7 +7605,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7693,7 +7702,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7758,7 +7767,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7834,7 +7843,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7897,7 +7906,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7976,7 +7985,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_05_10.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8043,7 +8052,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_configuration.py
index cf20997e7da4..188d75156552 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py
index ee687f9940d7..77ff940a0823 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_configuration.py
index 9ff7dcf1dfd3..46eb10490e47 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py
index 2e2a5b6eed56..14ec32a35d8b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py
index 19e4b7cc53b2..815558f0decc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -124,7 +124,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -165,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -246,7 +246,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -364,7 +364,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -405,7 +405,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -603,7 +603,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,9 +645,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -663,7 +661,7 @@ async def cancel_at_scope( # 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,
@@ -772,7 +770,7 @@ async def validate_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -839,7 +837,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -905,7 +903,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -968,7 +966,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1080,7 +1078,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,7 +1118,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1301,7 +1299,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1342,9 +1340,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1358,7 +1354,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1453,7 +1449,7 @@ async def validate_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1517,7 +1513,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1580,7 +1576,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1644,7 +1640,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1766,7 +1762,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1807,7 +1803,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2007,7 +2003,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2049,9 +2045,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2067,7 +2061,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2176,7 +2170,7 @@ async def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2243,7 +2237,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2309,7 +2303,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2372,7 +2366,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2485,7 +2479,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2526,7 +2520,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2708,7 +2702,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2750,9 +2744,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2766,7 +2758,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2862,7 +2854,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2918,7 +2910,7 @@ async def validate_at_subscription_scope(
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3107,7 +3099,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3171,7 +3163,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3236,7 +3228,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3358,7 +3350,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3404,7 +3396,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3611,7 +3603,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3654,9 +3646,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3673,7 +3663,7 @@ async def cancel( # 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,
@@ -3790,7 +3780,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3851,7 +3841,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4065,7 +4055,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4133,7 +4123,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4206,7 +4196,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4282,7 +4272,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4334,7 +4324,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4399,7 +4389,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4485,7 +4475,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4561,7 +4551,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4618,7 +4608,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4689,6 +4679,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -4727,7 +4718,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4794,7 +4785,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4977,7 +4968,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5167,6 +5158,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -5203,7 +5195,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5296,7 +5288,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5347,7 +5339,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5479,7 +5471,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5719,7 +5711,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5978,7 +5970,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6024,6 +6016,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6037,7 +6030,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6074,7 +6067,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6120,6 +6113,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6174,7 +6168,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6240,6 +6234,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6271,6 +6266,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6296,6 +6292,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6363,7 +6360,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6429,6 +6426,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6460,6 +6458,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6485,6 +6484,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6551,6 +6551,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6564,7 +6565,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6635,7 +6636,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6735,7 +6736,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6789,7 +6790,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6899,7 +6900,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7012,7 +7013,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7122,7 +7123,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7199,7 +7200,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7283,9 +7284,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -7296,7 +7295,7 @@ async def delete_value( # 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,
@@ -7346,7 +7345,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7402,7 +7401,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7444,7 +7443,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -7455,7 +7454,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7507,7 +7506,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7604,7 +7603,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7669,7 +7668,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7745,7 +7744,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7807,7 +7806,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7884,7 +7883,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7949,7 +7948,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8025,7 +8024,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8088,7 +8087,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8167,7 +8166,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8234,7 +8233,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py
index 9853de1d0d54..4dbfbc41bcf5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/__init__.py
@@ -5,77 +5,88 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ ChangeType,
+ DeploymentMode,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ResourceIdentityType,
+ WhatIfResultFormat,
+)
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__ = [
@@ -147,5 +158,5 @@
"ResourceIdentityType",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py
index f033c54fc804..328b324655df 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -613,7 +612,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1100,7 +1099,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1190,7 +1189,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py
index e44f293ba4f7..dfa9071e2293 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2811,7 +2811,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2892,7 +2892,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3010,7 +3010,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3051,7 +3051,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3249,7 +3249,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3309,7 +3309,7 @@ def cancel_at_scope( # 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,
@@ -3418,7 +3418,7 @@ def validate_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3485,7 +3485,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3551,7 +3551,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3614,7 +3614,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3726,7 +3726,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3766,7 +3766,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3947,7 +3947,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4004,7 +4004,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4099,7 +4099,7 @@ def validate_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4161,7 +4161,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4224,7 +4224,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4288,7 +4288,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4410,7 +4410,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4451,7 +4451,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4651,7 +4651,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4711,7 +4711,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4820,7 +4820,7 @@ def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4887,7 +4887,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4953,7 +4953,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5016,7 +5016,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5129,7 +5129,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5170,7 +5170,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5352,7 +5352,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5410,7 +5410,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5506,7 +5506,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5562,7 +5562,7 @@ def validate_at_subscription_scope(
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5751,7 +5751,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5815,7 +5815,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5878,7 +5878,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6000,7 +6000,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6046,7 +6046,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6253,7 +6253,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6315,7 +6315,7 @@ def cancel( # 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,
@@ -6432,7 +6432,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6493,7 +6493,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6707,7 +6707,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6775,7 +6775,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6848,7 +6848,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6924,7 +6924,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6976,7 +6976,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7041,7 +7041,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7127,7 +7127,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7201,7 +7201,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7258,7 +7258,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7367,7 +7367,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7434,7 +7434,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7617,7 +7617,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7843,7 +7843,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7936,7 +7936,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7987,7 +7987,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8119,7 +8119,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8359,7 +8359,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8618,7 +8618,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8664,6 +8664,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8677,7 +8678,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8714,7 +8715,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8760,6 +8761,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8814,7 +8816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8880,6 +8882,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8911,6 +8914,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8936,6 +8940,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9003,7 +9008,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9069,6 +9074,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9100,6 +9106,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9125,6 +9132,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9191,6 +9199,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9204,7 +9213,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9275,7 +9284,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9375,7 +9384,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9429,7 +9438,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9539,7 +9548,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9652,7 +9661,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9762,7 +9771,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.ResourceGroupExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9839,7 +9848,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9936,7 +9945,7 @@ def delete_value( # 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,
@@ -9986,7 +9995,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10042,7 +10051,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10095,7 +10104,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10147,7 +10156,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10244,7 +10253,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10309,7 +10318,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10385,7 +10394,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10447,7 +10456,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10524,7 +10533,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10589,7 +10598,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10665,7 +10674,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10728,7 +10737,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10807,7 +10816,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_07_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10874,7 +10883,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_configuration.py
index dec6f64f8d15..e390d3a3a2c7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py
index a6c267bee136..0f3342fe35be 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_configuration.py
index a05792f2a31c..d3fec3d4a3a4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py
index 7eab30b05784..3b043490858e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py
index 7a47f92fc9ff..5af568c16a90 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -124,7 +124,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -165,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -246,7 +246,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -364,7 +364,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -405,7 +405,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -603,7 +603,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,9 +645,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -663,7 +661,7 @@ async def cancel_at_scope( # 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,
@@ -772,7 +770,7 @@ async def validate_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -839,7 +837,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -905,7 +903,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -968,7 +966,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1080,7 +1078,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1120,7 +1118,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1302,7 +1300,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1343,9 +1341,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1359,7 +1355,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1455,7 +1451,7 @@ async def validate_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1519,7 +1515,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1582,7 +1578,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1646,7 +1642,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1768,7 +1764,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1809,7 +1805,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2010,7 +2006,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2052,9 +2048,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2070,7 +2064,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2180,7 +2174,7 @@ async def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2247,7 +2241,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2313,7 +2307,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2376,7 +2370,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2489,7 +2483,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2530,7 +2524,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2712,7 +2706,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2754,9 +2748,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2770,7 +2762,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2866,7 +2858,7 @@ async def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2922,7 +2914,7 @@ async def validate_at_subscription_scope(
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3111,7 +3103,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3175,7 +3167,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3240,7 +3232,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3362,7 +3354,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3408,7 +3400,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3615,7 +3607,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3658,9 +3650,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3677,7 +3667,7 @@ async def cancel( # 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,
@@ -3794,7 +3784,7 @@ async def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3855,7 +3845,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4069,7 +4059,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4137,7 +4127,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4210,7 +4200,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4286,7 +4276,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4338,7 +4328,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4403,7 +4393,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4489,7 +4479,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4565,7 +4555,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4622,7 +4612,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4693,6 +4683,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -4732,7 +4723,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4799,7 +4790,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4982,7 +4973,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5172,6 +5163,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -5209,7 +5201,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5302,7 +5294,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5353,7 +5345,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5485,7 +5477,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5725,7 +5717,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5984,7 +5976,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6030,6 +6022,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6043,7 +6036,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6080,7 +6073,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6126,6 +6119,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6180,7 +6174,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6246,6 +6240,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6277,6 +6272,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6302,6 +6298,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6369,7 +6366,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6435,6 +6432,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6466,6 +6464,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6491,6 +6490,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6557,6 +6557,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6570,7 +6571,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6641,7 +6642,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6741,7 +6742,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6795,7 +6796,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6905,7 +6906,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7018,7 +7019,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7074,7 +7075,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7270,7 +7271,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7354,9 +7355,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a tag value.
:param tag_name: The name of the tag. Required.
@@ -7367,7 +7366,7 @@ async def delete_value( # 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,
@@ -7417,7 +7416,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7473,7 +7472,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7515,7 +7514,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a tag from the subscription.
You must remove all values from a resource tag before you can delete it.
@@ -7526,7 +7525,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7578,7 +7577,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7675,7 +7674,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7740,7 +7739,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7816,7 +7815,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7878,7 +7877,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7955,7 +7954,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8020,7 +8019,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8096,7 +8095,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8159,7 +8158,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8238,7 +8237,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8305,7 +8304,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py
index 2cfde4fe8783..e8f84c9fd7c6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/__init__.py
@@ -5,78 +5,89 @@
# 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 AliasPathType
-from ._models_py3 import AliasType
-from ._models_py3 import BasicDependency
-from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import TagsListResult
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AliasPathType,
+ AliasType,
+ BasicDependency,
+ ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourcesMoveInfo,
+ ScopedDeployment,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ TagsListResult,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ ChangeType,
+ DeploymentMode,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ResourceIdentityType,
+ WhatIfResultFormat,
+)
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__ = [
@@ -149,5 +160,5 @@
"ResourceIdentityType",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py
index 3a735f9cfcf6..a4a4a2eb331a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -613,7 +612,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1100,7 +1099,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1190,7 +1189,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py
index 329711ad08a3..483cc68f4532 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2811,7 +2811,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2892,7 +2892,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3010,7 +3010,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3051,7 +3051,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3249,7 +3249,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3309,7 +3309,7 @@ def cancel_at_scope( # 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,
@@ -3418,7 +3418,7 @@ def validate_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3485,7 +3485,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3551,7 +3551,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3614,7 +3614,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3726,7 +3726,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3766,7 +3766,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3948,7 +3948,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4005,7 +4005,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4101,7 +4101,7 @@ def validate_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4163,7 +4163,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4226,7 +4226,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4290,7 +4290,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4412,7 +4412,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4453,7 +4453,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4654,7 +4654,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4714,7 +4714,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4824,7 +4824,7 @@ def validate_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4891,7 +4891,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4957,7 +4957,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5020,7 +5020,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5133,7 +5133,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5174,7 +5174,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5356,7 +5356,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5414,7 +5414,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5510,7 +5510,7 @@ def validate_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5566,7 +5566,7 @@ def validate_at_subscription_scope(
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5755,7 +5755,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5819,7 +5819,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5882,7 +5882,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6004,7 +6004,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6050,7 +6050,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6257,7 +6257,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6319,7 +6319,7 @@ def cancel( # 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,
@@ -6436,7 +6436,7 @@ def validate(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentValidateResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6497,7 +6497,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6711,7 +6711,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6779,7 +6779,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6852,7 +6852,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6928,7 +6928,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6980,7 +6980,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7045,7 +7045,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7131,7 +7131,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7205,7 +7205,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7262,7 +7262,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7372,7 +7372,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7439,7 +7439,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7622,7 +7622,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7849,7 +7849,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7942,7 +7942,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7993,7 +7993,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8125,7 +8125,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8365,7 +8365,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8624,7 +8624,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8670,6 +8670,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8683,7 +8684,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8720,7 +8721,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8766,6 +8767,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8820,7 +8822,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8886,6 +8888,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8917,6 +8920,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -8942,6 +8946,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9009,7 +9014,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9075,6 +9080,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9106,6 +9112,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9131,6 +9138,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9197,6 +9205,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9210,7 +9219,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9281,7 +9290,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9381,7 +9390,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9435,7 +9444,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9545,7 +9554,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9658,7 +9667,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9714,7 +9723,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9910,7 +9919,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10007,7 +10016,7 @@ def delete_value( # 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,
@@ -10057,7 +10066,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10113,7 +10122,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10166,7 +10175,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10218,7 +10227,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10315,7 +10324,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10380,7 +10389,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10456,7 +10465,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10518,7 +10527,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10595,7 +10604,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10660,7 +10669,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10736,7 +10745,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10799,7 +10808,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10878,7 +10887,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_08_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10945,7 +10954,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_configuration.py
index bc053aa07dc4..174667f65cae 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py
index 274d38788af9..836099cf5b4b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_configuration.py
index c0499ca9c44f..025dfdf35b76 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py
index b1a20b418024..c6990c3cf2b5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py
index a9607c701181..cfe63d329279 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -130,7 +130,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -171,7 +171,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +252,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -370,7 +370,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -411,7 +411,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -609,7 +609,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -651,9 +651,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -669,7 +667,7 @@ async def cancel_at_scope( # 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,
@@ -709,7 +707,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -906,7 +904,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -972,7 +970,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1035,7 +1033,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1147,7 +1145,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1187,7 +1185,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1369,7 +1367,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1410,9 +1408,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1426,7 +1422,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1465,7 +1461,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1637,7 +1633,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1825,7 +1821,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1888,7 +1884,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1952,7 +1948,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2074,7 +2070,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2115,7 +2111,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2316,7 +2312,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2358,9 +2354,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2376,7 +2370,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2416,7 +2410,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2607,7 +2601,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2816,7 +2810,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2882,7 +2876,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2945,7 +2939,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3058,7 +3052,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3099,7 +3093,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3281,7 +3275,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3323,9 +3317,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3339,7 +3331,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3379,7 +3371,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3551,7 +3543,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3740,7 +3732,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3804,7 +3796,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3869,7 +3861,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3991,7 +3983,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4037,7 +4029,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4244,7 +4236,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4287,9 +4279,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4306,7 +4296,7 @@ async def cancel( # 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,
@@ -4351,7 +4341,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4549,7 +4539,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4763,7 +4753,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4831,7 +4821,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4904,7 +4894,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4980,7 +4970,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5032,7 +5022,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5097,7 +5087,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5183,7 +5173,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5259,7 +5249,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5316,7 +5306,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5387,6 +5377,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5426,7 +5417,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5493,7 +5484,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5676,7 +5667,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5866,6 +5857,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -5903,7 +5895,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5996,7 +5988,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6047,7 +6039,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6179,7 +6171,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6419,7 +6411,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6678,7 +6670,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6724,6 +6716,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6737,7 +6730,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6774,7 +6767,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6820,6 +6813,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6874,7 +6868,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6940,6 +6934,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6971,6 +6966,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6996,6 +6992,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7063,7 +7060,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7129,6 +7126,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7160,6 +7158,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7185,6 +7184,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7251,6 +7251,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7264,7 +7265,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7335,7 +7336,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7435,7 +7436,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7489,7 +7490,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7599,7 +7600,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7712,7 +7713,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7768,7 +7769,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7964,7 +7965,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8048,9 +8049,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8065,7 +8064,7 @@ async def delete_value( # 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,
@@ -8118,7 +8117,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8175,7 +8174,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8217,7 +8216,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8230,7 +8229,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8287,7 +8286,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8406,7 +8405,7 @@ async def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8535,7 +8534,7 @@ async def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8599,7 +8598,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8640,9 +8639,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, **kwargs: Any
- ) -> None:
+ async def delete_at_scope(self, scope: str, **kwargs: Any) -> None:
"""Deletes the entire set of tags on a resource or subscription.
Deletes the entire set of tags on a resource or subscription.
@@ -8653,7 +8650,7 @@ async def delete_at_scope( # 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,
@@ -8726,7 +8723,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8791,7 +8788,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8867,7 +8864,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8929,7 +8926,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9006,7 +9003,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9071,7 +9068,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9147,7 +9144,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9210,7 +9207,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9289,7 +9286,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9356,7 +9353,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py
index ca3f2712e5ad..9b608d82ce2a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/__init__.py
@@ -5,88 +5,99 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPattern
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPattern,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProvisioningOperation,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -169,5 +180,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py
index 1da08aa9801f..1e4379ce3016 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -687,7 +686,7 @@ def __init__(
self.on_error_deployment = on_error_deployment
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1153,7 +1152,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1243,7 +1242,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py
index 0e17aa034132..cca9e6922a14 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2981,7 +2981,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3062,7 +3062,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3180,7 +3180,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3221,7 +3221,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3419,7 +3419,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3479,7 +3479,7 @@ def cancel_at_scope( # 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,
@@ -3519,7 +3519,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3716,7 +3716,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3782,7 +3782,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3845,7 +3845,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3957,7 +3957,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3997,7 +3997,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4179,7 +4179,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4236,7 +4236,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4275,7 +4275,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4447,7 +4447,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4633,7 +4633,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4696,7 +4696,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4760,7 +4760,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4882,7 +4882,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4923,7 +4923,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5124,7 +5124,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5184,7 +5184,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5224,7 +5224,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5415,7 +5415,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5624,7 +5624,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5690,7 +5690,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5753,7 +5753,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5866,7 +5866,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5907,7 +5907,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6089,7 +6089,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6147,7 +6147,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6187,7 +6187,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6359,7 +6359,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6548,7 +6548,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6612,7 +6612,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6675,7 +6675,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6797,7 +6797,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6843,7 +6843,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7050,7 +7050,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7112,7 +7112,7 @@ def cancel( # 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,
@@ -7157,7 +7157,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7355,7 +7355,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7569,7 +7569,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7637,7 +7637,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7710,7 +7710,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7786,7 +7786,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7838,7 +7838,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7903,7 +7903,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7989,7 +7989,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8063,7 +8063,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8120,7 +8120,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8230,7 +8230,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8297,7 +8297,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8480,7 +8480,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8707,7 +8707,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8800,7 +8800,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8851,7 +8851,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8983,7 +8983,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9223,7 +9223,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9482,7 +9482,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9528,6 +9528,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9541,7 +9542,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9578,7 +9579,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9624,6 +9625,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9678,7 +9680,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9744,6 +9746,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9775,6 +9778,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9800,6 +9804,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9867,7 +9872,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9933,6 +9938,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9964,6 +9970,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9989,6 +9996,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10055,6 +10063,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10068,7 +10077,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10139,7 +10148,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10239,7 +10248,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10293,7 +10302,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10403,7 +10412,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10516,7 +10525,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10572,7 +10581,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10768,7 +10777,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10869,7 +10878,7 @@ def delete_value( # 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,
@@ -10922,7 +10931,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10979,7 +10988,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11034,7 +11043,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11091,7 +11100,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11210,7 +11219,7 @@ def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11339,7 +11348,7 @@ def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11403,7 +11412,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11455,7 +11464,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11528,7 +11537,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11593,7 +11602,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11669,7 +11678,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11731,7 +11740,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11808,7 +11817,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11873,7 +11882,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11949,7 +11958,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12012,7 +12021,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12091,7 +12100,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2019_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12158,7 +12167,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_configuration.py
index 82804693ee5d..887388a7f0eb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py
index 3f9777d52207..e0852b460ad3 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_configuration.py
index 3875f8f3bcb7..aafd4a9c2d20 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py
index 00e3340c932d..492f657774a8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py
@@ -29,11 +29,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py
index 3faa31aa4fa5..b2ce62ab5377 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -131,7 +131,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -172,7 +172,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -253,7 +253,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -371,7 +371,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -412,7 +412,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -610,7 +610,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -652,9 +652,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -670,7 +668,7 @@ async def cancel_at_scope( # 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,
@@ -710,7 +708,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -907,7 +905,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -973,7 +971,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1036,7 +1034,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1148,7 +1146,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1188,7 +1186,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1370,7 +1368,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1411,9 +1409,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1427,7 +1423,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1466,7 +1462,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1638,7 +1634,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1826,7 +1822,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1889,7 +1885,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1953,7 +1949,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2075,7 +2071,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2116,7 +2112,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2317,7 +2313,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2359,9 +2355,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2377,7 +2371,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2417,7 +2411,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2608,7 +2602,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2817,7 +2811,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2883,7 +2877,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2946,7 +2940,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3059,7 +3053,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3100,7 +3094,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3282,7 +3276,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3324,9 +3318,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3340,7 +3332,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3380,7 +3372,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3552,7 +3544,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3741,7 +3733,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3805,7 +3797,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3870,7 +3862,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3992,7 +3984,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4038,7 +4030,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4245,7 +4237,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4288,9 +4280,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4307,7 +4297,7 @@ async def cancel( # 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,
@@ -4352,7 +4342,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4550,7 +4540,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4764,7 +4754,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4832,7 +4822,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4905,7 +4895,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4981,7 +4971,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5023,7 +5013,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
return deserialized # type: ignore
@distributed_trace_async
- async def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ async def register_at_management_group_scope(
self, resource_provider_namespace: str, group_id: str, **kwargs: Any
) -> None:
"""Registers a management group with a resource provider.
@@ -5037,7 +5027,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5085,7 +5075,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5150,7 +5140,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5236,7 +5226,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5312,7 +5302,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5369,7 +5359,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5440,6 +5430,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5479,7 +5470,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5546,7 +5537,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5729,7 +5720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5919,6 +5910,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -5956,7 +5948,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6049,7 +6041,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6100,7 +6092,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6232,7 +6224,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6472,7 +6464,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6731,7 +6723,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6777,6 +6769,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6790,7 +6783,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6827,7 +6820,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6873,6 +6866,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6927,7 +6921,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6993,6 +6987,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7024,6 +7019,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7049,6 +7045,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7116,7 +7113,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7182,6 +7179,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7213,6 +7211,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7238,6 +7237,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7304,6 +7304,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7317,7 +7318,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7388,7 +7389,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7488,7 +7489,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7544,7 +7545,7 @@ async def create_or_update(
async def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7663,7 +7664,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7776,7 +7777,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7832,7 +7833,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8028,7 +8029,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8112,9 +8113,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8129,7 +8128,7 @@ async def delete_value( # 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,
@@ -8182,7 +8181,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8239,7 +8238,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8281,7 +8280,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8294,7 +8293,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8351,7 +8350,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8470,7 +8469,7 @@ async def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8599,7 +8598,7 @@ async def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8663,7 +8662,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8704,9 +8703,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, **kwargs: Any
- ) -> None:
+ async def delete_at_scope(self, scope: str, **kwargs: Any) -> None:
"""Deletes the entire set of tags on a resource or subscription.
Deletes the entire set of tags on a resource or subscription.
@@ -8717,7 +8714,7 @@ async def delete_at_scope( # 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,
@@ -8790,7 +8787,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8855,7 +8852,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8931,7 +8928,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8993,7 +8990,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9070,7 +9067,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9135,7 +9132,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9211,7 +9208,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9274,7 +9271,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9353,7 +9350,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9420,7 +9417,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py
index 74b7e10c4736..066605824907 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/__init__.py
@@ -5,96 +5,107 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import ApiProfile
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import ExpressionEvaluationOptions
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import StatusMessage
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPathAttributes
-from ._resource_management_client_enums import AliasPathTokenType
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import ExpressionEvaluationOptionsScopeType
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ProvisioningState
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderListResult,
+ ProviderResourceType,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExpressionEvaluationOptionsScopeType,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -185,5 +196,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py
index 89a18e7ae6e9..5950c2557514 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -783,7 +782,7 @@ def __init__(
self.expression_evaluation_options = expression_evaluation_options
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1292,7 +1291,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1381,7 +1380,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/__init__.py
index f75c82ef2100..1077d9be5191 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -27,5 +33,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py
index dba0169c5b4b..9da4410ae937 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2907,7 +2907,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2988,7 +2988,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3106,7 +3106,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3147,7 +3147,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3345,7 +3345,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3405,7 +3405,7 @@ def cancel_at_scope( # 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,
@@ -3445,7 +3445,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3642,7 +3642,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3708,7 +3708,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3771,7 +3771,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3883,7 +3883,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3923,7 +3923,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4105,7 +4105,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4162,7 +4162,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4201,7 +4201,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4373,7 +4373,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4559,7 +4559,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4622,7 +4622,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4686,7 +4686,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4808,7 +4808,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4849,7 +4849,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5050,7 +5050,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5110,7 +5110,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5150,7 +5150,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5341,7 +5341,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5550,7 +5550,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5616,7 +5616,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5679,7 +5679,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5792,7 +5792,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5833,7 +5833,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6015,7 +6015,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6073,7 +6073,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6113,7 +6113,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6285,7 +6285,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6474,7 +6474,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6538,7 +6538,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6601,7 +6601,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6723,7 +6723,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6769,7 +6769,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6976,7 +6976,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7038,7 +7038,7 @@ def cancel( # 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,
@@ -7083,7 +7083,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7281,7 +7281,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7495,7 +7495,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7563,7 +7563,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7636,7 +7636,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7712,7 +7712,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7768,7 +7768,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7816,7 +7816,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7881,7 +7881,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7967,7 +7967,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8041,7 +8041,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8098,7 +8098,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8208,7 +8208,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8275,7 +8275,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8458,7 +8458,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8685,7 +8685,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8778,7 +8778,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8829,7 +8829,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8961,7 +8961,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9201,7 +9201,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9460,7 +9460,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9506,6 +9506,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9519,7 +9520,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9556,7 +9557,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9602,6 +9603,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9656,7 +9658,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9722,6 +9724,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9753,6 +9756,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9778,6 +9782,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9845,7 +9850,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9911,6 +9916,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9942,6 +9948,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9967,6 +9974,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10033,6 +10041,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10046,7 +10055,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10117,7 +10126,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10217,7 +10226,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10273,7 +10282,7 @@ def create_or_update(
def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10392,7 +10401,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10505,7 +10514,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10561,7 +10570,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10757,7 +10766,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10858,7 +10867,7 @@ def delete_value( # 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,
@@ -10911,7 +10920,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10968,7 +10977,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11023,7 +11032,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11080,7 +11089,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11199,7 +11208,7 @@ def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11328,7 +11337,7 @@ def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11392,7 +11401,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11444,7 +11453,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11517,7 +11526,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11582,7 +11591,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11658,7 +11667,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11720,7 +11729,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11797,7 +11806,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11862,7 +11871,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11938,7 +11947,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12001,7 +12010,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12080,7 +12089,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2020_06_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12147,7 +12156,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_configuration.py
index cc2a8ab6b7aa..19fb11850c83 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py
index db74445cd684..aa45172c6559 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_configuration.py
index efef0287c6fb..cf9e21453ad4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py
index 9791783e5df5..217e49a6aa27 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py
index 74f610fb568c..92e12a5d430c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -132,7 +132,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -173,7 +173,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -254,7 +254,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -372,7 +372,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -413,7 +413,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -611,7 +611,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -653,9 +653,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -671,7 +669,7 @@ async def cancel_at_scope( # 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,
@@ -711,7 +709,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -908,7 +906,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
: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_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1037,7 +1035,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1149,7 +1147,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1189,7 +1187,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1371,7 +1369,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1412,9 +1410,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1428,7 +1424,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1467,7 +1463,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1639,7 +1635,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1827,7 +1823,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1890,7 +1886,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1954,7 +1950,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2076,7 +2072,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2117,7 +2113,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2318,7 +2314,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2360,9 +2356,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2378,7 +2372,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2418,7 +2412,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2609,7 +2603,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2818,7 +2812,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2884,7 +2878,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2947,7 +2941,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3060,7 +3054,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3101,7 +3095,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3283,7 +3277,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3325,9 +3319,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3341,7 +3333,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3381,7 +3373,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3553,7 +3545,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3742,7 +3734,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3806,7 +3798,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3871,7 +3863,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3993,7 +3985,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4039,7 +4031,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4246,7 +4238,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4289,9 +4281,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4308,7 +4298,7 @@ async def cancel( # 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,
@@ -4353,7 +4343,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4551,7 +4541,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4765,7 +4755,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4833,7 +4823,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4906,7 +4896,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4982,7 +4972,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5024,7 +5014,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
return deserialized # type: ignore
@distributed_trace_async
- async def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ async def register_at_management_group_scope(
self, resource_provider_namespace: str, group_id: str, **kwargs: Any
) -> None:
"""Registers a management group with a resource provider.
@@ -5038,7 +5028,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5086,7 +5076,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5151,7 +5141,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5237,7 +5227,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5313,7 +5303,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5370,7 +5360,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5447,7 +5437,7 @@ async def list(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5519,6 +5509,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5556,7 +5547,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5623,7 +5614,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5806,7 +5797,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5996,6 +5987,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation. The properties you can use for eq (equals)
@@ -6031,7 +6023,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6124,7 +6116,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6175,7 +6167,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6307,7 +6299,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6547,7 +6539,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6806,7 +6798,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6852,6 +6844,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6865,7 +6858,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6902,7 +6895,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6948,6 +6941,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7002,7 +6996,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7068,6 +7062,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7099,6 +7094,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7124,6 +7120,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7191,7 +7188,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7257,6 +7254,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7288,6 +7286,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7313,6 +7312,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7379,6 +7379,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7392,7 +7393,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7463,7 +7464,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7563,7 +7564,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7617,7 +7618,7 @@ async def create_or_update(
return deserialized # type: ignore
async def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7727,7 +7728,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7840,7 +7841,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7896,7 +7897,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8092,7 +8093,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8176,9 +8177,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8193,7 +8192,7 @@ async def delete_value( # 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,
@@ -8246,7 +8245,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8303,7 +8302,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8345,7 +8344,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8358,7 +8357,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8415,7 +8414,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8534,7 +8533,7 @@ async def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8663,7 +8662,7 @@ async def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8727,7 +8726,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8768,9 +8767,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, **kwargs: Any
- ) -> None:
+ async def delete_at_scope(self, scope: str, **kwargs: Any) -> None:
"""Deletes the entire set of tags on a resource or subscription.
Deletes the entire set of tags on a resource or subscription.
@@ -8781,7 +8778,7 @@ async def delete_at_scope( # 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,
@@ -8854,7 +8851,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8919,7 +8916,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8995,7 +8992,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9057,7 +9054,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9134,7 +9131,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9199,7 +9196,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9275,7 +9272,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9338,7 +9335,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9417,7 +9414,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9484,7 +9481,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py
index 9b98662bc4c7..01aa21e82177 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/__init__.py
@@ -5,98 +5,109 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import ApiProfile
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import ExpressionEvaluationOptions
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderExtendedLocation
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import ProviderResourceTypeListResult
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import StatusMessage
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPathAttributes
-from ._resource_management_client_enums import AliasPathTokenType
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import ExpressionEvaluationOptionsScopeType
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ProvisioningState
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderExtendedLocation,
+ ProviderListResult,
+ ProviderResourceType,
+ ProviderResourceTypeListResult,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExpressionEvaluationOptionsScopeType,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -189,5 +200,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py
index 4a46bdc63b65..6f38544620d1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -783,7 +782,7 @@ def __init__(
self.expression_evaluation_options = expression_evaluation_options
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1292,7 +1291,7 @@ def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, s
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1381,7 +1380,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py
index 48bc2f93b397..d5cf3873d8f4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -2934,7 +2934,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3015,7 +3015,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3133,7 +3133,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3174,7 +3174,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3372,7 +3372,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3432,7 +3432,7 @@ def cancel_at_scope( # 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,
@@ -3472,7 +3472,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3669,7 +3669,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3735,7 +3735,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3798,7 +3798,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3910,7 +3910,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3950,7 +3950,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4132,7 +4132,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4189,7 +4189,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4228,7 +4228,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4400,7 +4400,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4586,7 +4586,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4649,7 +4649,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4713,7 +4713,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4835,7 +4835,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4876,7 +4876,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5077,7 +5077,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5137,7 +5137,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5177,7 +5177,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5368,7 +5368,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5577,7 +5577,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5643,7 +5643,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5706,7 +5706,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5819,7 +5819,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5860,7 +5860,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6042,7 +6042,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6100,7 +6100,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6140,7 +6140,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6312,7 +6312,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6501,7 +6501,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6565,7 +6565,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6628,7 +6628,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6750,7 +6750,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6796,7 +6796,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7003,7 +7003,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7065,7 +7065,7 @@ def cancel( # 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,
@@ -7110,7 +7110,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7308,7 +7308,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7522,7 +7522,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7590,7 +7590,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7663,7 +7663,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7739,7 +7739,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7795,7 +7795,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7843,7 +7843,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7908,7 +7908,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7994,7 +7994,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8068,7 +8068,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8125,7 +8125,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8202,7 +8202,7 @@ def list(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8311,7 +8311,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8378,7 +8378,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8561,7 +8561,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8786,7 +8786,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8879,7 +8879,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8930,7 +8930,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9062,7 +9062,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9302,7 +9302,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9561,7 +9561,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9607,6 +9607,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9620,7 +9621,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9657,7 +9658,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9703,6 +9704,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9757,7 +9759,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9823,6 +9825,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9854,6 +9857,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9879,6 +9883,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9946,7 +9951,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10012,6 +10017,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10043,6 +10049,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10068,6 +10075,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10134,6 +10142,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10147,7 +10156,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10218,7 +10227,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10318,7 +10327,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10372,7 +10381,7 @@ def create_or_update(
return deserialized # type: ignore
def _delete_initial(self, resource_group_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10482,7 +10491,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10595,7 +10604,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10651,7 +10660,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10847,7 +10856,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10948,7 +10957,7 @@ def delete_value( # 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,
@@ -11001,7 +11010,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11058,7 +11067,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11113,7 +11122,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11170,7 +11179,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11289,7 +11298,7 @@ def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11418,7 +11427,7 @@ def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11482,7 +11491,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11534,7 +11543,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11607,7 +11616,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11672,7 +11681,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11748,7 +11757,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11810,7 +11819,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11887,7 +11896,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11952,7 +11961,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12028,7 +12037,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12091,7 +12100,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12170,7 +12179,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2020_10_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12237,7 +12246,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py
index 3bccfb03128d..064685fb4339 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py
index c0e318691a05..754b9fa3fda2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_configuration.py
index a77b37e361cd..93c67b4e2a3c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py
index 21708ef6e8b4..4ef34ab779cd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py
index 8736a127749c..ddef252cbf31 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -132,7 +132,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -173,7 +173,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -254,7 +254,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -372,7 +372,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -413,7 +413,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -611,7 +611,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -653,9 +653,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -671,7 +669,7 @@ async def cancel_at_scope( # 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,
@@ -711,7 +709,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -908,7 +906,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
: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_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1037,7 +1035,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1149,7 +1147,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1189,7 +1187,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1371,7 +1369,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1412,9 +1410,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1428,7 +1424,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1467,7 +1463,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1639,7 +1635,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1827,7 +1823,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1890,7 +1886,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1954,7 +1950,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2076,7 +2072,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2117,7 +2113,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2318,7 +2314,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2360,9 +2356,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2378,7 +2372,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2418,7 +2412,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2609,7 +2603,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2818,7 +2812,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2884,7 +2878,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2947,7 +2941,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3060,7 +3054,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3101,7 +3095,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3283,7 +3277,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3325,9 +3319,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3341,7 +3333,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3381,7 +3373,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3553,7 +3545,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3742,7 +3734,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3806,7 +3798,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3871,7 +3863,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3993,7 +3985,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4039,7 +4031,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4246,7 +4238,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4289,9 +4281,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4308,7 +4298,7 @@ async def cancel( # 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,
@@ -4353,7 +4343,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4551,7 +4541,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4765,7 +4755,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4833,7 +4823,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4906,7 +4896,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4982,7 +4972,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5024,7 +5014,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
return deserialized # type: ignore
@distributed_trace_async
- async def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ async def register_at_management_group_scope(
self, resource_provider_namespace: str, group_id: str, **kwargs: Any
) -> None:
"""Registers a management group with a resource provider.
@@ -5038,7 +5028,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5086,7 +5076,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5151,7 +5141,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5237,7 +5227,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5313,7 +5303,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5370,7 +5360,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5447,7 +5437,7 @@ async def list(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5519,6 +5509,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5558,7 +5549,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5625,7 +5616,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5808,7 +5799,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5998,6 +5989,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
@@ -6035,7 +6027,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6128,7 +6120,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6179,7 +6171,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6311,7 +6303,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6551,7 +6543,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6810,7 +6802,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6856,6 +6848,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -6869,7 +6862,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6906,7 +6899,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6952,6 +6945,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7006,7 +7000,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7072,6 +7066,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7103,6 +7098,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7128,6 +7124,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7195,7 +7192,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7261,6 +7258,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7292,6 +7290,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7317,6 +7316,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7383,6 +7383,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7396,7 +7397,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7467,7 +7468,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7567,7 +7568,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7623,7 +7624,7 @@ async def create_or_update(
async def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7742,7 +7743,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7855,7 +7856,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7911,7 +7912,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8107,7 +8108,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8191,9 +8192,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8208,7 +8207,7 @@ async def delete_value( # 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,
@@ -8261,7 +8260,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8318,7 +8317,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8360,7 +8359,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8373,7 +8372,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8430,7 +8429,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8549,7 +8548,7 @@ async def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8678,7 +8677,7 @@ async def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8742,7 +8741,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8783,9 +8782,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, **kwargs: Any
- ) -> None:
+ async def delete_at_scope(self, scope: str, **kwargs: Any) -> None:
"""Deletes the entire set of tags on a resource or subscription.
Deletes the entire set of tags on a resource or subscription.
@@ -8796,7 +8793,7 @@ async def delete_at_scope( # 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,
@@ -8869,7 +8866,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8934,7 +8931,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9010,7 +9007,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9072,7 +9069,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9149,7 +9146,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9214,7 +9211,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9290,7 +9287,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9353,7 +9350,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9432,7 +9429,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9499,7 +9496,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py
index 361ca7dcd237..b24abeeb7440 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/__init__.py
@@ -5,100 +5,111 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import ApiProfile
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import ExpressionEvaluationOptions
-from ._models_py3 import ExtendedLocation
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderExtendedLocation
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import ProviderResourceTypeListResult
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import StatusMessage
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPathAttributes
-from ._resource_management_client_enums import AliasPathTokenType
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import ExpressionEvaluationOptionsScopeType
-from ._resource_management_client_enums import ExtendedLocationType
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ProvisioningState
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ ExtendedLocation,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Plan,
+ Provider,
+ ProviderExtendedLocation,
+ ProviderListResult,
+ ProviderResourceType,
+ ProviderResourceTypeListResult,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExpressionEvaluationOptionsScopeType,
+ ExtendedLocationType,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -193,5 +204,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py
index 7c7562bf23bd..56ae4447c837 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -783,7 +782,7 @@ def __init__(
self.expression_evaluation_options = expression_evaluation_options
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1338,7 +1337,7 @@ def __init__(
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1435,7 +1434,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py
index 25fe46861db3..460ba220335c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -3046,7 +3046,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3127,7 +3127,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3245,7 +3245,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3286,7 +3286,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3484,7 +3484,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3544,7 +3544,7 @@ def cancel_at_scope( # 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,
@@ -3584,7 +3584,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3781,7 +3781,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3847,7 +3847,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3910,7 +3910,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4022,7 +4022,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4062,7 +4062,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4244,7 +4244,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4301,7 +4301,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4340,7 +4340,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4512,7 +4512,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4698,7 +4698,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4761,7 +4761,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4825,7 +4825,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4947,7 +4947,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4988,7 +4988,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5189,7 +5189,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5249,7 +5249,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5289,7 +5289,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5480,7 +5480,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5689,7 +5689,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5755,7 +5755,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5818,7 +5818,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5931,7 +5931,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5972,7 +5972,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6154,7 +6154,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6212,7 +6212,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6252,7 +6252,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6424,7 +6424,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6613,7 +6613,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6677,7 +6677,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6740,7 +6740,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6862,7 +6862,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6908,7 +6908,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7115,7 +7115,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7177,7 +7177,7 @@ def cancel( # 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,
@@ -7222,7 +7222,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7420,7 +7420,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7634,7 +7634,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7702,7 +7702,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7775,7 +7775,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7851,7 +7851,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7907,7 +7907,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7955,7 +7955,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8020,7 +8020,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8106,7 +8106,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8180,7 +8180,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8237,7 +8237,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8314,7 +8314,7 @@ def list(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8425,7 +8425,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8492,7 +8492,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8675,7 +8675,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8902,7 +8902,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8995,7 +8995,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9046,7 +9046,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9178,7 +9178,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9418,7 +9418,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9677,7 +9677,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9723,6 +9723,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9736,7 +9737,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9773,7 +9774,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9819,6 +9820,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9873,7 +9875,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9939,6 +9941,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9970,6 +9973,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -9995,6 +9999,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10062,7 +10067,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10128,6 +10133,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10159,6 +10165,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10184,6 +10191,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10250,6 +10258,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10263,7 +10272,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10334,7 +10343,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10434,7 +10443,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10490,7 +10499,7 @@ def create_or_update(
def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10609,7 +10618,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10722,7 +10731,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10778,7 +10787,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10974,7 +10983,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11075,7 +11084,7 @@ def delete_value( # 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,
@@ -11128,7 +11137,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11185,7 +11194,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11240,7 +11249,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11297,7 +11306,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11416,7 +11425,7 @@ def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11545,7 +11554,7 @@ def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11609,7 +11618,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11661,7 +11670,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11734,7 +11743,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11799,7 +11808,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11875,7 +11884,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11937,7 +11946,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12014,7 +12023,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12079,7 +12088,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12155,7 +12164,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12218,7 +12227,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12297,7 +12306,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2021_01_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12364,7 +12373,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py
index ca9a1f503de6..069dc53ad28a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py
index 25c393de44fd..eedf1f0c41ff 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_configuration.py
index 791de8185899..a8c3eb3721b5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py
index fb1cbb1f7d05..d5b9533d4ade 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py
index 7fcf27b1266c..cb8c7cae6cfa 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -133,7 +133,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -174,7 +174,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -255,7 +255,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -373,7 +373,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -414,7 +414,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -612,7 +612,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -654,9 +654,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -672,7 +670,7 @@ async def cancel_at_scope( # 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,
@@ -712,7 +710,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -909,7 +907,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -975,7 +973,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1038,7 +1036,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1150,7 +1148,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1190,7 +1188,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1372,7 +1370,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1413,9 +1411,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1429,7 +1425,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1468,7 +1464,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1640,7 +1636,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1828,7 +1824,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1891,7 +1887,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1955,7 +1951,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2077,7 +2073,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2118,7 +2114,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2319,7 +2315,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2361,9 +2357,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2379,7 +2373,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2419,7 +2413,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2610,7 +2604,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2819,7 +2813,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2885,7 +2879,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2948,7 +2942,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3061,7 +3055,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3102,7 +3096,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3284,7 +3278,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3326,9 +3320,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3342,7 +3334,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3382,7 +3374,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3554,7 +3546,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3743,7 +3735,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3807,7 +3799,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3872,7 +3864,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3994,7 +3986,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4040,7 +4032,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4247,7 +4239,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4290,9 +4282,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4309,7 +4299,7 @@ async def cancel( # 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,
@@ -4354,7 +4344,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4552,7 +4542,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4766,7 +4756,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4834,7 +4824,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4907,7 +4897,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4983,7 +4973,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5025,7 +5015,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
return deserialized # type: ignore
@distributed_trace_async
- async def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ async def register_at_management_group_scope(
self, resource_provider_namespace: str, group_id: str, **kwargs: Any
) -> None:
"""Registers a management group with a resource provider. Use this operation to register a
@@ -5042,7 +5032,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5091,7 +5081,7 @@ async def provider_permissions(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPermissionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5200,7 +5190,7 @@ async def register(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5275,7 +5265,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5355,7 +5345,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> A
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5430,7 +5420,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5487,7 +5477,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5564,7 +5554,7 @@ async def list(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5636,6 +5626,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5675,7 +5666,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5742,7 +5733,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5925,7 +5916,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6115,6 +6106,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`Filter comparison
@@ -6163,7 +6155,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6256,7 +6248,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6307,7 +6299,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6439,7 +6431,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6679,7 +6671,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6938,7 +6930,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6984,6 +6976,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists. This API currently works only for a limited set of
Resource providers. In the event that a Resource provider does not implement this API, ARM will
respond with a 405. The alternative then is to use the GET API to check for the existence of
@@ -7000,7 +6993,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7037,7 +7030,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7083,6 +7076,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7137,7 +7131,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7203,6 +7197,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7234,6 +7229,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7259,6 +7255,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7326,7 +7323,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7392,6 +7389,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7423,6 +7421,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7448,6 +7447,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7514,6 +7514,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7527,7 +7528,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7598,7 +7599,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7698,7 +7699,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7754,7 +7755,7 @@ async def create_or_update(
async def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7873,7 +7874,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7986,7 +7987,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8042,7 +8043,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8238,7 +8239,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8322,9 +8323,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8339,7 +8338,7 @@ async def delete_value( # 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,
@@ -8392,7 +8391,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8449,7 +8448,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8491,7 +8490,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8504,7 +8503,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8561,7 +8560,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8680,7 +8679,7 @@ async def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8809,7 +8808,7 @@ async def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8873,7 +8872,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8914,9 +8913,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
@distributed_trace_async
- async def delete_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, **kwargs: Any
- ) -> None:
+ async def delete_at_scope(self, scope: str, **kwargs: Any) -> None:
"""Deletes the entire set of tags on a resource or subscription.
Deletes the entire set of tags on a resource or subscription.
@@ -8927,7 +8924,7 @@ async def delete_at_scope( # 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,
@@ -9000,7 +8997,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9065,7 +9062,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9141,7 +9138,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9203,7 +9200,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9280,7 +9277,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9345,7 +9342,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9421,7 +9418,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9484,7 +9481,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9563,7 +9560,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9630,7 +9627,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py
index d4f281d592e8..3a9af4ed9777 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/__init__.py
@@ -5,107 +5,118 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import ApiProfile
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import ExpressionEvaluationOptions
-from ._models_py3 import ExtendedLocation
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Permission
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderConsentDefinition
-from ._models_py3 import ProviderExtendedLocation
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderPermission
-from ._models_py3 import ProviderPermissionListResult
-from ._models_py3 import ProviderRegistrationRequest
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import ProviderResourceTypeListResult
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import RoleDefinition
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import StatusMessage
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPathAttributes
-from ._resource_management_client_enums import AliasPathTokenType
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import ExpressionEvaluationOptionsScopeType
-from ._resource_management_client_enums import ExtendedLocationType
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProviderAuthorizationConsentState
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ProvisioningState
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ ExtendedLocation,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Permission,
+ Plan,
+ Provider,
+ ProviderConsentDefinition,
+ ProviderExtendedLocation,
+ ProviderListResult,
+ ProviderPermission,
+ ProviderPermissionListResult,
+ ProviderRegistrationRequest,
+ ProviderResourceType,
+ ProviderResourceTypeListResult,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ RoleDefinition,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExpressionEvaluationOptionsScopeType,
+ ExtendedLocationType,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProviderAuthorizationConsentState,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -207,5 +218,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py
index e3e61c973a1e..40e4b0749220 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -783,7 +782,7 @@ def __init__(
self.expression_evaluation_options = expression_evaluation_options
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1338,7 +1337,7 @@ def __init__(
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1435,7 +1434,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py
index d3f2525f1338..8cfb11f2f5bd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -3072,7 +3072,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3153,7 +3153,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3271,7 +3271,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3312,7 +3312,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3510,7 +3510,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3570,7 +3570,7 @@ def cancel_at_scope( # 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,
@@ -3610,7 +3610,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3807,7 +3807,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3873,7 +3873,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3936,7 +3936,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4048,7 +4048,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4088,7 +4088,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4270,7 +4270,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4327,7 +4327,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4366,7 +4366,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4538,7 +4538,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4724,7 +4724,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4787,7 +4787,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4851,7 +4851,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4973,7 +4973,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5014,7 +5014,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5215,7 +5215,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5275,7 +5275,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5315,7 +5315,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5506,7 +5506,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5715,7 +5715,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5781,7 +5781,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5844,7 +5844,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5957,7 +5957,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5998,7 +5998,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6180,7 +6180,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6238,7 +6238,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6278,7 +6278,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6450,7 +6450,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6639,7 +6639,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6703,7 +6703,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6766,7 +6766,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6888,7 +6888,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6934,7 +6934,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7141,7 +7141,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7203,7 +7203,7 @@ def cancel( # 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,
@@ -7248,7 +7248,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7446,7 +7446,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7660,7 +7660,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7728,7 +7728,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7801,7 +7801,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7877,7 +7877,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7936,7 +7936,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7985,7 +7985,7 @@ def provider_permissions(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderPermissionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8094,7 +8094,7 @@ def register(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8169,7 +8169,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8249,7 +8249,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8322,7 +8322,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8379,7 +8379,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8456,7 +8456,7 @@ def list(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8567,7 +8567,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8634,7 +8634,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8817,7 +8817,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9055,7 +9055,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9148,7 +9148,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9199,7 +9199,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9331,7 +9331,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9571,7 +9571,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9830,7 +9830,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9876,6 +9876,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists. This API currently works only for a limited set of
Resource providers. In the event that a Resource provider does not implement this API, ARM will
respond with a 405. The alternative then is to use the GET API to check for the existence of
@@ -9892,7 +9893,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9929,7 +9930,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9975,6 +9976,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10029,7 +10031,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10095,6 +10097,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10126,6 +10129,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10151,6 +10155,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10218,7 +10223,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10284,6 +10289,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10315,6 +10321,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10340,6 +10347,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10406,6 +10414,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10419,7 +10428,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10490,7 +10499,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10590,7 +10599,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10646,7 +10655,7 @@ def create_or_update(
def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10765,7 +10774,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10878,7 +10887,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10934,7 +10943,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11130,7 +11139,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11231,7 +11240,7 @@ def delete_value( # 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,
@@ -11284,7 +11293,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11341,7 +11350,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11396,7 +11405,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11453,7 +11462,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11572,7 +11581,7 @@ def create_or_update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11701,7 +11710,7 @@ def update_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11765,7 +11774,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11817,7 +11826,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11890,7 +11899,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11955,7 +11964,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12031,7 +12040,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12093,7 +12102,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12170,7 +12179,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12235,7 +12244,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12311,7 +12320,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12374,7 +12383,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12453,7 +12462,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2021_04_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12520,7 +12529,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/__init__.py
index 0b5e750bb361..1425a43e3809 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/__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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_configuration.py
index 9ccb3ebefb9f..e61da7b6f022 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py
index 148ee8f1cb84..f77964164359 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/__init__.py
index fb06a1bf7827..f06ef4b18a05 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/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 ._resource_management_client import ResourceManagementClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # 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__ = [
"ResourceManagementClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_configuration.py
index 3a656a25ad3f..f6ebc54e2927 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/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 ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for ResourceManagementClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py
index e1c597314989..9815d611a366 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py
@@ -30,11 +30,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class ResourceManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
"""Provides operations for working with resources and resource groups.
:ivar operations: Operations operations
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py
index d0f111ed6c62..0c0bdc63fa33 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -133,7 +133,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -174,7 +174,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -255,7 +255,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -373,7 +373,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -414,7 +414,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa
async def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -612,7 +612,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -654,9 +654,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) ->
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
- self, scope: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -672,7 +670,7 @@ async def cancel_at_scope( # 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,
@@ -712,7 +710,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements
async def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -909,7 +907,7 @@ async def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -975,7 +973,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1038,7 +1036,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1150,7 +1148,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1190,7 +1188,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs:
async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1372,7 +1370,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1413,9 +1411,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -1429,7 +1425,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1468,7 +1464,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme
async def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1640,7 +1636,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1828,7 +1824,7 @@ async def export_template_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1891,7 +1887,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1955,7 +1951,7 @@ async def get_next(next_link=None):
async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2077,7 +2073,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2118,7 +2114,7 @@ async def check_existence_at_management_group_scope( # pylint: disable=name-too
async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2319,7 +2315,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2361,9 +2357,7 @@ async def get_at_management_group_scope(
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
- self, group_id: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -2379,7 +2373,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2419,7 +2413,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu
async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2610,7 +2604,7 @@ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-to
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2819,7 +2813,7 @@ async def export_template_at_management_group_scope( # pylint: disable=name-too
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2885,7 +2879,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -2948,7 +2942,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3061,7 +3055,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3102,7 +3096,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw
async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3284,7 +3278,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3326,9 +3320,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -
return deserialized # type: ignore
@distributed_trace_async
- async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
- self, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -3342,7 +3334,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3382,7 +3374,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s
async def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3554,7 +3546,7 @@ def get_long_running_output(pipeline_response):
async def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3743,7 +3735,7 @@ async def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3807,7 +3799,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3872,7 +3864,7 @@ async def get_next(next_link=None):
async def _delete_initial(
self, resource_group_name: str, deployment_name: str, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3994,7 +3986,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str,
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4040,7 +4032,7 @@ async def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4247,7 +4239,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4290,9 +4282,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An
return deserialized # type: ignore
@distributed_trace_async
- async def cancel( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, deployment_name: str, **kwargs: Any
- ) -> None:
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
"""Cancels a currently running template deployment.
You can cancel a deployment only if the provisioningState is Accepted or Running. After the
@@ -4309,7 +4299,7 @@ async def cancel( # 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,
@@ -4354,7 +4344,7 @@ async def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4552,7 +4542,7 @@ async def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4766,7 +4756,7 @@ async def export_template(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4834,7 +4824,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4907,7 +4897,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4983,7 +4973,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5025,7 +5015,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _
return deserialized # type: ignore
@distributed_trace_async
- async def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ async def register_at_management_group_scope(
self, resource_provider_namespace: str, group_id: str, **kwargs: Any
) -> None:
"""Registers a management group with a resource provider. Use this operation to register a
@@ -5042,7 +5032,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5091,7 +5081,7 @@ async def provider_permissions(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ProviderPermissionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5200,7 +5190,7 @@ async def register(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5275,7 +5265,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5355,7 +5345,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> A
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5430,7 +5420,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5487,7 +5477,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5564,7 +5554,7 @@ async def list(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5636,6 +5626,7 @@ def list_by_resource_group(
top: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources for a resource group.
:param resource_group_name: The resource group with the resources to get. Required.
@@ -5675,7 +5666,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5742,7 +5733,7 @@ async def get_next(next_link=None):
async def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5925,7 +5916,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6115,6 +6106,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def list(
self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
"""Get all the resources in a subscription.
:param filter: The filter to apply on the operation.:code:`
`:code:`
`Filter comparison
@@ -6163,7 +6155,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6256,7 +6248,7 @@ async def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6307,7 +6299,7 @@ async def _delete_initial(
api_version: str,
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6439,7 +6431,7 @@ async def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6679,7 +6671,7 @@ async def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6938,7 +6930,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6984,6 +6976,7 @@ async def get(
@distributed_trace_async
async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists. This API currently works only for a limited set of
Resource providers. In the event that a Resource provider does not implement this API, ARM will
respond with a 405. The alternative then is to use the GET API to check for the existence of
@@ -7000,7 +6993,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7037,7 +7030,7 @@ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwar
return 200 <= response.status_code <= 299
async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7083,6 +7076,7 @@ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwar
@distributed_trace_async
async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7137,7 +7131,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
async def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7203,6 +7197,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7234,6 +7229,7 @@ async def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7259,6 +7255,7 @@ async def begin_create_or_update_by_id(
async def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7326,7 +7323,7 @@ def get_long_running_output(pipeline_response):
async def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7392,6 +7389,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7423,6 +7421,7 @@ async def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7448,6 +7447,7 @@ async def begin_update_by_id(
async def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7514,6 +7514,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace_async
async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -7527,7 +7528,7 @@ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7598,7 +7599,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7698,7 +7699,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7754,7 +7755,7 @@ async def create_or_update(
async def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7873,7 +7874,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7986,7 +7987,7 @@ async def update(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8042,7 +8043,7 @@ async def update(
async def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8238,7 +8239,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8322,9 +8323,7 @@ def __init__(self, *args, **kwargs) -> None:
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
@distributed_trace_async
- async def delete_value( # pylint: disable=inconsistent-return-statements
- self, tag_name: str, tag_value: str, **kwargs: Any
- ) -> None:
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
"""Deletes a predefined tag value for a predefined tag name.
This operation allows deleting a value from the list of predefined values for an existing
@@ -8339,7 +8338,7 @@ async def delete_value( # 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,
@@ -8392,7 +8391,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs:
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8449,7 +8448,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8491,7 +8490,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet
return deserialized # type: ignore
@distributed_trace_async
- async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
"""Deletes a predefined tag name.
This operation allows deleting a name from the list of predefined tag names for the given
@@ -8504,7 +8503,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8561,7 +8560,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8624,7 +8623,7 @@ async def get_next(next_link=None):
async def _create_or_update_at_scope_initial(
self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8799,7 +8798,7 @@ def get_long_running_output(pipeline_response):
async def _update_at_scope_initial(
self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9001,7 +9000,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9042,7 +9041,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
async def _delete_at_scope_initial(self, scope: str, **kwargs: Any) -> AsyncIterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9174,7 +9173,7 @@ async def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9239,7 +9238,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9315,7 +9314,7 @@ async def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9377,7 +9376,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9454,7 +9453,7 @@ async def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9519,7 +9518,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9595,7 +9594,7 @@ async def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9658,7 +9657,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9737,7 +9736,7 @@ async def get(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9804,7 +9803,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py
index 606e20f545ac..f507256959a1 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py
@@ -5,110 +5,121 @@
# 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 Alias
-from ._models_py3 import AliasPath
-from ._models_py3 import AliasPathMetadata
-from ._models_py3 import AliasPattern
-from ._models_py3 import ApiProfile
-from ._models_py3 import BasicDependency
-from ._models_py3 import DebugSetting
-from ._models_py3 import Dependency
-from ._models_py3 import Deployment
-from ._models_py3 import DeploymentExportResult
-from ._models_py3 import DeploymentExtended
-from ._models_py3 import DeploymentExtendedFilter
-from ._models_py3 import DeploymentListResult
-from ._models_py3 import DeploymentOperation
-from ._models_py3 import DeploymentOperationProperties
-from ._models_py3 import DeploymentOperationsListResult
-from ._models_py3 import DeploymentParameter
-from ._models_py3 import DeploymentProperties
-from ._models_py3 import DeploymentPropertiesExtended
-from ._models_py3 import DeploymentValidateResult
-from ._models_py3 import DeploymentWhatIf
-from ._models_py3 import DeploymentWhatIfProperties
-from ._models_py3 import DeploymentWhatIfSettings
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExportTemplateRequest
-from ._models_py3 import ExpressionEvaluationOptions
-from ._models_py3 import ExtendedLocation
-from ._models_py3 import GenericResource
-from ._models_py3 import GenericResourceExpanded
-from ._models_py3 import GenericResourceFilter
-from ._models_py3 import HttpMessage
-from ._models_py3 import Identity
-from ._models_py3 import IdentityUserAssignedIdentitiesValue
-from ._models_py3 import KeyVaultParameterReference
-from ._models_py3 import KeyVaultReference
-from ._models_py3 import OnErrorDeployment
-from ._models_py3 import OnErrorDeploymentExtended
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import ParametersLink
-from ._models_py3 import Permission
-from ._models_py3 import Plan
-from ._models_py3 import Provider
-from ._models_py3 import ProviderConsentDefinition
-from ._models_py3 import ProviderExtendedLocation
-from ._models_py3 import ProviderListResult
-from ._models_py3 import ProviderPermission
-from ._models_py3 import ProviderPermissionListResult
-from ._models_py3 import ProviderRegistrationRequest
-from ._models_py3 import ProviderResourceType
-from ._models_py3 import ProviderResourceTypeListResult
-from ._models_py3 import Resource
-from ._models_py3 import ResourceGroup
-from ._models_py3 import ResourceGroupExportResult
-from ._models_py3 import ResourceGroupFilter
-from ._models_py3 import ResourceGroupListResult
-from ._models_py3 import ResourceGroupPatchable
-from ._models_py3 import ResourceGroupProperties
-from ._models_py3 import ResourceListResult
-from ._models_py3 import ResourceProviderOperationDisplayProperties
-from ._models_py3 import ResourceReference
-from ._models_py3 import ResourcesMoveInfo
-from ._models_py3 import RoleDefinition
-from ._models_py3 import ScopedDeployment
-from ._models_py3 import ScopedDeploymentWhatIf
-from ._models_py3 import Sku
-from ._models_py3 import StatusMessage
-from ._models_py3 import SubResource
-from ._models_py3 import TagCount
-from ._models_py3 import TagDetails
-from ._models_py3 import TagValue
-from ._models_py3 import Tags
-from ._models_py3 import TagsListResult
-from ._models_py3 import TagsPatchResource
-from ._models_py3 import TagsResource
-from ._models_py3 import TargetResource
-from ._models_py3 import TemplateHashResult
-from ._models_py3 import TemplateLink
-from ._models_py3 import WhatIfChange
-from ._models_py3 import WhatIfOperationResult
-from ._models_py3 import WhatIfPropertyChange
-from ._models_py3 import ZoneMapping
+from typing import TYPE_CHECKING
-from ._resource_management_client_enums import AliasPathAttributes
-from ._resource_management_client_enums import AliasPathTokenType
-from ._resource_management_client_enums import AliasPatternType
-from ._resource_management_client_enums import AliasType
-from ._resource_management_client_enums import ChangeType
-from ._resource_management_client_enums import DeploymentMode
-from ._resource_management_client_enums import ExpressionEvaluationOptionsScopeType
-from ._resource_management_client_enums import ExtendedLocationType
-from ._resource_management_client_enums import OnErrorDeploymentType
-from ._resource_management_client_enums import PropertyChangeType
-from ._resource_management_client_enums import ProviderAuthorizationConsentState
-from ._resource_management_client_enums import ProvisioningOperation
-from ._resource_management_client_enums import ProvisioningState
-from ._resource_management_client_enums import ResourceIdentityType
-from ._resource_management_client_enums import TagsPatchOperation
-from ._resource_management_client_enums import WhatIfResultFormat
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentParameter,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidateResult,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ ExtendedLocation,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ KeyVaultParameterReference,
+ KeyVaultReference,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Permission,
+ Plan,
+ Provider,
+ ProviderConsentDefinition,
+ ProviderExtendedLocation,
+ ProviderListResult,
+ ProviderPermission,
+ ProviderPermissionListResult,
+ ProviderRegistrationRequest,
+ ProviderResourceType,
+ ProviderResourceTypeListResult,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ RoleDefinition,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExpressionEvaluationOptionsScopeType,
+ ExtendedLocationType,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProviderAuthorizationConsentState,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
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__ = [
@@ -213,5 +224,5 @@
"TagsPatchOperation",
"WhatIfResultFormat",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py
index 23edfc845312..a8059e82839f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -15,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -819,7 +818,7 @@ def __init__(
self.expression_evaluation_options = expression_evaluation_options
-class DeploymentPropertiesExtended(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class DeploymentPropertiesExtended(_serialization.Model):
"""Deployment properties with additional details.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1376,7 +1375,7 @@ def __init__(
self.tags = tags
-class GenericResource(Resource): # pylint: disable=too-many-instance-attributes
+class GenericResource(Resource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1473,7 +1472,7 @@ def __init__(
self.identity = identity
-class GenericResourceExpanded(GenericResource): # pylint: disable=too-many-instance-attributes
+class GenericResourceExpanded(GenericResource):
"""Resource information.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/__init__.py
index fd986d0ed425..fc92299ca9cb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/__init__.py
@@ -5,18 +5,24 @@
# 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 ._operations import Operations
-from ._operations import DeploymentsOperations
-from ._operations import ProvidersOperations
-from ._operations import ProviderResourceTypesOperations
-from ._operations import ResourcesOperations
-from ._operations import ResourceGroupsOperations
-from ._operations import TagsOperations
-from ._operations import DeploymentOperationsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # 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__ = [
@@ -29,5 +35,5 @@
"TagsOperations",
"DeploymentOperationsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py
index 74523502b4af..6d88bb7826e8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
import urllib.parse
from azure.core.exceptions import (
@@ -36,7 +36,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -3072,7 +3072,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3153,7 +3153,7 @@ def __init__(self, *args, **kwargs):
self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3271,7 +3271,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3312,7 +3312,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A
def _create_or_update_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3510,7 +3510,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3570,7 +3570,7 @@ def cancel_at_scope( # 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,
@@ -3610,7 +3610,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_scope_initial(
self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3807,7 +3807,7 @@ def export_template_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3873,7 +3873,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -3936,7 +3936,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4048,7 +4048,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4088,7 +4088,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4270,7 +4270,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4327,7 +4327,7 @@ def cancel_at_tenant_scope( # 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,
@@ -4366,7 +4366,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
def _validate_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4538,7 +4538,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_tenant_scope_initial(
self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4724,7 +4724,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4787,7 +4787,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4851,7 +4851,7 @@ def get_next(next_link=None):
def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -4973,7 +4973,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5014,7 +5014,7 @@ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5215,7 +5215,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5275,7 +5275,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5315,7 +5315,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta
def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5506,7 +5506,7 @@ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5715,7 +5715,7 @@ def export_template_at_management_group_scope( # pylint: disable=name-too-long
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5781,7 +5781,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5844,7 +5844,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5957,7 +5957,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -5998,7 +5998,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs:
def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6180,7 +6180,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6238,7 +6238,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6278,7 +6278,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme
def _validate_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6450,7 +6450,7 @@ def get_long_running_output(pipeline_response):
def _what_if_at_subscription_scope_initial(
self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6639,7 +6639,7 @@ def export_template_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6703,7 +6703,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6766,7 +6766,7 @@ def get_next(next_link=None):
return ItemPaged(get_next, extract_data)
def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6888,7 +6888,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -6934,7 +6934,7 @@ def _create_or_update_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7141,7 +7141,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) ->
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExtended
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7203,7 +7203,7 @@ def cancel( # 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,
@@ -7248,7 +7248,7 @@ def _validate_initial(
parameters: Union[_models.Deployment, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7446,7 +7446,7 @@ def _what_if_initial(
parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7660,7 +7660,7 @@ def export_template(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentExportResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7728,7 +7728,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7801,7 +7801,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TemplateHashResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7877,7 +7877,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7936,7 +7936,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -7985,7 +7985,7 @@ def provider_permissions(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ProviderPermissionListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8094,7 +8094,7 @@ def register(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8169,7 +8169,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8249,7 +8249,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8322,7 +8322,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8379,7 +8379,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.Provider
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8456,7 +8456,7 @@ def list(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ProviderResourceTypeListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8567,7 +8567,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8634,7 +8634,7 @@ def get_next(next_link=None):
def _move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -8817,7 +8817,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _validate_move_resources_initial(
self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9055,7 +9055,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9148,7 +9148,7 @@ def check_existence(
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9199,7 +9199,7 @@ def _delete_initial(
api_version: str,
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9331,7 +9331,7 @@ def _create_or_update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9571,7 +9571,7 @@ def _update_initial(
parameters: Union[_models.GenericResource, IO[bytes]],
**kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9830,7 +9830,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9876,6 +9876,7 @@ def get(
@distributed_trace
def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
"""Checks by ID whether a resource exists. This API currently works only for a limited set of
Resource providers. In the event that a Resource provider does not implement this API, ARM will
respond with a 405. The alternative then is to use the GET API to check for the existence of
@@ -9892,7 +9893,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9929,7 +9930,7 @@ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: An
return 200 <= response.status_code <= 299
def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -9975,6 +9976,7 @@ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: An
@distributed_trace
def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
"""Deletes a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10029,7 +10031,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
def _create_or_update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10095,6 +10097,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10126,6 +10129,7 @@ def begin_create_or_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10151,6 +10155,7 @@ def begin_create_or_update_by_id(
def begin_create_or_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Create a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10218,7 +10223,7 @@ def get_long_running_output(pipeline_response):
def _update_by_id_initial(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10284,6 +10289,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10315,6 +10321,7 @@ def begin_update_by_id(
content_type: str = "application/json",
**kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10340,6 +10347,7 @@ def begin_update_by_id(
def begin_update_by_id(
self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
"""Updates a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10406,6 +10414,7 @@ def get_long_running_output(pipeline_response):
@distributed_trace
def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
"""Gets a resource by ID.
:param resource_id: The fully qualified ID of the resource, including the resource name and
@@ -10419,7 +10428,7 @@ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _model
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.GenericResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10490,7 +10499,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
:rtype: bool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10590,7 +10599,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10646,7 +10655,7 @@ def create_or_update(
def _delete_initial(
self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10765,7 +10774,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10878,7 +10887,7 @@ def update(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.ResourceGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -10934,7 +10943,7 @@ def update(
def _export_template_initial(
self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11130,7 +11139,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11231,7 +11240,7 @@ def delete_value( # 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,
@@ -11284,7 +11293,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagValue
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11341,7 +11350,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagDetails
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11396,7 +11405,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11453,7 +11462,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11516,7 +11525,7 @@ def get_next(next_link=None):
def _create_or_update_at_scope_initial(
self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11691,7 +11700,7 @@ def get_long_running_output(pipeline_response):
def _update_at_scope_initial(
self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11893,7 +11902,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.TagsResource
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -11934,7 +11943,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
return deserialized # type: ignore
def _delete_at_scope_initial(self, scope: str, **kwargs: Any) -> Iterator[bytes]:
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12066,7 +12075,7 @@ def get_at_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12131,7 +12140,7 @@ def list_at_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12207,7 +12216,7 @@ def get_at_tenant_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12269,7 +12278,7 @@ def list_at_tenant_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12346,7 +12355,7 @@ def get_at_management_group_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12411,7 +12420,7 @@ def list_at_management_group_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12487,7 +12496,7 @@ def get_at_subscription_scope(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12550,7 +12559,7 @@ def list_at_subscription_scope(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12629,7 +12638,7 @@ def get(
:rtype: ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentOperation
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -12696,7 +12705,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01"))
cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/__init__.py
new file mode 100644
index 000000000000..1425a43e3809
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/__init__.py
@@ -0,0 +1,32 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # type: ignore
+from ._version import VERSION
+
+__version__ = VERSION
+
+try:
+ from ._patch import __all__ as _patch_all
+ from ._patch import *
+except ImportError:
+ _patch_all = []
+from ._patch import patch_sdk as _patch_sdk
+
+__all__ = [
+ "ResourceManagementClient",
+]
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
+
+_patch_sdk()
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_configuration.py
new file mode 100644
index 000000000000..521230940433
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_configuration.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any, TYPE_CHECKING
+
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
+
+from ._version import VERSION
+
+if TYPE_CHECKING:
+ from azure.core.credentials import TokenCredential
+
+
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
+ """Configuration for ResourceManagementClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure. Required.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param subscription_id: The Microsoft Azure subscription ID. Required.
+ :type subscription_id: str
+ :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
+ default value may result in unsupported behavior.
+ :paramtype api_version: str
+ """
+
+ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
+ api_version: str = kwargs.pop("api_version", "2024-07-01")
+
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if subscription_id is None:
+ raise ValueError("Parameter 'subscription_id' must not be None.")
+
+ self.credential = credential
+ self.subscription_id = subscription_id
+ self.api_version = api_version
+ self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
+ kwargs.setdefault("sdk_moniker", "mgmt-resource/{}".format(VERSION))
+ self.polling_interval = kwargs.get("polling_interval", 30)
+ self._configure(**kwargs)
+
+ def _configure(self, **kwargs: Any) -> None:
+ self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
+ self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
+ self.authentication_policy = kwargs.get("authentication_policy")
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = ARMChallengeAuthenticationPolicy(
+ self.credential, *self.credential_scopes, **kwargs
+ )
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_metadata.json b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_metadata.json
new file mode 100644
index 000000000000..8f80f24cf057
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_metadata.json
@@ -0,0 +1,117 @@
+{
+ "chosen_version": "2024-07-01",
+ "total_api_version_list": ["2024-07-01"],
+ "client": {
+ "name": "ResourceManagementClient",
+ "filename": "_resource_management_client",
+ "description": "Provides operations for working with resources and resource groups.",
+ "host_value": "\"https://management.azure.com\"",
+ "parameterized_host_template": null,
+ "azure_arm": true,
+ "has_public_lro_operations": true,
+ "client_side_validation": false,
+ "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ResourceManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
+ "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ResourceManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
+ },
+ "global_parameters": {
+ "sync": {
+ "credential": {
+ "signature": "credential: \"TokenCredential\",",
+ "description": "Credential needed for the client to connect to Azure. Required.",
+ "docstring_type": "~azure.core.credentials.TokenCredential",
+ "required": true,
+ "method_location": "positional"
+ },
+ "subscription_id": {
+ "signature": "subscription_id: str,",
+ "description": "The Microsoft Azure subscription ID. Required.",
+ "docstring_type": "str",
+ "required": true,
+ "method_location": "positional"
+ }
+ },
+ "async": {
+ "credential": {
+ "signature": "credential: \"AsyncTokenCredential\",",
+ "description": "Credential needed for the client to connect to Azure. Required.",
+ "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
+ "required": true
+ },
+ "subscription_id": {
+ "signature": "subscription_id: str,",
+ "description": "The Microsoft Azure subscription ID. Required.",
+ "docstring_type": "str",
+ "required": true
+ }
+ },
+ "constant": {
+ },
+ "call": "credential, subscription_id",
+ "service_client_specific": {
+ "sync": {
+ "api_version": {
+ "signature": "api_version: Optional[str]=None,",
+ "description": "API version to use if no profile is provided, or if missing in profile.",
+ "docstring_type": "str",
+ "required": false,
+ "method_location": "positional"
+ },
+ "base_url": {
+ "signature": "base_url: str = \"https://management.azure.com\",",
+ "description": "Service URL",
+ "docstring_type": "str",
+ "required": false,
+ "method_location": "positional"
+ },
+ "profile": {
+ "signature": "profile: KnownProfiles=KnownProfiles.default,",
+ "description": "A profile definition, from KnownProfiles to dict.",
+ "docstring_type": "azure.profiles.KnownProfiles",
+ "required": false,
+ "method_location": "positional"
+ }
+ },
+ "async": {
+ "api_version": {
+ "signature": "api_version: Optional[str] = None,",
+ "description": "API version to use if no profile is provided, or if missing in profile.",
+ "docstring_type": "str",
+ "required": false,
+ "method_location": "positional"
+ },
+ "base_url": {
+ "signature": "base_url: str = \"https://management.azure.com\",",
+ "description": "Service URL",
+ "docstring_type": "str",
+ "required": false,
+ "method_location": "positional"
+ },
+ "profile": {
+ "signature": "profile: KnownProfiles = KnownProfiles.default,",
+ "description": "A profile definition, from KnownProfiles to dict.",
+ "docstring_type": "azure.profiles.KnownProfiles",
+ "required": false,
+ "method_location": "positional"
+ }
+ }
+ }
+ },
+ "config": {
+ "credential": true,
+ "credential_scopes": ["https://management.azure.com/.default"],
+ "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
+ "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
+ "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
+ "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
+ },
+ "operation_groups": {
+ "operations": "Operations",
+ "deployments": "DeploymentsOperations",
+ "providers": "ProvidersOperations",
+ "provider_resource_types": "ProviderResourceTypesOperations",
+ "resources": "ResourcesOperations",
+ "resource_groups": "ResourceGroupsOperations",
+ "tags": "TagsOperations",
+ "deployment_operations": "DeploymentOperationsOperations"
+ }
+}
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_patch.py
new file mode 100644
index 000000000000..f7dd32510333
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_patch.py
@@ -0,0 +1,20 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_resource_management_client.py
new file mode 100644
index 000000000000..019e5c0b3c92
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_resource_management_client.py
@@ -0,0 +1,157 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from copy import deepcopy
+from typing import Any, TYPE_CHECKING
+from typing_extensions import Self
+
+from azure.core.pipeline import policies
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.mgmt.core import ARMPipelineClient
+from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
+
+from . import models as _models
+from .._serialization import Deserializer, Serializer
+from ._configuration import ResourceManagementClientConfiguration
+from .operations import (
+ DeploymentOperationsOperations,
+ DeploymentsOperations,
+ Operations,
+ ProviderResourceTypesOperations,
+ ProvidersOperations,
+ ResourceGroupsOperations,
+ ResourcesOperations,
+ TagsOperations,
+)
+
+if TYPE_CHECKING:
+ from azure.core.credentials import TokenCredential
+
+
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
+ """Provides operations for working with resources and resource groups.
+
+ :ivar operations: Operations operations
+ :vartype operations: azure.mgmt.resource.resources.v2024_07_01.operations.Operations
+ :ivar deployments: DeploymentsOperations operations
+ :vartype deployments:
+ azure.mgmt.resource.resources.v2024_07_01.operations.DeploymentsOperations
+ :ivar providers: ProvidersOperations operations
+ :vartype providers: azure.mgmt.resource.resources.v2024_07_01.operations.ProvidersOperations
+ :ivar provider_resource_types: ProviderResourceTypesOperations operations
+ :vartype provider_resource_types:
+ azure.mgmt.resource.resources.v2024_07_01.operations.ProviderResourceTypesOperations
+ :ivar resources: ResourcesOperations operations
+ :vartype resources: azure.mgmt.resource.resources.v2024_07_01.operations.ResourcesOperations
+ :ivar resource_groups: ResourceGroupsOperations operations
+ :vartype resource_groups:
+ azure.mgmt.resource.resources.v2024_07_01.operations.ResourceGroupsOperations
+ :ivar tags: TagsOperations operations
+ :vartype tags: azure.mgmt.resource.resources.v2024_07_01.operations.TagsOperations
+ :ivar deployment_operations: DeploymentOperationsOperations operations
+ :vartype deployment_operations:
+ azure.mgmt.resource.resources.v2024_07_01.operations.DeploymentOperationsOperations
+ :param credential: Credential needed for the client to connect to Azure. Required.
+ :type credential: ~azure.core.credentials.TokenCredential
+ :param subscription_id: The Microsoft Azure subscription ID. Required.
+ :type subscription_id: str
+ :param base_url: Service URL. Default value is "https://management.azure.com".
+ :type base_url: str
+ :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
+ default value may result in unsupported behavior.
+ :paramtype api_version: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential: "TokenCredential",
+ subscription_id: str,
+ base_url: str = "https://management.azure.com",
+ **kwargs: Any
+ ) -> None:
+ self._config = ResourceManagementClientConfiguration(
+ credential=credential, subscription_id=subscription_id, **kwargs
+ )
+ _policies = kwargs.pop("policies", None)
+ if _policies is None:
+ _policies = [
+ policies.RequestIdPolicy(**kwargs),
+ self._config.headers_policy,
+ self._config.user_agent_policy,
+ self._config.proxy_policy,
+ policies.ContentDecodePolicy(**kwargs),
+ ARMAutoResourceProviderRegistrationPolicy(),
+ self._config.redirect_policy,
+ self._config.retry_policy,
+ self._config.authentication_policy,
+ self._config.custom_hook_policy,
+ self._config.logging_policy,
+ policies.DistributedTracingPolicy(**kwargs),
+ 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)
+
+ client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+ self._serialize.client_side_validation = False
+ self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2024-07-01")
+ self.deployments = DeploymentsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.providers = ProvidersOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.provider_resource_types = ProviderResourceTypesOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.resources = ResourcesOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.resource_groups = ResourceGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-07-01")
+ self.deployment_operations = DeploymentOperationsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+
+ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
+ """Runs the network request through the client's chained policies.
+
+ >>> from azure.core.rest import HttpRequest
+ >>> request = HttpRequest("GET", "https://www.example.org/")
+
+ >>> response = client._send_request(request)
+
+
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
+
+ :param request: The network request you want to make. Required.
+ :type request: ~azure.core.rest.HttpRequest
+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
+ :return: The response of your network call. Does not do error handling on your response.
+ :rtype: ~azure.core.rest.HttpResponse
+ """
+
+ request_copy = deepcopy(request)
+ request_copy.url = self._client.format_url(request_copy.url)
+ return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
+
+ def close(self) -> None:
+ self._client.close()
+
+ def __enter__(self) -> Self:
+ self._client.__enter__()
+ return self
+
+ def __exit__(self, *exc_details: Any) -> None:
+ self._client.__exit__(*exc_details)
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_version.py
new file mode 100644
index 000000000000..e5754a47ce68
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/_version.py
@@ -0,0 +1,9 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/__init__.py
new file mode 100644
index 000000000000..f06ef4b18a05
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/__init__.py
@@ -0,0 +1,29 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._resource_management_client import ResourceManagementClient # type: ignore
+
+try:
+ from ._patch import __all__ as _patch_all
+ from ._patch import *
+except ImportError:
+ _patch_all = []
+from ._patch import patch_sdk as _patch_sdk
+
+__all__ = [
+ "ResourceManagementClient",
+]
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
+
+_patch_sdk()
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_configuration.py
new file mode 100644
index 000000000000..6425248d7bde
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_configuration.py
@@ -0,0 +1,64 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from typing import Any, TYPE_CHECKING
+
+from azure.core.pipeline import policies
+from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
+
+from .._version import VERSION
+
+if TYPE_CHECKING:
+ from azure.core.credentials_async import AsyncTokenCredential
+
+
+class ResourceManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
+ """Configuration for ResourceManagementClient.
+
+ Note that all parameters used to create this instance are saved as instance
+ attributes.
+
+ :param credential: Credential needed for the client to connect to Azure. Required.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param subscription_id: The Microsoft Azure subscription ID. Required.
+ :type subscription_id: str
+ :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
+ default value may result in unsupported behavior.
+ :paramtype api_version: str
+ """
+
+ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
+ api_version: str = kwargs.pop("api_version", "2024-07-01")
+
+ if credential is None:
+ raise ValueError("Parameter 'credential' must not be None.")
+ if subscription_id is None:
+ raise ValueError("Parameter 'subscription_id' must not be None.")
+
+ self.credential = credential
+ self.subscription_id = subscription_id
+ self.api_version = api_version
+ self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
+ kwargs.setdefault("sdk_moniker", "mgmt-resource/{}".format(VERSION))
+ self.polling_interval = kwargs.get("polling_interval", 30)
+ self._configure(**kwargs)
+
+ def _configure(self, **kwargs: Any) -> None:
+ self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
+ self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
+ self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
+ self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
+ self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
+ self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
+ self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
+ self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
+ self.authentication_policy = kwargs.get("authentication_policy")
+ if self.credential and not self.authentication_policy:
+ self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
+ self.credential, *self.credential_scopes, **kwargs
+ )
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_patch.py
new file mode 100644
index 000000000000..f7dd32510333
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_patch.py
@@ -0,0 +1,20 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_resource_management_client.py
new file mode 100644
index 000000000000..a588313d2849
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/_resource_management_client.py
@@ -0,0 +1,161 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from copy import deepcopy
+from typing import Any, Awaitable, TYPE_CHECKING
+from typing_extensions import Self
+
+from azure.core.pipeline import policies
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.mgmt.core import AsyncARMPipelineClient
+from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
+
+from .. import models as _models
+from ..._serialization import Deserializer, Serializer
+from ._configuration import ResourceManagementClientConfiguration
+from .operations import (
+ DeploymentOperationsOperations,
+ DeploymentsOperations,
+ Operations,
+ ProviderResourceTypesOperations,
+ ProvidersOperations,
+ ResourceGroupsOperations,
+ ResourcesOperations,
+ TagsOperations,
+)
+
+if TYPE_CHECKING:
+ from azure.core.credentials_async import AsyncTokenCredential
+
+
+class ResourceManagementClient: # pylint: disable=too-many-instance-attributes
+ """Provides operations for working with resources and resource groups.
+
+ :ivar operations: Operations operations
+ :vartype operations: azure.mgmt.resource.resources.v2024_07_01.aio.operations.Operations
+ :ivar deployments: DeploymentsOperations operations
+ :vartype deployments:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.DeploymentsOperations
+ :ivar providers: ProvidersOperations operations
+ :vartype providers:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.ProvidersOperations
+ :ivar provider_resource_types: ProviderResourceTypesOperations operations
+ :vartype provider_resource_types:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.ProviderResourceTypesOperations
+ :ivar resources: ResourcesOperations operations
+ :vartype resources:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.ResourcesOperations
+ :ivar resource_groups: ResourceGroupsOperations operations
+ :vartype resource_groups:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.ResourceGroupsOperations
+ :ivar tags: TagsOperations operations
+ :vartype tags: azure.mgmt.resource.resources.v2024_07_01.aio.operations.TagsOperations
+ :ivar deployment_operations: DeploymentOperationsOperations operations
+ :vartype deployment_operations:
+ azure.mgmt.resource.resources.v2024_07_01.aio.operations.DeploymentOperationsOperations
+ :param credential: Credential needed for the client to connect to Azure. Required.
+ :type credential: ~azure.core.credentials_async.AsyncTokenCredential
+ :param subscription_id: The Microsoft Azure subscription ID. Required.
+ :type subscription_id: str
+ :param base_url: Service URL. Default value is "https://management.azure.com".
+ :type base_url: str
+ :keyword api_version: Api Version. Default value is "2024-07-01". Note that overriding this
+ default value may result in unsupported behavior.
+ :paramtype api_version: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
+ """
+
+ def __init__(
+ self,
+ credential: "AsyncTokenCredential",
+ subscription_id: str,
+ base_url: str = "https://management.azure.com",
+ **kwargs: Any
+ ) -> None:
+ self._config = ResourceManagementClientConfiguration(
+ credential=credential, subscription_id=subscription_id, **kwargs
+ )
+ _policies = kwargs.pop("policies", None)
+ if _policies is None:
+ _policies = [
+ policies.RequestIdPolicy(**kwargs),
+ self._config.headers_policy,
+ self._config.user_agent_policy,
+ self._config.proxy_policy,
+ policies.ContentDecodePolicy(**kwargs),
+ AsyncARMAutoResourceProviderRegistrationPolicy(),
+ self._config.redirect_policy,
+ self._config.retry_policy,
+ self._config.authentication_policy,
+ self._config.custom_hook_policy,
+ self._config.logging_policy,
+ policies.DistributedTracingPolicy(**kwargs),
+ 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)
+
+ client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
+ self._serialize = Serializer(client_models)
+ self._deserialize = Deserializer(client_models)
+ self._serialize.client_side_validation = False
+ self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2024-07-01")
+ self.deployments = DeploymentsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.providers = ProvidersOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.provider_resource_types = ProviderResourceTypesOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.resources = ResourcesOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.resource_groups = ResourceGroupsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+ self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2024-07-01")
+ self.deployment_operations = DeploymentOperationsOperations(
+ self._client, self._config, self._serialize, self._deserialize, "2024-07-01"
+ )
+
+ def _send_request(
+ self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
+ ) -> Awaitable[AsyncHttpResponse]:
+ """Runs the network request through the client's chained policies.
+
+ >>> from azure.core.rest import HttpRequest
+ >>> request = HttpRequest("GET", "https://www.example.org/")
+
+ >>> response = await client._send_request(request)
+
+
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
+
+ :param request: The network request you want to make. Required.
+ :type request: ~azure.core.rest.HttpRequest
+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
+ :return: The response of your network call. Does not do error handling on your response.
+ :rtype: ~azure.core.rest.AsyncHttpResponse
+ """
+
+ request_copy = deepcopy(request)
+ request_copy.url = self._client.format_url(request_copy.url)
+ return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
+
+ async def close(self) -> None:
+ await self._client.close()
+
+ async def __aenter__(self) -> Self:
+ await self._client.__aenter__()
+ return self
+
+ async def __aexit__(self, *exc_details: Any) -> None:
+ await self._client.__aexit__(*exc_details)
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/__init__.py
new file mode 100644
index 000000000000..fc92299ca9cb
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/__init__.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # type: ignore
+
+from ._patch import __all__ as _patch_all
+from ._patch import *
+from ._patch import patch_sdk as _patch_sdk
+
+__all__ = [
+ "Operations",
+ "DeploymentsOperations",
+ "ProvidersOperations",
+ "ProviderResourceTypesOperations",
+ "ResourcesOperations",
+ "ResourceGroupsOperations",
+ "TagsOperations",
+ "DeploymentOperationsOperations",
+]
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
+_patch_sdk()
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_operations.py
new file mode 100644
index 000000000000..dd656485b4ea
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_operations.py
@@ -0,0 +1,9901 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+import sys
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ...operations._operations import (
+ build_deployment_operations_get_at_management_group_scope_request,
+ build_deployment_operations_get_at_scope_request,
+ build_deployment_operations_get_at_subscription_scope_request,
+ build_deployment_operations_get_at_tenant_scope_request,
+ build_deployment_operations_get_request,
+ build_deployment_operations_list_at_management_group_scope_request,
+ build_deployment_operations_list_at_scope_request,
+ build_deployment_operations_list_at_subscription_scope_request,
+ build_deployment_operations_list_at_tenant_scope_request,
+ build_deployment_operations_list_request,
+ build_deployments_calculate_template_hash_request,
+ build_deployments_cancel_at_management_group_scope_request,
+ build_deployments_cancel_at_scope_request,
+ build_deployments_cancel_at_subscription_scope_request,
+ build_deployments_cancel_at_tenant_scope_request,
+ build_deployments_cancel_request,
+ build_deployments_check_existence_at_management_group_scope_request,
+ build_deployments_check_existence_at_scope_request,
+ build_deployments_check_existence_at_subscription_scope_request,
+ build_deployments_check_existence_at_tenant_scope_request,
+ build_deployments_check_existence_request,
+ build_deployments_create_or_update_at_management_group_scope_request,
+ build_deployments_create_or_update_at_scope_request,
+ build_deployments_create_or_update_at_subscription_scope_request,
+ build_deployments_create_or_update_at_tenant_scope_request,
+ build_deployments_create_or_update_request,
+ build_deployments_delete_at_management_group_scope_request,
+ build_deployments_delete_at_scope_request,
+ build_deployments_delete_at_subscription_scope_request,
+ build_deployments_delete_at_tenant_scope_request,
+ build_deployments_delete_request,
+ build_deployments_export_template_at_management_group_scope_request,
+ build_deployments_export_template_at_scope_request,
+ build_deployments_export_template_at_subscription_scope_request,
+ build_deployments_export_template_at_tenant_scope_request,
+ build_deployments_export_template_request,
+ build_deployments_get_at_management_group_scope_request,
+ build_deployments_get_at_scope_request,
+ build_deployments_get_at_subscription_scope_request,
+ build_deployments_get_at_tenant_scope_request,
+ build_deployments_get_request,
+ build_deployments_list_at_management_group_scope_request,
+ build_deployments_list_at_scope_request,
+ build_deployments_list_at_subscription_scope_request,
+ build_deployments_list_at_tenant_scope_request,
+ build_deployments_list_by_resource_group_request,
+ build_deployments_validate_at_management_group_scope_request,
+ build_deployments_validate_at_scope_request,
+ build_deployments_validate_at_subscription_scope_request,
+ build_deployments_validate_at_tenant_scope_request,
+ build_deployments_validate_request,
+ build_deployments_what_if_at_management_group_scope_request,
+ build_deployments_what_if_at_subscription_scope_request,
+ build_deployments_what_if_at_tenant_scope_request,
+ build_deployments_what_if_request,
+ build_operations_list_request,
+ build_provider_resource_types_list_request,
+ build_providers_get_at_tenant_scope_request,
+ build_providers_get_request,
+ build_providers_list_at_tenant_scope_request,
+ build_providers_list_request,
+ build_providers_provider_permissions_request,
+ build_providers_register_at_management_group_scope_request,
+ build_providers_register_request,
+ build_providers_unregister_request,
+ build_resource_groups_check_existence_request,
+ build_resource_groups_create_or_update_request,
+ build_resource_groups_delete_request,
+ build_resource_groups_export_template_request,
+ build_resource_groups_get_request,
+ build_resource_groups_list_request,
+ build_resource_groups_update_request,
+ build_resources_check_existence_by_id_request,
+ build_resources_check_existence_request,
+ build_resources_create_or_update_by_id_request,
+ build_resources_create_or_update_request,
+ build_resources_delete_by_id_request,
+ build_resources_delete_request,
+ build_resources_get_by_id_request,
+ build_resources_get_request,
+ build_resources_list_by_resource_group_request,
+ build_resources_list_request,
+ build_resources_move_resources_request,
+ build_resources_update_by_id_request,
+ build_resources_update_request,
+ build_resources_validate_move_resources_request,
+ build_tags_create_or_update_at_scope_request,
+ build_tags_create_or_update_request,
+ build_tags_create_or_update_value_request,
+ build_tags_delete_at_scope_request,
+ build_tags_delete_request,
+ build_tags_delete_value_request,
+ build_tags_get_at_scope_request,
+ build_tags_list_request,
+ build_tags_update_at_scope_request,
+)
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+
+
+class Operations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`operations` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
+ """Lists all of the available Microsoft.Resources REST API operations.
+
+ :return: An iterator like instance of either Operation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Operation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_operations_list_request(
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("OperationListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+
+class DeploymentsOperations: # pylint: disable=too-many-public-methods
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`deployments` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ async def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _create_or_update_at_scope_initial(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_at_scope(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def cancel_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _validate_at_scope_initial(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate_at_scope(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def export_template_at_scope(
+ self, scope: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_scope(
+ self, scope: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentExtended"]:
+ """Get all the deployments at the given scope.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_scope_request(
+ scope=scope,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_create_or_update_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a
+ ScopedDeployment type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _validate_at_tenant_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_validate_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeployment type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _what_if_at_tenant_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_what_if_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_what_if_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_what_if_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeploymentWhatIf type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._what_if_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def export_template_at_tenant_scope(
+ self, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_tenant_scope(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentExtended"]:
+ """Get all the deployments at the tenant scope.
+
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_tenant_scope_request(
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_at_management_group_scope(
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def check_existence_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> bool:
+ """Checks whether the deployment exists.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_create_or_update_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a
+ ScopedDeployment type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_at_management_group_scope(
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def cancel_at_management_group_scope(self, group_id: str, deployment_name: str, **kwargs: Any) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_validate_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate_at_management_group_scope(
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeployment type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeploymentWhatIf type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._what_if_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def export_template_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_management_group_scope(
+ self, group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a management group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_management_group_scope_request(
+ group_id=group_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def cancel_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _validate_at_subscription_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate_at_subscription_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate_at_subscription_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate_at_subscription_scope(
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _what_if_at_subscription_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "DeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_what_if_at_subscription_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.DeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_what_if_at_subscription_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_what_if_at_subscription_scope(
+ self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Is either a DeploymentWhatIf type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._what_if_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def export_template_at_subscription_scope(
+ self, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_subscription_scope(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a subscription.
+
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_subscription_scope_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _delete_initial(
+ self, resource_group_name: str, deployment_name: str, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. Deleting a template deployment does
+ not affect the state of the resource group. This is an asynchronous operation that returns a
+ status of 202 until the template deployment is successfully deleted. The Location response
+ header contains the URI that is used to obtain the status of the process. While the process is
+ running, a call to the URI in the Location header returns a status of 202. When the process
+ finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param resource_group_name: The name of the resource group with the deployment to delete. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def check_existence(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param resource_group_name: The name of the resource group with the deployment to check. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def cancel(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resource group
+ partially deployed.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ async def _validate_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either DeploymentExtended or An instance of
+ AsyncLROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _what_if_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "DeploymentWhatIf")
+
+ _request = build_deployments_what_if_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.DeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a DeploymentWhatIf type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either WhatIfOperationResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._what_if_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def export_template(
+ self, resource_group_name: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_resource_group(
+ self, resource_group_name: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a resource group.
+
+ :param resource_group_name: The name of the resource group with the deployments to get. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.TemplateHashResult:
+ """Calculate the hash of the given template.
+
+ :param template: The template provided to calculate hash. Required.
+ :type template: JSON
+ :return: TemplateHashResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateHashResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
+ cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None)
+
+ _json = self._serialize.body(template, "object")
+
+ _request = build_deployments_calculate_template_hash_request(
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TemplateHashResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ProvidersOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`providers` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace_async
+ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider:
+ """Unregisters a subscription from a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to unregister.
+ Required.
+ :type resource_provider_namespace: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_unregister_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def register_at_management_group_scope(
+ self, resource_provider_namespace: str, group_id: str, **kwargs: Any
+ ) -> None:
+ """Registers a management group with a resource provider. Use this operation to register a
+ resource provider with resource types that can be deployed at the management group scope. It
+ does not recursively register subscriptions within the management group. Instead, you must
+ register subscriptions individually.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_providers_register_at_management_group_scope_request(
+ resource_provider_namespace=resource_provider_namespace,
+ group_id=group_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace_async
+ async def provider_permissions(
+ self, resource_provider_namespace: str, **kwargs: Any
+ ) -> _models.ProviderPermissionListResult:
+ """Get the provider permissions.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :return: ProviderPermissionListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderPermissionListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None)
+
+ _request = build_providers_provider_permissions_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ProviderPermissionListResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[_models.ProviderRegistrationRequest] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Default value is None.
+ :type properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderRegistrationRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Default value is None.
+ :type properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[Union[_models.ProviderRegistrationRequest, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Is either a ProviderRegistrationRequest
+ type or a IO[bytes] type. Default value is None.
+ :type properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderRegistrationRequest
+ or IO[bytes]
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(properties, (IOBase, bytes)):
+ _content = properties
+ else:
+ if properties is not None:
+ _json = self._serialize.body(properties, "ProviderRegistrationRequest")
+ else:
+ _json = None
+
+ _request = build_providers_register_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Provider"]:
+ """Gets all resource providers for a subscription.
+
+ :param expand: The properties to include in the results. For example, use &$expand=metadata in
+ the query string to retrieve resource provider metadata. To include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: An iterator like instance of either Provider or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_providers_list_request(
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProviderListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Provider"]:
+ """Gets all resource providers for the tenant.
+
+ :param expand: The properties to include in the results. For example, use &$expand=metadata in
+ the query string to retrieve resource provider metadata. To include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: An iterator like instance of either Provider or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_providers_list_at_tenant_scope_request(
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProviderListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get(
+ self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.Provider:
+ """Gets the specified resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_get_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def get_at_tenant_scope(
+ self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.Provider:
+ """Gets the specified resource provider at the tenant level.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_get_at_tenant_scope_request(
+ resource_provider_namespace=resource_provider_namespace,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ProviderResourceTypesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`provider_resource_types` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace_async
+ async def list(
+ self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.ProviderResourceTypeListResult:
+ """List the resource types for a specified resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: ProviderResourceTypeListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderResourceTypeListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None)
+
+ _request = build_provider_resource_types_list_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ProviderResourceTypeListResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ResourcesOperations: # pylint: disable=too-many-public-methods
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`resources` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def list_by_resource_group(
+ self,
+ resource_group_name: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
+ ) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
+ """Get all the resources for a resource group.
+
+ :param resource_group_name: The resource group with the resources to get. Required.
+ :type resource_group_name: str
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
+ can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,
+ identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,
+ and plan/promotionCode.:code:`
`:code:`
`For example, to filter by a resource type, use:
+ $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`
`:code:`
`You can use
+ substringof(value, property) in the filter. The properties you can use for substring are: name
+ and resourceGroup.:code:`
`:code:`
`For example, to get all resources with 'demo'
+ anywhere in the name, use: $filter=substringof('demo', name):code:`
`:code:`
`You can
+ link more than one substringof together by adding and/or operators.:code:`
`:code:`
`You
+ can filter by tag names and values. For example, to filter for a tag name and value, use
+ $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,
+ the tags for each resource are not returned in the results.:code:`
`:code:`
`You can use
+ some properties together when filtering. The combinations you can use are: substringof and/or
+ resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default
+ value is None.
+ :type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For
+ example, ``$expand=createdTime,changedTime``. Default value is None.
+ :type expand: str
+ :param top: The number of results to return. If null is passed, returns all resources. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either GenericResourceExpanded or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resources_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ expand=expand,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _move_resources_initial(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourcesMoveInfo")
+
+ _request = build_resources_move_resources_request(
+ source_resource_group_name=source_resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: _models.ResourcesMoveInfo,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_move_resources(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Is either a ResourcesMoveInfo type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._move_resources_initial(
+ source_resource_group_name=source_resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ async def _validate_move_resources_initial(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourcesMoveInfo")
+
+ _request = build_resources_validate_move_resources_request(
+ source_resource_group_name=source_resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_validate_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: _models.ResourcesMoveInfo,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_validate_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_validate_move_resources(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Is either a ResourcesMoveInfo type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._validate_move_resources_initial(
+ source_resource_group_name=source_resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list(
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.GenericResourceExpanded"]:
+ # pylint: disable=line-too-long
+ """Get all the resources in a subscription.
+
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`Filter comparison
+ operators include ``eq`` (equals) and ``ne`` (not equals) and may be used with the following
+ properties: ``location``\\ , ``resourceType``\\ , ``name``\\ , ``resourceGroup``\\ ,
+ ``identity``\\ , ``identity/principalId``\\ , ``plan``\\ , ``plan/publisher``\\ ,
+ ``plan/product``\\ , ``plan/name``\\ , ``plan/version``\\ , and
+ ``plan/promotionCode``.:code:`
`:code:`
`For example, to filter by a resource type, use
+ ``$filter=resourceType eq 'Microsoft.Network/virtualNetworks'``\\
+ :code:`
`:code:`
`:code:`
`\\ ``substringof(value, property)`` can be used to filter
+ for substrings of the following currently-supported properties: ``name`` and
+ ``resourceGroup``\\ :code:`
`:code:`
`For example, to get all resources with 'demo'
+ anywhere in the resource name, use ``$filter=substringof('demo', name)``\\
+ :code:`
`:code:`
`Multiple substring operations can also be combined using ``and``\\ /\\
+ ``or`` operators.:code:`
`:code:`
`Note that any truncated number of results queried via
+ ``$top`` may also not be compatible when using a
+ filter.:code:`
`:code:`
`:code:`
`Resources can be filtered by tag names and values.
+ For example, to filter for a tag name and value, use ``$filter=tagName eq 'tag1' and tagValue
+ eq 'Value1'``. Note that when resources are filtered by tag name and value, :code:`the
+ original tags for each resource will not be returned in the results.` Any list of
+ additional properties queried via ``$expand`` may also not be compatible when filtering by tag
+ names/values. :code:`
`:code:`
`For tag names only, resources can be filtered by prefix
+ using the following syntax: ``$filter=startswith(tagName, 'depart')``. This query will return
+ all resources with a tag name prefixed by the phrase ``depart`` (i.e.\\ ``department``\\ ,
+ ``departureDate``\\ , ``departureTime``\\ , etc.):code:`
`:code:`
`:code:`
`Note that
+ some properties can be combined when filtering resources, which include the following:
+ ``substringof() and/or resourceType``\\ , ``plan and plan/publisher and plan/name``\\ , and
+ ``identity and identity/principalId``. Default value is None.
+ :type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For
+ example, ``$expand=createdTime,changedTime``. Default value is None.
+ :type expand: str
+ :param top: The number of recommendations per page if a paged version of this API is being
+ used. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either GenericResourceExpanded or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resources_list_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ expand=expand,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def check_existence(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> bool:
+ """Checks whether a resource exists.
+
+ :param resource_group_name: The name of the resource group containing the resource to check.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The resource provider of the resource to check. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to check whether it exists. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resources_check_existence_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _delete_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resources_delete_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Deletes a resource.
+
+ :param resource_group_name: The name of the resource group that contains the resource to
+ delete. The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to delete. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ async def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_create_or_update_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Is either a
+ GenericResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _update_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_update_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Is either a GenericResource type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> _models.GenericResource:
+ """Gets a resource.
+
+ :param resource_group_name: The name of the resource group containing the resource to get. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to get. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: GenericResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+
+ _request = build_resources_get_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
+ """Checks by ID whether a resource exists. This API currently works only for a limited set of
+ Resource providers. In the event that a Resource provider does not implement this API, ARM will
+ respond with a 405. The alternative then is to use the GET API to check for the existence of
+ the resource.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resources_check_existence_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ async def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resources_delete_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ # pylint: disable=line-too-long
+ """Deletes a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ async def _create_or_update_by_id_initial(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_create_or_update_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_by_id(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Is either a GenericResource type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _update_by_id_initial(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_update_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_update_by_id(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Is either a GenericResource type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._update_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
+ """Gets a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: GenericResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+
+ _request = build_resources_get_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ResourceGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`resource_groups` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace_async
+ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
+ """Checks whether a resource group exists.
+
+ :param resource_group_name: The name of the resource group to check. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_check_existence_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ parameters: _models.ResourceGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def create_or_update(
+ self, resource_group_name: str, parameters: Union[_models.ResourceGroup, IO[bytes]], **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Is either a
+ ResourceGroup type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup or IO[bytes]
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourceGroup")
+
+ _request = build_resource_groups_create_or_update_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ async def _delete_initial(
+ self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_delete_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ force_deletion_types=force_deletion_types,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["location"] = self._deserialize("str", response.headers.get("location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete(
+ self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Deletes a resource group.
+
+ When you delete a resource group, all of its resources are also deleted. Deleting a resource
+ group deletes all of its template deployments and currently stored operations.
+
+ :param resource_group_name: The name of the resource group to delete. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param force_deletion_types: The resource types you want to force delete. Currently, only the
+ following is supported:
+ forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets.
+ Default value is None.
+ :type force_deletion_types: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_initial(
+ resource_group_name=resource_group_name,
+ force_deletion_types=force_deletion_types,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace_async
+ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
+ """Gets a resource group.
+
+ :param resource_group_name: The name of the resource group to get. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_get_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def update(
+ self,
+ resource_group_name: str,
+ parameters: _models.ResourceGroupPatchable,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupPatchable
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def update(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def update(
+ self, resource_group_name: str, parameters: Union[_models.ResourceGroupPatchable, IO[bytes]], **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Is either a
+ ResourceGroupPatchable type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupPatchable or
+ IO[bytes]
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourceGroupPatchable")
+
+ _request = build_resource_groups_update_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ async def _export_template_initial(
+ self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ExportTemplateRequest")
+
+ _request = build_resource_groups_export_template_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_export_template(
+ self,
+ resource_group_name: str,
+ parameters: _models.ExportTemplateRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_export_template(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_export_template(
+ self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Is either a ExportTemplateRequest
+ type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateRequest or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either ResourceGroupExportResult or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._export_template_initial(
+ resource_group_name=resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("ResourceGroupExportResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.ResourceGroupExportResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.ResourceGroupExportResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def list(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.ResourceGroup"]:
+ """Gets all the resource groups for a subscription.
+
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`You can filter by
+ tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq
+ 'tag1' and tagValue eq 'Value1'. Default value is None.
+ :type filter: str
+ :param top: The number of results to return. If null is passed, returns all resource groups.
+ Default value is None.
+ :type top: int
+ :return: An iterator like instance of either ResourceGroup or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resource_groups_list_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceGroupListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+
+class TagsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`tags` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace_async
+ async def delete_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> None:
+ """Deletes a predefined tag value for a predefined tag name.
+
+ This operation allows deleting a value from the list of predefined values for an existing
+ predefined tag name. The value being deleted must not be in use as a tag value for the given
+ tag name for any resource.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :param tag_value: The value of the tag to delete. Required.
+ :type tag_value: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_value_request(
+ tag_name=tag_name,
+ tag_value=tag_value,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace_async
+ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> _models.TagValue:
+ """Creates a predefined value for a predefined tag name.
+
+ This operation allows adding a value to the list of predefined values for an existing
+ predefined tag name. A tag value can have a maximum of 256 characters.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :param tag_value: The value of the tag to create. Required.
+ :type tag_value: str
+ :return: TagValue or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagValue
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagValue] = kwargs.pop("cls", None)
+
+ _request = build_tags_create_or_update_value_request(
+ tag_name=tag_name,
+ tag_value=tag_value,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagValue", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
+ """Creates a predefined tag name.
+
+ This operation allows adding a name to the list of predefined tag names for the given
+ subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag
+ names cannot have the following prefixes which are reserved for Azure use: 'microsoft',
+ 'azure', 'windows'.
+
+ :param tag_name: The name of the tag to create. Required.
+ :type tag_name: str
+ :return: TagDetails or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None)
+
+ _request = build_tags_create_or_update_request(
+ tag_name=tag_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagDetails", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def delete(self, tag_name: str, **kwargs: Any) -> None:
+ """Deletes a predefined tag name.
+
+ This operation allows deleting a name from the list of predefined tag names for the given
+ subscription. The name being deleted must not be in use as a tag name for any resource. All
+ predefined values for the given name must have already been deleted.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_request(
+ tag_name=tag_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]:
+ """Gets a summary of tag usage under the subscription.
+
+ This operation performs a union of predefined tags, resource tags, resource group tags and
+ subscription tags, and returns a summary of usage for each tag name and value under the given
+ subscription. In case of a large number of tags, this operation may return a previously cached
+ result.
+
+ :return: An iterator like instance of either TagDetails or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_tags_list_request(
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("TagsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ async def _create_or_update_at_scope_initial(
+ self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "TagsResource")
+
+ _request = build_tags_create_or_update_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update_at_scope(
+ self, scope: str, parameters: _models.TagsResource, *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update_at_scope(
+ self, scope: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update_at_scope(
+ self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Is either a TagsResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_at_scope_initial(
+ scope=scope,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.TagsResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.TagsResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _update_at_scope_initial(
+ self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "TagsPatchResource")
+
+ _request = build_tags_update_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_update_at_scope(
+ self,
+ scope: str,
+ parameters: _models.TagsPatchResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_update_at_scope(
+ self, scope: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_update_at_scope(
+ self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
+ ) -> AsyncLROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Is either a TagsPatchResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchResource or
+ IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._update_at_scope_initial(
+ scope=scope,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.TagsResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.TagsResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
+ """Gets the entire set of tags on a resource or subscription.
+
+ Gets the entire set of tags on a resource or subscription.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :return: TagsResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+
+ _request = build_tags_get_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ async def _delete_at_scope_initial(self, scope: str, **kwargs: Any) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace_async
+ async def begin_delete_at_scope(self, scope: str, **kwargs: Any) -> AsyncLROPoller[None]:
+ """Deletes the entire set of tags on a resource or subscription.
+
+ Deletes the entire set of tags on a resource or subscription.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._delete_at_scope_initial(
+ scope=scope, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+
+class DeploymentOperationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.aio.ResourceManagementClient`'s
+ :attr:`deployment_operations` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace_async
+ async def get_at_scope(
+ self, scope: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_scope(
+ self, scope: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get_at_tenant_scope(
+ self, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_tenant_scope(
+ self, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get_at_management_group_scope(
+ self, group_id: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_management_group_scope(
+ self, group_id: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get_at_subscription_scope(
+ self, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_subscription_scope(
+ self, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list(
+ self, resource_group_name: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> AsyncIterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_patch.py
new file mode 100644
index 000000000000..f7dd32510333
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/aio/operations/_patch.py
@@ -0,0 +1,20 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/__init__.py
new file mode 100644
index 000000000000..9eb80bf3ebc9
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/__init__.py
@@ -0,0 +1,236 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ Alias,
+ AliasPath,
+ AliasPathMetadata,
+ AliasPattern,
+ ApiProfile,
+ BasicDependency,
+ DebugSetting,
+ Dependency,
+ Deployment,
+ DeploymentDiagnosticsDefinition,
+ DeploymentExportResult,
+ DeploymentExtended,
+ DeploymentExtendedFilter,
+ DeploymentListResult,
+ DeploymentOperation,
+ DeploymentOperationProperties,
+ DeploymentOperationsListResult,
+ DeploymentParameter,
+ DeploymentProperties,
+ DeploymentPropertiesExtended,
+ DeploymentValidationError,
+ DeploymentWhatIf,
+ DeploymentWhatIfProperties,
+ DeploymentWhatIfSettings,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ExportTemplateRequest,
+ ExpressionEvaluationOptions,
+ ExtendedLocation,
+ GenericResource,
+ GenericResourceExpanded,
+ GenericResourceFilter,
+ HttpMessage,
+ Identity,
+ IdentityUserAssignedIdentitiesValue,
+ KeyVaultParameterReference,
+ KeyVaultReference,
+ OnErrorDeployment,
+ OnErrorDeploymentExtended,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ ParametersLink,
+ Permission,
+ Plan,
+ Provider,
+ ProviderConsentDefinition,
+ ProviderExtendedLocation,
+ ProviderListResult,
+ ProviderPermission,
+ ProviderPermissionListResult,
+ ProviderRegistrationRequest,
+ ProviderResourceType,
+ ProviderResourceTypeListResult,
+ Resource,
+ ResourceGroup,
+ ResourceGroupExportResult,
+ ResourceGroupFilter,
+ ResourceGroupListResult,
+ ResourceGroupPatchable,
+ ResourceGroupProperties,
+ ResourceListResult,
+ ResourceProviderOperationDisplayProperties,
+ ResourceReference,
+ ResourcesMoveInfo,
+ RoleDefinition,
+ ScopedDeployment,
+ ScopedDeploymentWhatIf,
+ Sku,
+ StatusMessage,
+ SubResource,
+ TagCount,
+ TagDetails,
+ TagValue,
+ Tags,
+ TagsListResult,
+ TagsPatchResource,
+ TagsResource,
+ TargetResource,
+ TemplateHashResult,
+ TemplateLink,
+ WhatIfChange,
+ WhatIfOperationResult,
+ WhatIfPropertyChange,
+ ZoneMapping,
+)
+
+from ._resource_management_client_enums import ( # type: ignore
+ AliasPathAttributes,
+ AliasPathTokenType,
+ AliasPatternType,
+ AliasType,
+ ChangeType,
+ DeploymentMode,
+ ExportTemplateOutputFormat,
+ ExpressionEvaluationOptionsScopeType,
+ ExtendedLocationType,
+ Level,
+ OnErrorDeploymentType,
+ PropertyChangeType,
+ ProviderAuthorizationConsentState,
+ ProvisioningOperation,
+ ProvisioningState,
+ ResourceIdentityType,
+ TagsPatchOperation,
+ WhatIfResultFormat,
+)
+from ._patch import __all__ as _patch_all
+from ._patch import *
+from ._patch import patch_sdk as _patch_sdk
+
+__all__ = [
+ "Alias",
+ "AliasPath",
+ "AliasPathMetadata",
+ "AliasPattern",
+ "ApiProfile",
+ "BasicDependency",
+ "DebugSetting",
+ "Dependency",
+ "Deployment",
+ "DeploymentDiagnosticsDefinition",
+ "DeploymentExportResult",
+ "DeploymentExtended",
+ "DeploymentExtendedFilter",
+ "DeploymentListResult",
+ "DeploymentOperation",
+ "DeploymentOperationProperties",
+ "DeploymentOperationsListResult",
+ "DeploymentParameter",
+ "DeploymentProperties",
+ "DeploymentPropertiesExtended",
+ "DeploymentValidationError",
+ "DeploymentWhatIf",
+ "DeploymentWhatIfProperties",
+ "DeploymentWhatIfSettings",
+ "ErrorAdditionalInfo",
+ "ErrorDetail",
+ "ErrorResponse",
+ "ExportTemplateRequest",
+ "ExpressionEvaluationOptions",
+ "ExtendedLocation",
+ "GenericResource",
+ "GenericResourceExpanded",
+ "GenericResourceFilter",
+ "HttpMessage",
+ "Identity",
+ "IdentityUserAssignedIdentitiesValue",
+ "KeyVaultParameterReference",
+ "KeyVaultReference",
+ "OnErrorDeployment",
+ "OnErrorDeploymentExtended",
+ "Operation",
+ "OperationDisplay",
+ "OperationListResult",
+ "ParametersLink",
+ "Permission",
+ "Plan",
+ "Provider",
+ "ProviderConsentDefinition",
+ "ProviderExtendedLocation",
+ "ProviderListResult",
+ "ProviderPermission",
+ "ProviderPermissionListResult",
+ "ProviderRegistrationRequest",
+ "ProviderResourceType",
+ "ProviderResourceTypeListResult",
+ "Resource",
+ "ResourceGroup",
+ "ResourceGroupExportResult",
+ "ResourceGroupFilter",
+ "ResourceGroupListResult",
+ "ResourceGroupPatchable",
+ "ResourceGroupProperties",
+ "ResourceListResult",
+ "ResourceProviderOperationDisplayProperties",
+ "ResourceReference",
+ "ResourcesMoveInfo",
+ "RoleDefinition",
+ "ScopedDeployment",
+ "ScopedDeploymentWhatIf",
+ "Sku",
+ "StatusMessage",
+ "SubResource",
+ "TagCount",
+ "TagDetails",
+ "TagValue",
+ "Tags",
+ "TagsListResult",
+ "TagsPatchResource",
+ "TagsResource",
+ "TargetResource",
+ "TemplateHashResult",
+ "TemplateLink",
+ "WhatIfChange",
+ "WhatIfOperationResult",
+ "WhatIfPropertyChange",
+ "ZoneMapping",
+ "AliasPathAttributes",
+ "AliasPathTokenType",
+ "AliasPatternType",
+ "AliasType",
+ "ChangeType",
+ "DeploymentMode",
+ "ExportTemplateOutputFormat",
+ "ExpressionEvaluationOptionsScopeType",
+ "ExtendedLocationType",
+ "Level",
+ "OnErrorDeploymentType",
+ "PropertyChangeType",
+ "ProviderAuthorizationConsentState",
+ "ProvisioningOperation",
+ "ProvisioningState",
+ "ResourceIdentityType",
+ "TagsPatchOperation",
+ "WhatIfResultFormat",
+]
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
+_patch_sdk()
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_models_py3.py
new file mode 100644
index 000000000000..df4fb4e8aac8
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_models_py3.py
@@ -0,0 +1,3809 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# 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, Dict, List, 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
+
+if TYPE_CHECKING:
+ from .. import models as _models
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+
+
+class Alias(_serialization.Model):
+ """The alias type.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar name: The alias name.
+ :vartype name: str
+ :ivar paths: The paths for an alias.
+ :vartype paths: list[~azure.mgmt.resource.resources.v2024_07_01.models.AliasPath]
+ :ivar type: The type of the alias. Known values are: "NotSpecified", "PlainText", and "Mask".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.AliasType
+ :ivar default_path: The default path for an alias.
+ :vartype default_path: str
+ :ivar default_pattern: The default pattern for an alias.
+ :vartype default_pattern: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPattern
+ :ivar default_metadata: The default alias path metadata. Applies to the default path and to any
+ alias path that doesn't have metadata.
+ :vartype default_metadata: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPathMetadata
+ """
+
+ _validation = {
+ "default_metadata": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "paths": {"key": "paths", "type": "[AliasPath]"},
+ "type": {"key": "type", "type": "str"},
+ "default_path": {"key": "defaultPath", "type": "str"},
+ "default_pattern": {"key": "defaultPattern", "type": "AliasPattern"},
+ "default_metadata": {"key": "defaultMetadata", "type": "AliasPathMetadata"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ paths: Optional[List["_models.AliasPath"]] = None,
+ type: Optional[Union[str, "_models.AliasType"]] = None,
+ default_path: Optional[str] = None,
+ default_pattern: Optional["_models.AliasPattern"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The alias name.
+ :paramtype name: str
+ :keyword paths: The paths for an alias.
+ :paramtype paths: list[~azure.mgmt.resource.resources.v2024_07_01.models.AliasPath]
+ :keyword type: The type of the alias. Known values are: "NotSpecified", "PlainText", and
+ "Mask".
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.AliasType
+ :keyword default_path: The default path for an alias.
+ :paramtype default_path: str
+ :keyword default_pattern: The default pattern for an alias.
+ :paramtype default_pattern: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPattern
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.paths = paths
+ self.type = type
+ self.default_path = default_path
+ self.default_pattern = default_pattern
+ self.default_metadata = None
+
+
+class AliasPath(_serialization.Model):
+ """The type of the paths for alias.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar path: The path of an alias.
+ :vartype path: str
+ :ivar api_versions: The API versions.
+ :vartype api_versions: list[str]
+ :ivar pattern: The pattern for an alias path.
+ :vartype pattern: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPattern
+ :ivar metadata: The metadata of the alias path. If missing, fall back to the default metadata
+ of the alias.
+ :vartype metadata: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPathMetadata
+ """
+
+ _validation = {
+ "metadata": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "path": {"key": "path", "type": "str"},
+ "api_versions": {"key": "apiVersions", "type": "[str]"},
+ "pattern": {"key": "pattern", "type": "AliasPattern"},
+ "metadata": {"key": "metadata", "type": "AliasPathMetadata"},
+ }
+
+ def __init__(
+ self,
+ *,
+ path: Optional[str] = None,
+ api_versions: Optional[List[str]] = None,
+ pattern: Optional["_models.AliasPattern"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword path: The path of an alias.
+ :paramtype path: str
+ :keyword api_versions: The API versions.
+ :paramtype api_versions: list[str]
+ :keyword pattern: The pattern for an alias path.
+ :paramtype pattern: ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPattern
+ """
+ super().__init__(**kwargs)
+ self.path = path
+ self.api_versions = api_versions
+ self.pattern = pattern
+ self.metadata = None
+
+
+class AliasPathMetadata(_serialization.Model):
+ """AliasPathMetadata.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar type: The type of the token that the alias path is referring to. Known values are:
+ "NotSpecified", "Any", "String", "Object", "Array", "Integer", "Number", and "Boolean".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPathTokenType
+ :ivar attributes: The attributes of the token that the alias path is referring to. Known values
+ are: "None" and "Modifiable".
+ :vartype attributes: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPathAttributes
+ """
+
+ _validation = {
+ "type": {"readonly": True},
+ "attributes": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "attributes": {"key": "attributes", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.type = None
+ self.attributes = None
+
+
+class AliasPattern(_serialization.Model):
+ """The type of the pattern for an alias path.
+
+ :ivar phrase: The alias pattern phrase.
+ :vartype phrase: str
+ :ivar variable: The alias pattern variable.
+ :vartype variable: str
+ :ivar type: The type of alias pattern. Known values are: "NotSpecified" and "Extract".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPatternType
+ """
+
+ _attribute_map = {
+ "phrase": {"key": "phrase", "type": "str"},
+ "variable": {"key": "variable", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ phrase: Optional[str] = None,
+ variable: Optional[str] = None,
+ type: Optional[Union[str, "_models.AliasPatternType"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword phrase: The alias pattern phrase.
+ :paramtype phrase: str
+ :keyword variable: The alias pattern variable.
+ :paramtype variable: str
+ :keyword type: The type of alias pattern. Known values are: "NotSpecified" and "Extract".
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.AliasPatternType
+ """
+ super().__init__(**kwargs)
+ self.phrase = phrase
+ self.variable = variable
+ self.type = type
+
+
+class ApiProfile(_serialization.Model):
+ """ApiProfile.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar profile_version: The profile version.
+ :vartype profile_version: str
+ :ivar api_version: The API version.
+ :vartype api_version: str
+ """
+
+ _validation = {
+ "profile_version": {"readonly": True},
+ "api_version": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "profile_version": {"key": "profileVersion", "type": "str"},
+ "api_version": {"key": "apiVersion", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.profile_version = None
+ self.api_version = None
+
+
+class BasicDependency(_serialization.Model):
+ """Deployment dependency information.
+
+ :ivar id: The ID of the dependency.
+ :vartype id: str
+ :ivar resource_type: The dependency resource type.
+ :vartype resource_type: str
+ :ivar resource_name: The dependency resource name.
+ :vartype resource_name: str
+ """
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "resource_name": {"key": "resourceName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ resource_type: Optional[str] = None,
+ resource_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword id: The ID of the dependency.
+ :paramtype id: str
+ :keyword resource_type: The dependency resource type.
+ :paramtype resource_type: str
+ :keyword resource_name: The dependency resource name.
+ :paramtype resource_name: str
+ """
+ super().__init__(**kwargs)
+ self.id = id
+ self.resource_type = resource_type
+ self.resource_name = resource_name
+
+
+class DebugSetting(_serialization.Model):
+ """The debug setting.
+
+ :ivar detail_level: Specifies the type of information to log for debugging. The permitted
+ values are none, requestContent, responseContent, or both requestContent and responseContent
+ separated by a comma. The default is none. When setting this value, carefully consider the type
+ of information you are passing in during deployment. By logging information about the request
+ or response, you could potentially expose sensitive data that is retrieved through the
+ deployment operations.
+ :vartype detail_level: str
+ """
+
+ _attribute_map = {
+ "detail_level": {"key": "detailLevel", "type": "str"},
+ }
+
+ def __init__(self, *, detail_level: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword detail_level: Specifies the type of information to log for debugging. The permitted
+ values are none, requestContent, responseContent, or both requestContent and responseContent
+ separated by a comma. The default is none. When setting this value, carefully consider the type
+ of information you are passing in during deployment. By logging information about the request
+ or response, you could potentially expose sensitive data that is retrieved through the
+ deployment operations.
+ :paramtype detail_level: str
+ """
+ super().__init__(**kwargs)
+ self.detail_level = detail_level
+
+
+class Dependency(_serialization.Model):
+ """Deployment dependency information.
+
+ :ivar depends_on: The list of dependencies.
+ :vartype depends_on: list[~azure.mgmt.resource.resources.v2024_07_01.models.BasicDependency]
+ :ivar id: The ID of the dependency.
+ :vartype id: str
+ :ivar resource_type: The dependency resource type.
+ :vartype resource_type: str
+ :ivar resource_name: The dependency resource name.
+ :vartype resource_name: str
+ """
+
+ _attribute_map = {
+ "depends_on": {"key": "dependsOn", "type": "[BasicDependency]"},
+ "id": {"key": "id", "type": "str"},
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "resource_name": {"key": "resourceName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ depends_on: Optional[List["_models.BasicDependency"]] = None,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ resource_type: Optional[str] = None,
+ resource_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword depends_on: The list of dependencies.
+ :paramtype depends_on: list[~azure.mgmt.resource.resources.v2024_07_01.models.BasicDependency]
+ :keyword id: The ID of the dependency.
+ :paramtype id: str
+ :keyword resource_type: The dependency resource type.
+ :paramtype resource_type: str
+ :keyword resource_name: The dependency resource name.
+ :paramtype resource_name: str
+ """
+ super().__init__(**kwargs)
+ self.depends_on = depends_on
+ self.id = id
+ self.resource_type = resource_type
+ self.resource_name = resource_name
+
+
+class Deployment(_serialization.Model):
+ """Deployment operation parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar location: The location to store the deployment data.
+ :vartype location: str
+ :ivar properties: The deployment properties. Required.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentProperties
+ :ivar tags: Deployment tags.
+ :vartype tags: dict[str, str]
+ """
+
+ _validation = {
+ "properties": {"required": True},
+ }
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentProperties"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ properties: "_models.DeploymentProperties",
+ location: Optional[str] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: The location to store the deployment data.
+ :paramtype location: str
+ :keyword properties: The deployment properties. Required.
+ :paramtype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentProperties
+ :keyword tags: Deployment tags.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.properties = properties
+ self.tags = tags
+
+
+class DeploymentDiagnosticsDefinition(_serialization.Model):
+ """DeploymentDiagnosticsDefinition.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar level: Denotes the additional response level. Required. Known values are: "Warning",
+ "Info", and "Error".
+ :vartype level: str or ~azure.mgmt.resource.resources.v2024_07_01.models.Level
+ :ivar code: The error code. Required.
+ :vartype code: str
+ :ivar message: The error message. Required.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar additional_info: The error additional info.
+ :vartype additional_info:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ErrorAdditionalInfo]
+ """
+
+ _validation = {
+ "level": {"required": True, "readonly": True},
+ "code": {"required": True, "readonly": True},
+ "message": {"required": True, "readonly": True},
+ "target": {"readonly": True},
+ "additional_info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "level": {"key": "level", "type": "str"},
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.level = None
+ self.code = None
+ self.message = None
+ self.target = None
+ self.additional_info = None
+
+
+class DeploymentExportResult(_serialization.Model):
+ """The deployment export result.
+
+ :ivar template: The template content.
+ :vartype template: JSON
+ """
+
+ _attribute_map = {
+ "template": {"key": "template", "type": "object"},
+ }
+
+ def __init__(self, *, template: Optional[JSON] = None, **kwargs: Any) -> None:
+ """
+ :keyword template: The template content.
+ :paramtype template: JSON
+ """
+ super().__init__(**kwargs)
+ self.template = template
+
+
+class DeploymentExtended(_serialization.Model):
+ """Deployment information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The ID of the deployment.
+ :vartype id: str
+ :ivar name: The name of the deployment.
+ :vartype name: str
+ :ivar type: The type of the deployment.
+ :vartype type: str
+ :ivar location: the location of the deployment.
+ :vartype location: str
+ :ivar properties: Deployment properties.
+ :vartype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentPropertiesExtended
+ :ivar tags: Deployment tags.
+ :vartype tags: dict[str, str]
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentPropertiesExtended"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: Optional[str] = None,
+ properties: Optional["_models.DeploymentPropertiesExtended"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: the location of the deployment.
+ :paramtype location: str
+ :keyword properties: Deployment properties.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentPropertiesExtended
+ :keyword tags: Deployment tags.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.location = location
+ self.properties = properties
+ self.tags = tags
+
+
+class DeploymentExtendedFilter(_serialization.Model):
+ """Deployment filter.
+
+ :ivar provisioning_state: The provisioning state.
+ :vartype provisioning_state: str
+ """
+
+ _attribute_map = {
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ }
+
+ def __init__(self, *, provisioning_state: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword provisioning_state: The provisioning state.
+ :paramtype provisioning_state: str
+ """
+ super().__init__(**kwargs)
+ self.provisioning_state = provisioning_state
+
+
+class DeploymentListResult(_serialization.Model):
+ """List of deployments.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of deployments.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[DeploymentExtended]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.DeploymentExtended"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of deployments.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class DeploymentOperation(_serialization.Model):
+ """Deployment operation information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Full deployment operation ID.
+ :vartype id: str
+ :ivar operation_id: Deployment operation ID.
+ :vartype operation_id: str
+ :ivar properties: Deployment properties.
+ :vartype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperationProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "operation_id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "operation_id": {"key": "operationId", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentOperationProperties"},
+ }
+
+ def __init__(self, *, properties: Optional["_models.DeploymentOperationProperties"] = None, **kwargs: Any) -> None:
+ """
+ :keyword properties: Deployment properties.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperationProperties
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.operation_id = None
+ self.properties = properties
+
+
+class DeploymentOperationProperties(_serialization.Model):
+ """Deployment operation properties.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar provisioning_operation: The name of the current provisioning operation. Known values are:
+ "NotSpecified", "Create", "Delete", "Waiting", "AzureAsyncOperationWaiting",
+ "ResourceCacheWaiting", "Action", "Read", "EvaluateDeploymentOutput", and "DeploymentCleanup".
+ :vartype provisioning_operation: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProvisioningOperation
+ :ivar provisioning_state: The state of the provisioning.
+ :vartype provisioning_state: str
+ :ivar timestamp: The date and time of the operation.
+ :vartype timestamp: ~datetime.datetime
+ :ivar duration: The duration of the operation.
+ :vartype duration: str
+ :ivar service_request_id: Deployment operation service request id.
+ :vartype service_request_id: str
+ :ivar status_code: Operation status code from the resource provider. This property may not be
+ set if a response has not yet been received.
+ :vartype status_code: str
+ :ivar status_message: Operation status message from the resource provider. This property is
+ optional. It will only be provided if an error was received from the resource provider.
+ :vartype status_message: ~azure.mgmt.resource.resources.v2024_07_01.models.StatusMessage
+ :ivar target_resource: The target resource.
+ :vartype target_resource: ~azure.mgmt.resource.resources.v2024_07_01.models.TargetResource
+ :ivar request: The HTTP request message.
+ :vartype request: ~azure.mgmt.resource.resources.v2024_07_01.models.HttpMessage
+ :ivar response: The HTTP response message.
+ :vartype response: ~azure.mgmt.resource.resources.v2024_07_01.models.HttpMessage
+ """
+
+ _validation = {
+ "provisioning_operation": {"readonly": True},
+ "provisioning_state": {"readonly": True},
+ "timestamp": {"readonly": True},
+ "duration": {"readonly": True},
+ "service_request_id": {"readonly": True},
+ "status_code": {"readonly": True},
+ "status_message": {"readonly": True},
+ "target_resource": {"readonly": True},
+ "request": {"readonly": True},
+ "response": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "provisioning_operation": {"key": "provisioningOperation", "type": "str"},
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ "timestamp": {"key": "timestamp", "type": "iso-8601"},
+ "duration": {"key": "duration", "type": "str"},
+ "service_request_id": {"key": "serviceRequestId", "type": "str"},
+ "status_code": {"key": "statusCode", "type": "str"},
+ "status_message": {"key": "statusMessage", "type": "StatusMessage"},
+ "target_resource": {"key": "targetResource", "type": "TargetResource"},
+ "request": {"key": "request", "type": "HttpMessage"},
+ "response": {"key": "response", "type": "HttpMessage"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.provisioning_operation = None
+ self.provisioning_state = None
+ self.timestamp = None
+ self.duration = None
+ self.service_request_id = None
+ self.status_code = None
+ self.status_message = None
+ self.target_resource = None
+ self.request = None
+ self.response = None
+
+
+class DeploymentOperationsListResult(_serialization.Model):
+ """List of deployment operations.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of deployment operations.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[DeploymentOperation]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.DeploymentOperation"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of deployment operations.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class DeploymentParameter(_serialization.Model):
+ """Deployment parameter for the template.
+
+ :ivar value: Input value to the parameter .
+ :vartype value: any
+ :ivar reference: Azure Key Vault parameter reference.
+ :vartype reference:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.KeyVaultParameterReference
+ """
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "object"},
+ "reference": {"key": "reference", "type": "KeyVaultParameterReference"},
+ }
+
+ def __init__(
+ self,
+ *,
+ value: Optional[Any] = None,
+ reference: Optional["_models.KeyVaultParameterReference"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: Input value to the parameter .
+ :paramtype value: any
+ :keyword reference: Azure Key Vault parameter reference.
+ :paramtype reference:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.KeyVaultParameterReference
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.reference = reference
+
+
+class DeploymentProperties(_serialization.Model):
+ """Deployment properties.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar template: The template content. You use this element when you want to pass the template
+ syntax directly in the request rather than link to an existing template. It can be a JObject or
+ well-formed JSON string. Use either the templateLink property or the template property, but not
+ both.
+ :vartype template: JSON
+ :ivar template_link: The URI of the template. Use either the templateLink property or the
+ template property, but not both.
+ :vartype template_link: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateLink
+ :ivar parameters: Name and value pairs that define the deployment parameters for the template.
+ You use this element when you want to provide the parameter values directly in the request
+ rather than link to an existing parameter file. Use either the parametersLink property or the
+ parameters property, but not both. It can be a JObject or a well formed JSON string.
+ :vartype parameters: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentParameter]
+ :ivar parameters_link: The URI of parameters file. You use this element to link to an existing
+ parameters file. Use either the parametersLink property or the parameters property, but not
+ both.
+ :vartype parameters_link: ~azure.mgmt.resource.resources.v2024_07_01.models.ParametersLink
+ :ivar mode: The mode that is used to deploy resources. This value can be either Incremental or
+ Complete. In Incremental mode, resources are deployed without deleting existing resources that
+ are not included in the template. In Complete mode, resources are deployed and existing
+ resources in the resource group that are not included in the template are deleted. Be careful
+ when using Complete mode as you may unintentionally delete resources. Required. Known values
+ are: "Incremental" and "Complete".
+ :vartype mode: str or ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentMode
+ :ivar debug_setting: The debug setting of the deployment.
+ :vartype debug_setting: ~azure.mgmt.resource.resources.v2024_07_01.models.DebugSetting
+ :ivar on_error_deployment: The deployment on error behavior.
+ :vartype on_error_deployment:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeployment
+ :ivar expression_evaluation_options: Specifies whether template expressions are evaluated
+ within the scope of the parent template or nested template. Only applicable to nested
+ templates. If not specified, default value is outer.
+ :vartype expression_evaluation_options:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptions
+ """
+
+ _validation = {
+ "mode": {"required": True},
+ }
+
+ _attribute_map = {
+ "template": {"key": "template", "type": "object"},
+ "template_link": {"key": "templateLink", "type": "TemplateLink"},
+ "parameters": {"key": "parameters", "type": "{DeploymentParameter}"},
+ "parameters_link": {"key": "parametersLink", "type": "ParametersLink"},
+ "mode": {"key": "mode", "type": "str"},
+ "debug_setting": {"key": "debugSetting", "type": "DebugSetting"},
+ "on_error_deployment": {"key": "onErrorDeployment", "type": "OnErrorDeployment"},
+ "expression_evaluation_options": {"key": "expressionEvaluationOptions", "type": "ExpressionEvaluationOptions"},
+ }
+
+ def __init__(
+ self,
+ *,
+ mode: Union[str, "_models.DeploymentMode"],
+ template: Optional[JSON] = None,
+ template_link: Optional["_models.TemplateLink"] = None,
+ parameters: Optional[Dict[str, "_models.DeploymentParameter"]] = None,
+ parameters_link: Optional["_models.ParametersLink"] = None,
+ debug_setting: Optional["_models.DebugSetting"] = None,
+ on_error_deployment: Optional["_models.OnErrorDeployment"] = None,
+ expression_evaluation_options: Optional["_models.ExpressionEvaluationOptions"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword template: The template content. You use this element when you want to pass the
+ template syntax directly in the request rather than link to an existing template. It can be a
+ JObject or well-formed JSON string. Use either the templateLink property or the template
+ property, but not both.
+ :paramtype template: JSON
+ :keyword template_link: The URI of the template. Use either the templateLink property or the
+ template property, but not both.
+ :paramtype template_link: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateLink
+ :keyword parameters: Name and value pairs that define the deployment parameters for the
+ template. You use this element when you want to provide the parameter values directly in the
+ request rather than link to an existing parameter file. Use either the parametersLink property
+ or the parameters property, but not both. It can be a JObject or a well formed JSON string.
+ :paramtype parameters: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentParameter]
+ :keyword parameters_link: The URI of parameters file. You use this element to link to an
+ existing parameters file. Use either the parametersLink property or the parameters property,
+ but not both.
+ :paramtype parameters_link: ~azure.mgmt.resource.resources.v2024_07_01.models.ParametersLink
+ :keyword mode: The mode that is used to deploy resources. This value can be either Incremental
+ or Complete. In Incremental mode, resources are deployed without deleting existing resources
+ that are not included in the template. In Complete mode, resources are deployed and existing
+ resources in the resource group that are not included in the template are deleted. Be careful
+ when using Complete mode as you may unintentionally delete resources. Required. Known values
+ are: "Incremental" and "Complete".
+ :paramtype mode: str or ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentMode
+ :keyword debug_setting: The debug setting of the deployment.
+ :paramtype debug_setting: ~azure.mgmt.resource.resources.v2024_07_01.models.DebugSetting
+ :keyword on_error_deployment: The deployment on error behavior.
+ :paramtype on_error_deployment:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeployment
+ :keyword expression_evaluation_options: Specifies whether template expressions are evaluated
+ within the scope of the parent template or nested template. Only applicable to nested
+ templates. If not specified, default value is outer.
+ :paramtype expression_evaluation_options:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptions
+ """
+ super().__init__(**kwargs)
+ self.template = template
+ self.template_link = template_link
+ self.parameters = parameters
+ self.parameters_link = parameters_link
+ self.mode = mode
+ self.debug_setting = debug_setting
+ self.on_error_deployment = on_error_deployment
+ self.expression_evaluation_options = expression_evaluation_options
+
+
+class DeploymentPropertiesExtended(_serialization.Model):
+ """Deployment properties with additional details.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar provisioning_state: Denotes the state of provisioning. Known values are: "NotSpecified",
+ "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled",
+ "Failed", "Succeeded", and "Updating".
+ :vartype provisioning_state: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProvisioningState
+ :ivar correlation_id: The correlation ID of the deployment.
+ :vartype correlation_id: str
+ :ivar timestamp: The timestamp of the template deployment.
+ :vartype timestamp: ~datetime.datetime
+ :ivar duration: The duration of the template deployment.
+ :vartype duration: str
+ :ivar outputs: Key/value pairs that represent deployment output.
+ :vartype outputs: JSON
+ :ivar providers: The list of resource providers needed for the deployment.
+ :vartype providers: list[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :ivar dependencies: The list of deployment dependencies.
+ :vartype dependencies: list[~azure.mgmt.resource.resources.v2024_07_01.models.Dependency]
+ :ivar template_link: The URI referencing the template.
+ :vartype template_link: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateLink
+ :ivar parameters: Deployment parameters.
+ :vartype parameters: JSON
+ :ivar parameters_link: The URI referencing the parameters.
+ :vartype parameters_link: ~azure.mgmt.resource.resources.v2024_07_01.models.ParametersLink
+ :ivar mode: The deployment mode. Possible values are Incremental and Complete. Known values
+ are: "Incremental" and "Complete".
+ :vartype mode: str or ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentMode
+ :ivar debug_setting: The debug setting of the deployment.
+ :vartype debug_setting: ~azure.mgmt.resource.resources.v2024_07_01.models.DebugSetting
+ :ivar on_error_deployment: The deployment on error behavior.
+ :vartype on_error_deployment:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeploymentExtended
+ :ivar template_hash: The hash produced for the template.
+ :vartype template_hash: str
+ :ivar output_resources: Array of provisioned resources.
+ :vartype output_resources:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceReference]
+ :ivar validated_resources: Array of validated resources.
+ :vartype validated_resources:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceReference]
+ :ivar error: The deployment error.
+ :vartype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ :ivar diagnostics: Contains diagnostic information collected during validation process.
+ :vartype diagnostics:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentDiagnosticsDefinition]
+ """
+
+ _validation = {
+ "provisioning_state": {"readonly": True},
+ "correlation_id": {"readonly": True},
+ "timestamp": {"readonly": True},
+ "duration": {"readonly": True},
+ "outputs": {"readonly": True},
+ "providers": {"readonly": True},
+ "dependencies": {"readonly": True},
+ "template_link": {"readonly": True},
+ "parameters": {"readonly": True},
+ "parameters_link": {"readonly": True},
+ "mode": {"readonly": True},
+ "debug_setting": {"readonly": True},
+ "on_error_deployment": {"readonly": True},
+ "template_hash": {"readonly": True},
+ "output_resources": {"readonly": True},
+ "validated_resources": {"readonly": True},
+ "error": {"readonly": True},
+ "diagnostics": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ "correlation_id": {"key": "correlationId", "type": "str"},
+ "timestamp": {"key": "timestamp", "type": "iso-8601"},
+ "duration": {"key": "duration", "type": "str"},
+ "outputs": {"key": "outputs", "type": "object"},
+ "providers": {"key": "providers", "type": "[Provider]"},
+ "dependencies": {"key": "dependencies", "type": "[Dependency]"},
+ "template_link": {"key": "templateLink", "type": "TemplateLink"},
+ "parameters": {"key": "parameters", "type": "object"},
+ "parameters_link": {"key": "parametersLink", "type": "ParametersLink"},
+ "mode": {"key": "mode", "type": "str"},
+ "debug_setting": {"key": "debugSetting", "type": "DebugSetting"},
+ "on_error_deployment": {"key": "onErrorDeployment", "type": "OnErrorDeploymentExtended"},
+ "template_hash": {"key": "templateHash", "type": "str"},
+ "output_resources": {"key": "outputResources", "type": "[ResourceReference]"},
+ "validated_resources": {"key": "validatedResources", "type": "[ResourceReference]"},
+ "error": {"key": "error", "type": "ErrorResponse"},
+ "diagnostics": {"key": "diagnostics", "type": "[DeploymentDiagnosticsDefinition]"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.provisioning_state = None
+ self.correlation_id = None
+ self.timestamp = None
+ self.duration = None
+ self.outputs = None
+ self.providers = None
+ self.dependencies = None
+ self.template_link = None
+ self.parameters = None
+ self.parameters_link = None
+ self.mode = None
+ self.debug_setting = None
+ self.on_error_deployment = None
+ self.template_hash = None
+ self.output_resources = None
+ self.validated_resources = None
+ self.error = None
+ self.diagnostics = None
+
+
+class DeploymentValidationError(_serialization.Model):
+ """The template deployment validation detected failures.
+
+ :ivar error: The error detail.
+ :vartype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorDetail
+ """
+
+ _attribute_map = {
+ "error": {"key": "error", "type": "ErrorDetail"},
+ }
+
+ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None:
+ """
+ :keyword error: The error detail.
+ :paramtype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorDetail
+ """
+ super().__init__(**kwargs)
+ self.error = error
+
+
+class DeploymentWhatIf(_serialization.Model):
+ """Deployment What-if operation parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar location: The location to store the deployment data.
+ :vartype location: str
+ :ivar properties: The deployment properties. Required.
+ :vartype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfProperties
+ """
+
+ _validation = {
+ "properties": {"required": True},
+ }
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentWhatIfProperties"},
+ }
+
+ def __init__(
+ self, *, properties: "_models.DeploymentWhatIfProperties", location: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: The location to store the deployment data.
+ :paramtype location: str
+ :keyword properties: The deployment properties. Required.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfProperties
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.properties = properties
+
+
+class DeploymentWhatIfProperties(DeploymentProperties):
+ """Deployment What-if properties.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar template: The template content. You use this element when you want to pass the template
+ syntax directly in the request rather than link to an existing template. It can be a JObject or
+ well-formed JSON string. Use either the templateLink property or the template property, but not
+ both.
+ :vartype template: JSON
+ :ivar template_link: The URI of the template. Use either the templateLink property or the
+ template property, but not both.
+ :vartype template_link: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateLink
+ :ivar parameters: Name and value pairs that define the deployment parameters for the template.
+ You use this element when you want to provide the parameter values directly in the request
+ rather than link to an existing parameter file. Use either the parametersLink property or the
+ parameters property, but not both. It can be a JObject or a well formed JSON string.
+ :vartype parameters: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentParameter]
+ :ivar parameters_link: The URI of parameters file. You use this element to link to an existing
+ parameters file. Use either the parametersLink property or the parameters property, but not
+ both.
+ :vartype parameters_link: ~azure.mgmt.resource.resources.v2024_07_01.models.ParametersLink
+ :ivar mode: The mode that is used to deploy resources. This value can be either Incremental or
+ Complete. In Incremental mode, resources are deployed without deleting existing resources that
+ are not included in the template. In Complete mode, resources are deployed and existing
+ resources in the resource group that are not included in the template are deleted. Be careful
+ when using Complete mode as you may unintentionally delete resources. Required. Known values
+ are: "Incremental" and "Complete".
+ :vartype mode: str or ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentMode
+ :ivar debug_setting: The debug setting of the deployment.
+ :vartype debug_setting: ~azure.mgmt.resource.resources.v2024_07_01.models.DebugSetting
+ :ivar on_error_deployment: The deployment on error behavior.
+ :vartype on_error_deployment:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeployment
+ :ivar expression_evaluation_options: Specifies whether template expressions are evaluated
+ within the scope of the parent template or nested template. Only applicable to nested
+ templates. If not specified, default value is outer.
+ :vartype expression_evaluation_options:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptions
+ :ivar what_if_settings: Optional What-If operation settings.
+ :vartype what_if_settings:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfSettings
+ """
+
+ _validation = {
+ "mode": {"required": True},
+ }
+
+ _attribute_map = {
+ "template": {"key": "template", "type": "object"},
+ "template_link": {"key": "templateLink", "type": "TemplateLink"},
+ "parameters": {"key": "parameters", "type": "{DeploymentParameter}"},
+ "parameters_link": {"key": "parametersLink", "type": "ParametersLink"},
+ "mode": {"key": "mode", "type": "str"},
+ "debug_setting": {"key": "debugSetting", "type": "DebugSetting"},
+ "on_error_deployment": {"key": "onErrorDeployment", "type": "OnErrorDeployment"},
+ "expression_evaluation_options": {"key": "expressionEvaluationOptions", "type": "ExpressionEvaluationOptions"},
+ "what_if_settings": {"key": "whatIfSettings", "type": "DeploymentWhatIfSettings"},
+ }
+
+ def __init__(
+ self,
+ *,
+ mode: Union[str, "_models.DeploymentMode"],
+ template: Optional[JSON] = None,
+ template_link: Optional["_models.TemplateLink"] = None,
+ parameters: Optional[Dict[str, "_models.DeploymentParameter"]] = None,
+ parameters_link: Optional["_models.ParametersLink"] = None,
+ debug_setting: Optional["_models.DebugSetting"] = None,
+ on_error_deployment: Optional["_models.OnErrorDeployment"] = None,
+ expression_evaluation_options: Optional["_models.ExpressionEvaluationOptions"] = None,
+ what_if_settings: Optional["_models.DeploymentWhatIfSettings"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword template: The template content. You use this element when you want to pass the
+ template syntax directly in the request rather than link to an existing template. It can be a
+ JObject or well-formed JSON string. Use either the templateLink property or the template
+ property, but not both.
+ :paramtype template: JSON
+ :keyword template_link: The URI of the template. Use either the templateLink property or the
+ template property, but not both.
+ :paramtype template_link: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateLink
+ :keyword parameters: Name and value pairs that define the deployment parameters for the
+ template. You use this element when you want to provide the parameter values directly in the
+ request rather than link to an existing parameter file. Use either the parametersLink property
+ or the parameters property, but not both. It can be a JObject or a well formed JSON string.
+ :paramtype parameters: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentParameter]
+ :keyword parameters_link: The URI of parameters file. You use this element to link to an
+ existing parameters file. Use either the parametersLink property or the parameters property,
+ but not both.
+ :paramtype parameters_link: ~azure.mgmt.resource.resources.v2024_07_01.models.ParametersLink
+ :keyword mode: The mode that is used to deploy resources. This value can be either Incremental
+ or Complete. In Incremental mode, resources are deployed without deleting existing resources
+ that are not included in the template. In Complete mode, resources are deployed and existing
+ resources in the resource group that are not included in the template are deleted. Be careful
+ when using Complete mode as you may unintentionally delete resources. Required. Known values
+ are: "Incremental" and "Complete".
+ :paramtype mode: str or ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentMode
+ :keyword debug_setting: The debug setting of the deployment.
+ :paramtype debug_setting: ~azure.mgmt.resource.resources.v2024_07_01.models.DebugSetting
+ :keyword on_error_deployment: The deployment on error behavior.
+ :paramtype on_error_deployment:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeployment
+ :keyword expression_evaluation_options: Specifies whether template expressions are evaluated
+ within the scope of the parent template or nested template. Only applicable to nested
+ templates. If not specified, default value is outer.
+ :paramtype expression_evaluation_options:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptions
+ :keyword what_if_settings: Optional What-If operation settings.
+ :paramtype what_if_settings:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfSettings
+ """
+ super().__init__(
+ template=template,
+ template_link=template_link,
+ parameters=parameters,
+ parameters_link=parameters_link,
+ mode=mode,
+ debug_setting=debug_setting,
+ on_error_deployment=on_error_deployment,
+ expression_evaluation_options=expression_evaluation_options,
+ **kwargs
+ )
+ self.what_if_settings = what_if_settings
+
+
+class DeploymentWhatIfSettings(_serialization.Model):
+ """Deployment What-If operation settings.
+
+ :ivar result_format: The format of the What-If results. Known values are: "ResourceIdOnly" and
+ "FullResourcePayloads".
+ :vartype result_format: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfResultFormat
+ """
+
+ _attribute_map = {
+ "result_format": {"key": "resultFormat", "type": "str"},
+ }
+
+ def __init__(
+ self, *, result_format: Optional[Union[str, "_models.WhatIfResultFormat"]] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword result_format: The format of the What-If results. Known values are: "ResourceIdOnly"
+ and "FullResourcePayloads".
+ :paramtype result_format: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfResultFormat
+ """
+ super().__init__(**kwargs)
+ self.result_format = result_format
+
+
+class ErrorAdditionalInfo(_serialization.Model):
+ """The resource management error additional info.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar type: The additional info type.
+ :vartype type: str
+ :ivar info: The additional info.
+ :vartype info: JSON
+ """
+
+ _validation = {
+ "type": {"readonly": True},
+ "info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "info": {"key": "info", "type": "object"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.type = None
+ self.info = None
+
+
+class ErrorDetail(_serialization.Model):
+ """The error detail.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar details: The error details.
+ :vartype details: list[~azure.mgmt.resource.resources.v2024_07_01.models.ErrorDetail]
+ :ivar additional_info: The error additional info.
+ :vartype additional_info:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ErrorAdditionalInfo]
+ """
+
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "target": {"readonly": True},
+ "details": {"readonly": True},
+ "additional_info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "details": {"key": "details", "type": "[ErrorDetail]"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
+ }
+
+ 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
+
+
+class ErrorResponse(_serialization.Model):
+ """Common error response for all Azure Resource Manager APIs to return error details for failed
+ operations. (This also follows the OData error response format.).
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar code: The error code.
+ :vartype code: str
+ :ivar message: The error message.
+ :vartype message: str
+ :ivar target: The error target.
+ :vartype target: str
+ :ivar details: The error details.
+ :vartype details: list[~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse]
+ :ivar additional_info: The error additional info.
+ :vartype additional_info:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ErrorAdditionalInfo]
+ """
+
+ _validation = {
+ "code": {"readonly": True},
+ "message": {"readonly": True},
+ "target": {"readonly": True},
+ "details": {"readonly": True},
+ "additional_info": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "code": {"key": "code", "type": "str"},
+ "message": {"key": "message", "type": "str"},
+ "target": {"key": "target", "type": "str"},
+ "details": {"key": "details", "type": "[ErrorResponse]"},
+ "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
+ }
+
+ 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
+
+
+class ExportTemplateRequest(_serialization.Model):
+ """Export resource group template request parameters.
+
+ :ivar resources: The IDs of the resources to filter the export by. To export all resources,
+ supply an array with single entry '*'.
+ :vartype resources: list[str]
+ :ivar options: The export template options. A CSV-formatted list containing zero or more of the
+ following: 'IncludeParameterDefaultValue', 'IncludeComments',
+ 'SkipResourceNameParameterization', 'SkipAllParameterization'.
+ :vartype options: str
+ :ivar output_format: The output format for the exported resources. Known values are: "Json" and
+ "Bicep".
+ :vartype output_format: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateOutputFormat
+ """
+
+ _attribute_map = {
+ "resources": {"key": "resources", "type": "[str]"},
+ "options": {"key": "options", "type": "str"},
+ "output_format": {"key": "outputFormat", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resources: Optional[List[str]] = None,
+ options: Optional[str] = None,
+ output_format: Optional[Union[str, "_models.ExportTemplateOutputFormat"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resources: The IDs of the resources to filter the export by. To export all resources,
+ supply an array with single entry '*'.
+ :paramtype resources: list[str]
+ :keyword options: The export template options. A CSV-formatted list containing zero or more of
+ the following: 'IncludeParameterDefaultValue', 'IncludeComments',
+ 'SkipResourceNameParameterization', 'SkipAllParameterization'.
+ :paramtype options: str
+ :keyword output_format: The output format for the exported resources. Known values are: "Json"
+ and "Bicep".
+ :paramtype output_format: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateOutputFormat
+ """
+ super().__init__(**kwargs)
+ self.resources = resources
+ self.options = options
+ self.output_format = output_format
+
+
+class ExpressionEvaluationOptions(_serialization.Model):
+ """Specifies whether template expressions are evaluated within the scope of the parent template or
+ nested template.
+
+ :ivar scope: The scope to be used for evaluation of parameters, variables and functions in a
+ nested template. Known values are: "NotSpecified", "Outer", and "Inner".
+ :vartype scope: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptionsScopeType
+ """
+
+ _attribute_map = {
+ "scope": {"key": "scope", "type": "str"},
+ }
+
+ def __init__(
+ self, *, scope: Optional[Union[str, "_models.ExpressionEvaluationOptionsScopeType"]] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword scope: The scope to be used for evaluation of parameters, variables and functions in a
+ nested template. Known values are: "NotSpecified", "Outer", and "Inner".
+ :paramtype scope: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExpressionEvaluationOptionsScopeType
+ """
+ super().__init__(**kwargs)
+ self.scope = scope
+
+
+class ExtendedLocation(_serialization.Model):
+ """Resource extended location.
+
+ :ivar type: The extended location type. "EdgeZone"
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocationType
+ :ivar name: The extended location name.
+ :vartype name: str
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.ExtendedLocationType"]] = None,
+ name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The extended location type. "EdgeZone"
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocationType
+ :keyword name: The extended location name.
+ :paramtype name: str
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.name = name
+
+
+class Resource(_serialization.Model):
+ """Specified resource.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Resource ID.
+ :vartype id: str
+ :ivar name: Resource name.
+ :vartype name: str
+ :ivar type: Resource type.
+ :vartype type: str
+ :ivar location: Resource location.
+ :vartype location: str
+ :ivar extended_location: Resource extended location.
+ :vartype extended_location: ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :ivar tags: Resource tags.
+ :vartype tags: dict[str, str]
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: Optional[str] = None,
+ extended_location: Optional["_models.ExtendedLocation"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: Resource location.
+ :paramtype location: str
+ :keyword extended_location: Resource extended location.
+ :paramtype extended_location:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :keyword tags: Resource tags.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.location = location
+ self.extended_location = extended_location
+ self.tags = tags
+
+
+class GenericResource(Resource):
+ """Resource information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Resource ID.
+ :vartype id: str
+ :ivar name: Resource name.
+ :vartype name: str
+ :ivar type: Resource type.
+ :vartype type: str
+ :ivar location: Resource location.
+ :vartype location: str
+ :ivar extended_location: Resource extended location.
+ :vartype extended_location: ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :ivar tags: Resource tags.
+ :vartype tags: dict[str, str]
+ :ivar plan: The plan of the resource.
+ :vartype plan: ~azure.mgmt.resource.resources.v2024_07_01.models.Plan
+ :ivar properties: The resource properties.
+ :vartype properties: JSON
+ :ivar kind: The kind of the resource.
+ :vartype kind: str
+ :ivar managed_by: ID of the resource that manages this resource.
+ :vartype managed_by: str
+ :ivar sku: The SKU of the resource.
+ :vartype sku: ~azure.mgmt.resource.resources.v2024_07_01.models.Sku
+ :ivar identity: The identity of the resource.
+ :vartype identity: ~azure.mgmt.resource.resources.v2024_07_01.models.Identity
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "kind": {"pattern": r"^[-\w\._,\(\)]+$"},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"},
+ "tags": {"key": "tags", "type": "{str}"},
+ "plan": {"key": "plan", "type": "Plan"},
+ "properties": {"key": "properties", "type": "object"},
+ "kind": {"key": "kind", "type": "str"},
+ "managed_by": {"key": "managedBy", "type": "str"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "identity": {"key": "identity", "type": "Identity"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: Optional[str] = None,
+ extended_location: Optional["_models.ExtendedLocation"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ plan: Optional["_models.Plan"] = None,
+ properties: Optional[JSON] = None,
+ kind: Optional[str] = None,
+ managed_by: Optional[str] = None,
+ sku: Optional["_models.Sku"] = None,
+ identity: Optional["_models.Identity"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: Resource location.
+ :paramtype location: str
+ :keyword extended_location: Resource extended location.
+ :paramtype extended_location:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :keyword tags: Resource tags.
+ :paramtype tags: dict[str, str]
+ :keyword plan: The plan of the resource.
+ :paramtype plan: ~azure.mgmt.resource.resources.v2024_07_01.models.Plan
+ :keyword properties: The resource properties.
+ :paramtype properties: JSON
+ :keyword kind: The kind of the resource.
+ :paramtype kind: str
+ :keyword managed_by: ID of the resource that manages this resource.
+ :paramtype managed_by: str
+ :keyword sku: The SKU of the resource.
+ :paramtype sku: ~azure.mgmt.resource.resources.v2024_07_01.models.Sku
+ :keyword identity: The identity of the resource.
+ :paramtype identity: ~azure.mgmt.resource.resources.v2024_07_01.models.Identity
+ """
+ super().__init__(location=location, extended_location=extended_location, tags=tags, **kwargs)
+ self.plan = plan
+ self.properties = properties
+ self.kind = kind
+ self.managed_by = managed_by
+ self.sku = sku
+ self.identity = identity
+
+
+class GenericResourceExpanded(GenericResource):
+ """Resource information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: Resource ID.
+ :vartype id: str
+ :ivar name: Resource name.
+ :vartype name: str
+ :ivar type: Resource type.
+ :vartype type: str
+ :ivar location: Resource location.
+ :vartype location: str
+ :ivar extended_location: Resource extended location.
+ :vartype extended_location: ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :ivar tags: Resource tags.
+ :vartype tags: dict[str, str]
+ :ivar plan: The plan of the resource.
+ :vartype plan: ~azure.mgmt.resource.resources.v2024_07_01.models.Plan
+ :ivar properties: The resource properties.
+ :vartype properties: JSON
+ :ivar kind: The kind of the resource.
+ :vartype kind: str
+ :ivar managed_by: ID of the resource that manages this resource.
+ :vartype managed_by: str
+ :ivar sku: The SKU of the resource.
+ :vartype sku: ~azure.mgmt.resource.resources.v2024_07_01.models.Sku
+ :ivar identity: The identity of the resource.
+ :vartype identity: ~azure.mgmt.resource.resources.v2024_07_01.models.Identity
+ :ivar created_time: The created time of the resource. This is only present if requested via the
+ $expand query parameter.
+ :vartype created_time: ~datetime.datetime
+ :ivar changed_time: The changed time of the resource. This is only present if requested via the
+ $expand query parameter.
+ :vartype changed_time: ~datetime.datetime
+ :ivar provisioning_state: The provisioning state of the resource. This is only present if
+ requested via the $expand query parameter.
+ :vartype provisioning_state: str
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "kind": {"pattern": r"^[-\w\._,\(\)]+$"},
+ "created_time": {"readonly": True},
+ "changed_time": {"readonly": True},
+ "provisioning_state": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "location": {"key": "location", "type": "str"},
+ "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"},
+ "tags": {"key": "tags", "type": "{str}"},
+ "plan": {"key": "plan", "type": "Plan"},
+ "properties": {"key": "properties", "type": "object"},
+ "kind": {"key": "kind", "type": "str"},
+ "managed_by": {"key": "managedBy", "type": "str"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "identity": {"key": "identity", "type": "Identity"},
+ "created_time": {"key": "createdTime", "type": "iso-8601"},
+ "changed_time": {"key": "changedTime", "type": "iso-8601"},
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: Optional[str] = None,
+ extended_location: Optional["_models.ExtendedLocation"] = None,
+ tags: Optional[Dict[str, str]] = None,
+ plan: Optional["_models.Plan"] = None,
+ properties: Optional[JSON] = None,
+ kind: Optional[str] = None,
+ managed_by: Optional[str] = None,
+ sku: Optional["_models.Sku"] = None,
+ identity: Optional["_models.Identity"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: Resource location.
+ :paramtype location: str
+ :keyword extended_location: Resource extended location.
+ :paramtype extended_location:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ExtendedLocation
+ :keyword tags: Resource tags.
+ :paramtype tags: dict[str, str]
+ :keyword plan: The plan of the resource.
+ :paramtype plan: ~azure.mgmt.resource.resources.v2024_07_01.models.Plan
+ :keyword properties: The resource properties.
+ :paramtype properties: JSON
+ :keyword kind: The kind of the resource.
+ :paramtype kind: str
+ :keyword managed_by: ID of the resource that manages this resource.
+ :paramtype managed_by: str
+ :keyword sku: The SKU of the resource.
+ :paramtype sku: ~azure.mgmt.resource.resources.v2024_07_01.models.Sku
+ :keyword identity: The identity of the resource.
+ :paramtype identity: ~azure.mgmt.resource.resources.v2024_07_01.models.Identity
+ """
+ super().__init__(
+ location=location,
+ extended_location=extended_location,
+ tags=tags,
+ plan=plan,
+ properties=properties,
+ kind=kind,
+ managed_by=managed_by,
+ sku=sku,
+ identity=identity,
+ **kwargs
+ )
+ self.created_time = None
+ self.changed_time = None
+ self.provisioning_state = None
+
+
+class GenericResourceFilter(_serialization.Model):
+ """Resource filter.
+
+ :ivar resource_type: The resource type.
+ :vartype resource_type: str
+ :ivar tagname: The tag name.
+ :vartype tagname: str
+ :ivar tagvalue: The tag value.
+ :vartype tagvalue: str
+ """
+
+ _attribute_map = {
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "tagname": {"key": "tagname", "type": "str"},
+ "tagvalue": {"key": "tagvalue", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_type: Optional[str] = None,
+ tagname: Optional[str] = None,
+ tagvalue: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_type: The resource type.
+ :paramtype resource_type: str
+ :keyword tagname: The tag name.
+ :paramtype tagname: str
+ :keyword tagvalue: The tag value.
+ :paramtype tagvalue: str
+ """
+ super().__init__(**kwargs)
+ self.resource_type = resource_type
+ self.tagname = tagname
+ self.tagvalue = tagvalue
+
+
+class HttpMessage(_serialization.Model):
+ """HTTP message.
+
+ :ivar content: HTTP message content.
+ :vartype content: JSON
+ """
+
+ _attribute_map = {
+ "content": {"key": "content", "type": "object"},
+ }
+
+ def __init__(self, *, content: Optional[JSON] = None, **kwargs: Any) -> None:
+ """
+ :keyword content: HTTP message content.
+ :paramtype content: JSON
+ """
+ super().__init__(**kwargs)
+ self.content = content
+
+
+class Identity(_serialization.Model):
+ """Identity for the resource.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar principal_id: The principal ID of resource identity.
+ :vartype principal_id: str
+ :ivar tenant_id: The tenant ID of resource.
+ :vartype tenant_id: str
+ :ivar type: The identity type. Known values are: "SystemAssigned", "UserAssigned",
+ "SystemAssigned, UserAssigned", and "None".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceIdentityType
+ :ivar user_assigned_identities: The list of user identities associated with the resource. The
+ user identity dictionary key references will be ARM resource ids in the form:
+ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long
+ :vartype user_assigned_identities: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.IdentityUserAssignedIdentitiesValue]
+ """
+
+ _validation = {
+ "principal_id": {"readonly": True},
+ "tenant_id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "principal_id": {"key": "principalId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{IdentityUserAssignedIdentitiesValue}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
+ user_assigned_identities: Optional[Dict[str, "_models.IdentityUserAssignedIdentitiesValue"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The identity type. Known values are: "SystemAssigned", "UserAssigned",
+ "SystemAssigned, UserAssigned", and "None".
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceIdentityType
+ :keyword user_assigned_identities: The list of user identities associated with the resource.
+ The user identity dictionary key references will be ARM resource ids in the form:
+ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. # pylint: disable=line-too-long
+ :paramtype user_assigned_identities: dict[str,
+ ~azure.mgmt.resource.resources.v2024_07_01.models.IdentityUserAssignedIdentitiesValue]
+ """
+ super().__init__(**kwargs)
+ self.principal_id = None
+ self.tenant_id = None
+ self.type = type
+ self.user_assigned_identities = user_assigned_identities
+
+
+class IdentityUserAssignedIdentitiesValue(_serialization.Model):
+ """IdentityUserAssignedIdentitiesValue.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar principal_id: The principal id of user assigned identity.
+ :vartype principal_id: str
+ :ivar client_id: The client id of user assigned identity.
+ :vartype client_id: str
+ """
+
+ _validation = {
+ "principal_id": {"readonly": True},
+ "client_id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "principal_id": {"key": "principalId", "type": "str"},
+ "client_id": {"key": "clientId", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.principal_id = None
+ self.client_id = None
+
+
+class KeyVaultParameterReference(_serialization.Model):
+ """Azure Key Vault parameter reference.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar key_vault: Azure Key Vault reference. Required.
+ :vartype key_vault: ~azure.mgmt.resource.resources.v2024_07_01.models.KeyVaultReference
+ :ivar secret_name: Azure Key Vault secret name. Required.
+ :vartype secret_name: str
+ :ivar secret_version: Azure Key Vault secret version.
+ :vartype secret_version: str
+ """
+
+ _validation = {
+ "key_vault": {"required": True},
+ "secret_name": {"required": True},
+ }
+
+ _attribute_map = {
+ "key_vault": {"key": "keyVault", "type": "KeyVaultReference"},
+ "secret_name": {"key": "secretName", "type": "str"},
+ "secret_version": {"key": "secretVersion", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ key_vault: "_models.KeyVaultReference",
+ secret_name: str,
+ secret_version: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword key_vault: Azure Key Vault reference. Required.
+ :paramtype key_vault: ~azure.mgmt.resource.resources.v2024_07_01.models.KeyVaultReference
+ :keyword secret_name: Azure Key Vault secret name. Required.
+ :paramtype secret_name: str
+ :keyword secret_version: Azure Key Vault secret version.
+ :paramtype secret_version: str
+ """
+ super().__init__(**kwargs)
+ self.key_vault = key_vault
+ self.secret_name = secret_name
+ self.secret_version = secret_version
+
+
+class KeyVaultReference(_serialization.Model):
+ """Azure Key Vault reference.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Azure Key Vault resource id. Required.
+ :vartype id: str
+ """
+
+ _validation = {
+ "id": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ }
+
+ def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin
+ """
+ :keyword id: Azure Key Vault resource id. Required.
+ :paramtype id: str
+ """
+ super().__init__(**kwargs)
+ self.id = id
+
+
+class OnErrorDeployment(_serialization.Model):
+ """Deployment on error behavior.
+
+ :ivar type: The deployment on error behavior type. Possible values are LastSuccessful and
+ SpecificDeployment. Known values are: "LastSuccessful" and "SpecificDeployment".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeploymentType
+ :ivar deployment_name: The deployment to be used on error case.
+ :vartype deployment_name: str
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "deployment_name": {"key": "deploymentName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.OnErrorDeploymentType"]] = None,
+ deployment_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The deployment on error behavior type. Possible values are LastSuccessful and
+ SpecificDeployment. Known values are: "LastSuccessful" and "SpecificDeployment".
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeploymentType
+ :keyword deployment_name: The deployment to be used on error case.
+ :paramtype deployment_name: str
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.deployment_name = deployment_name
+
+
+class OnErrorDeploymentExtended(_serialization.Model):
+ """Deployment on error behavior with additional details.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar provisioning_state: The state of the provisioning for the on error deployment.
+ :vartype provisioning_state: str
+ :ivar type: The deployment on error behavior type. Possible values are LastSuccessful and
+ SpecificDeployment. Known values are: "LastSuccessful" and "SpecificDeployment".
+ :vartype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeploymentType
+ :ivar deployment_name: The deployment to be used on error case.
+ :vartype deployment_name: str
+ """
+
+ _validation = {
+ "provisioning_state": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "deployment_name": {"key": "deploymentName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.OnErrorDeploymentType"]] = None,
+ deployment_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The deployment on error behavior type. Possible values are LastSuccessful and
+ SpecificDeployment. Known values are: "LastSuccessful" and "SpecificDeployment".
+ :paramtype type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.OnErrorDeploymentType
+ :keyword deployment_name: The deployment to be used on error case.
+ :paramtype deployment_name: str
+ """
+ super().__init__(**kwargs)
+ self.provisioning_state = None
+ self.type = type
+ self.deployment_name = deployment_name
+
+
+class Operation(_serialization.Model):
+ """Microsoft.Resources operation.
+
+ :ivar name: Operation name: {provider}/{resource}/{operation}.
+ :vartype name: str
+ :ivar display: The object that represents the operation.
+ :vartype display: ~azure.mgmt.resource.resources.v2024_07_01.models.OperationDisplay
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "display": {"key": "display", "type": "OperationDisplay"},
+ }
+
+ def __init__(
+ self, *, name: Optional[str] = None, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: Operation name: {provider}/{resource}/{operation}.
+ :paramtype name: str
+ :keyword display: The object that represents the operation.
+ :paramtype display: ~azure.mgmt.resource.resources.v2024_07_01.models.OperationDisplay
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.display = display
+
+
+class OperationDisplay(_serialization.Model):
+ """The object that represents the operation.
+
+ :ivar provider: Service provider: Microsoft.Resources.
+ :vartype provider: str
+ :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc.
+ :vartype resource: str
+ :ivar operation: Operation type: Read, write, delete, etc.
+ :vartype operation: str
+ :ivar description: Description of the operation.
+ :vartype description: str
+ """
+
+ _attribute_map = {
+ "provider": {"key": "provider", "type": "str"},
+ "resource": {"key": "resource", "type": "str"},
+ "operation": {"key": "operation", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ provider: Optional[str] = None,
+ resource: Optional[str] = None,
+ operation: Optional[str] = None,
+ description: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword provider: Service provider: Microsoft.Resources.
+ :paramtype provider: str
+ :keyword resource: Resource on which the operation is performed: Profile, endpoint, etc.
+ :paramtype resource: str
+ :keyword operation: Operation type: Read, write, delete, etc.
+ :paramtype operation: str
+ :keyword description: Description of the operation.
+ :paramtype description: str
+ """
+ super().__init__(**kwargs)
+ self.provider = provider
+ self.resource = resource
+ self.operation = operation
+ self.description = description
+
+
+class OperationListResult(_serialization.Model):
+ """Result of the request to list Microsoft.Resources operations. It contains a list of operations
+ and a URL link to get the next set of results.
+
+ :ivar value: List of Microsoft.Resources operations.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.Operation]
+ :ivar next_link: URL to get the next set of operation list results if there are any.
+ :vartype next_link: str
+ """
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[Operation]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: List of Microsoft.Resources operations.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.Operation]
+ :keyword next_link: URL to get the next set of operation list results if there are any.
+ :paramtype next_link: str
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = next_link
+
+
+class ParametersLink(_serialization.Model):
+ """Entity representing the reference to the deployment parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar uri: The URI of the parameters file. Required.
+ :vartype uri: str
+ :ivar content_version: If included, must match the ContentVersion in the template.
+ :vartype content_version: str
+ """
+
+ _validation = {
+ "uri": {"required": True},
+ }
+
+ _attribute_map = {
+ "uri": {"key": "uri", "type": "str"},
+ "content_version": {"key": "contentVersion", "type": "str"},
+ }
+
+ def __init__(self, *, uri: str, content_version: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword uri: The URI of the parameters file. Required.
+ :paramtype uri: str
+ :keyword content_version: If included, must match the ContentVersion in the template.
+ :paramtype content_version: str
+ """
+ super().__init__(**kwargs)
+ self.uri = uri
+ self.content_version = content_version
+
+
+class Permission(_serialization.Model):
+ """Role definition permissions.
+
+ :ivar actions: Allowed actions.
+ :vartype actions: list[str]
+ :ivar not_actions: Denied actions.
+ :vartype not_actions: list[str]
+ :ivar data_actions: Allowed Data actions.
+ :vartype data_actions: list[str]
+ :ivar not_data_actions: Denied Data actions.
+ :vartype not_data_actions: list[str]
+ """
+
+ _attribute_map = {
+ "actions": {"key": "actions", "type": "[str]"},
+ "not_actions": {"key": "notActions", "type": "[str]"},
+ "data_actions": {"key": "dataActions", "type": "[str]"},
+ "not_data_actions": {"key": "notDataActions", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ actions: Optional[List[str]] = None,
+ not_actions: Optional[List[str]] = None,
+ data_actions: Optional[List[str]] = None,
+ not_data_actions: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword actions: Allowed actions.
+ :paramtype actions: list[str]
+ :keyword not_actions: Denied actions.
+ :paramtype not_actions: list[str]
+ :keyword data_actions: Allowed Data actions.
+ :paramtype data_actions: list[str]
+ :keyword not_data_actions: Denied Data actions.
+ :paramtype not_data_actions: list[str]
+ """
+ super().__init__(**kwargs)
+ self.actions = actions
+ self.not_actions = not_actions
+ self.data_actions = data_actions
+ self.not_data_actions = not_data_actions
+
+
+class Plan(_serialization.Model):
+ """Plan for the resource.
+
+ :ivar name: The plan ID.
+ :vartype name: str
+ :ivar publisher: The publisher ID.
+ :vartype publisher: str
+ :ivar product: The offer ID.
+ :vartype product: str
+ :ivar promotion_code: The promotion code.
+ :vartype promotion_code: str
+ :ivar version: The plan's version.
+ :vartype version: str
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "publisher": {"key": "publisher", "type": "str"},
+ "product": {"key": "product", "type": "str"},
+ "promotion_code": {"key": "promotionCode", "type": "str"},
+ "version": {"key": "version", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ publisher: Optional[str] = None,
+ product: Optional[str] = None,
+ promotion_code: Optional[str] = None,
+ version: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The plan ID.
+ :paramtype name: str
+ :keyword publisher: The publisher ID.
+ :paramtype publisher: str
+ :keyword product: The offer ID.
+ :paramtype product: str
+ :keyword promotion_code: The promotion code.
+ :paramtype promotion_code: str
+ :keyword version: The plan's version.
+ :paramtype version: str
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.publisher = publisher
+ self.product = product
+ self.promotion_code = promotion_code
+ self.version = version
+
+
+class Provider(_serialization.Model):
+ """Resource provider information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The provider ID.
+ :vartype id: str
+ :ivar namespace: The namespace of the resource provider.
+ :vartype namespace: str
+ :ivar registration_state: The registration state of the resource provider.
+ :vartype registration_state: str
+ :ivar registration_policy: The registration policy of the resource provider.
+ :vartype registration_policy: str
+ :ivar resource_types: The collection of provider resource types.
+ :vartype resource_types:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderResourceType]
+ :ivar provider_authorization_consent_state: The provider authorization consent state. Known
+ values are: "NotSpecified", "Required", "NotRequired", and "Consented".
+ :vartype provider_authorization_consent_state: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderAuthorizationConsentState
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "registration_state": {"readonly": True},
+ "registration_policy": {"readonly": True},
+ "resource_types": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "namespace": {"key": "namespace", "type": "str"},
+ "registration_state": {"key": "registrationState", "type": "str"},
+ "registration_policy": {"key": "registrationPolicy", "type": "str"},
+ "resource_types": {"key": "resourceTypes", "type": "[ProviderResourceType]"},
+ "provider_authorization_consent_state": {"key": "providerAuthorizationConsentState", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ namespace: Optional[str] = None,
+ provider_authorization_consent_state: Optional[Union[str, "_models.ProviderAuthorizationConsentState"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword namespace: The namespace of the resource provider.
+ :paramtype namespace: str
+ :keyword provider_authorization_consent_state: The provider authorization consent state. Known
+ values are: "NotSpecified", "Required", "NotRequired", and "Consented".
+ :paramtype provider_authorization_consent_state: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderAuthorizationConsentState
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.namespace = namespace
+ self.registration_state = None
+ self.registration_policy = None
+ self.resource_types = None
+ self.provider_authorization_consent_state = provider_authorization_consent_state
+
+
+class ProviderConsentDefinition(_serialization.Model):
+ """The provider consent.
+
+ :ivar consent_to_authorization: A value indicating whether authorization is consented or not.
+ :vartype consent_to_authorization: bool
+ """
+
+ _attribute_map = {
+ "consent_to_authorization": {"key": "consentToAuthorization", "type": "bool"},
+ }
+
+ def __init__(self, *, consent_to_authorization: Optional[bool] = None, **kwargs: Any) -> None:
+ """
+ :keyword consent_to_authorization: A value indicating whether authorization is consented or
+ not.
+ :paramtype consent_to_authorization: bool
+ """
+ super().__init__(**kwargs)
+ self.consent_to_authorization = consent_to_authorization
+
+
+class ProviderExtendedLocation(_serialization.Model):
+ """The provider extended location.
+
+ :ivar location: The azure location.
+ :vartype location: str
+ :ivar type: The extended location type.
+ :vartype type: str
+ :ivar extended_locations: The extended locations for the azure location.
+ :vartype extended_locations: list[str]
+ """
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "extended_locations": {"key": "extendedLocations", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: Optional[str] = None,
+ type: Optional[str] = None,
+ extended_locations: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: The azure location.
+ :paramtype location: str
+ :keyword type: The extended location type.
+ :paramtype type: str
+ :keyword extended_locations: The extended locations for the azure location.
+ :paramtype extended_locations: list[str]
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.type = type
+ self.extended_locations = extended_locations
+
+
+class ProviderListResult(_serialization.Model):
+ """List of resource providers.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of resource providers.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[Provider]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.Provider"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of resource providers.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ProviderPermission(_serialization.Model):
+ """The provider permission.
+
+ :ivar application_id: The application id.
+ :vartype application_id: str
+ :ivar role_definition: Role definition properties.
+ :vartype role_definition: ~azure.mgmt.resource.resources.v2024_07_01.models.RoleDefinition
+ :ivar managed_by_role_definition: Role definition properties.
+ :vartype managed_by_role_definition:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.RoleDefinition
+ :ivar provider_authorization_consent_state: The provider authorization consent state. Known
+ values are: "NotSpecified", "Required", "NotRequired", and "Consented".
+ :vartype provider_authorization_consent_state: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderAuthorizationConsentState
+ """
+
+ _attribute_map = {
+ "application_id": {"key": "applicationId", "type": "str"},
+ "role_definition": {"key": "roleDefinition", "type": "RoleDefinition"},
+ "managed_by_role_definition": {"key": "managedByRoleDefinition", "type": "RoleDefinition"},
+ "provider_authorization_consent_state": {"key": "providerAuthorizationConsentState", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ application_id: Optional[str] = None,
+ role_definition: Optional["_models.RoleDefinition"] = None,
+ managed_by_role_definition: Optional["_models.RoleDefinition"] = None,
+ provider_authorization_consent_state: Optional[Union[str, "_models.ProviderAuthorizationConsentState"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword application_id: The application id.
+ :paramtype application_id: str
+ :keyword role_definition: Role definition properties.
+ :paramtype role_definition: ~azure.mgmt.resource.resources.v2024_07_01.models.RoleDefinition
+ :keyword managed_by_role_definition: Role definition properties.
+ :paramtype managed_by_role_definition:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.RoleDefinition
+ :keyword provider_authorization_consent_state: The provider authorization consent state. Known
+ values are: "NotSpecified", "Required", "NotRequired", and "Consented".
+ :paramtype provider_authorization_consent_state: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderAuthorizationConsentState
+ """
+ super().__init__(**kwargs)
+ self.application_id = application_id
+ self.role_definition = role_definition
+ self.managed_by_role_definition = managed_by_role_definition
+ self.provider_authorization_consent_state = provider_authorization_consent_state
+
+
+class ProviderPermissionListResult(_serialization.Model):
+ """List of provider permissions.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of provider permissions.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderPermission]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[ProviderPermission]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.ProviderPermission"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of provider permissions.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderPermission]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ProviderRegistrationRequest(_serialization.Model):
+ """The provider registration definition.
+
+ :ivar third_party_provider_consent: The provider consent.
+ :vartype third_party_provider_consent:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderConsentDefinition
+ """
+
+ _attribute_map = {
+ "third_party_provider_consent": {"key": "thirdPartyProviderConsent", "type": "ProviderConsentDefinition"},
+ }
+
+ def __init__(
+ self, *, third_party_provider_consent: Optional["_models.ProviderConsentDefinition"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword third_party_provider_consent: The provider consent.
+ :paramtype third_party_provider_consent:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderConsentDefinition
+ """
+ super().__init__(**kwargs)
+ self.third_party_provider_consent = third_party_provider_consent
+
+
+class ProviderResourceType(_serialization.Model):
+ """Resource type managed by the resource provider.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar resource_type: The resource type.
+ :vartype resource_type: str
+ :ivar locations: The collection of locations where this resource type can be created.
+ :vartype locations: list[str]
+ :ivar location_mappings: The location mappings that are supported by this resource type.
+ :vartype location_mappings:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderExtendedLocation]
+ :ivar aliases: The aliases that are supported by this resource type.
+ :vartype aliases: list[~azure.mgmt.resource.resources.v2024_07_01.models.Alias]
+ :ivar api_versions: The API version.
+ :vartype api_versions: list[str]
+ :ivar default_api_version: The default API version.
+ :vartype default_api_version: str
+ :ivar zone_mappings:
+ :vartype zone_mappings: list[~azure.mgmt.resource.resources.v2024_07_01.models.ZoneMapping]
+ :ivar api_profiles: The API profiles for the resource provider.
+ :vartype api_profiles: list[~azure.mgmt.resource.resources.v2024_07_01.models.ApiProfile]
+ :ivar capabilities: The additional capabilities offered by this resource type.
+ :vartype capabilities: str
+ :ivar properties: The properties.
+ :vartype properties: dict[str, str]
+ """
+
+ _validation = {
+ "default_api_version": {"readonly": True},
+ "api_profiles": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "resource_type": {"key": "resourceType", "type": "str"},
+ "locations": {"key": "locations", "type": "[str]"},
+ "location_mappings": {"key": "locationMappings", "type": "[ProviderExtendedLocation]"},
+ "aliases": {"key": "aliases", "type": "[Alias]"},
+ "api_versions": {"key": "apiVersions", "type": "[str]"},
+ "default_api_version": {"key": "defaultApiVersion", "type": "str"},
+ "zone_mappings": {"key": "zoneMappings", "type": "[ZoneMapping]"},
+ "api_profiles": {"key": "apiProfiles", "type": "[ApiProfile]"},
+ "capabilities": {"key": "capabilities", "type": "str"},
+ "properties": {"key": "properties", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_type: Optional[str] = None,
+ locations: Optional[List[str]] = None,
+ location_mappings: Optional[List["_models.ProviderExtendedLocation"]] = None,
+ aliases: Optional[List["_models.Alias"]] = None,
+ api_versions: Optional[List[str]] = None,
+ zone_mappings: Optional[List["_models.ZoneMapping"]] = None,
+ capabilities: Optional[str] = None,
+ properties: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_type: The resource type.
+ :paramtype resource_type: str
+ :keyword locations: The collection of locations where this resource type can be created.
+ :paramtype locations: list[str]
+ :keyword location_mappings: The location mappings that are supported by this resource type.
+ :paramtype location_mappings:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderExtendedLocation]
+ :keyword aliases: The aliases that are supported by this resource type.
+ :paramtype aliases: list[~azure.mgmt.resource.resources.v2024_07_01.models.Alias]
+ :keyword api_versions: The API version.
+ :paramtype api_versions: list[str]
+ :keyword zone_mappings:
+ :paramtype zone_mappings: list[~azure.mgmt.resource.resources.v2024_07_01.models.ZoneMapping]
+ :keyword capabilities: The additional capabilities offered by this resource type.
+ :paramtype capabilities: str
+ :keyword properties: The properties.
+ :paramtype properties: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.resource_type = resource_type
+ self.locations = locations
+ self.location_mappings = location_mappings
+ self.aliases = aliases
+ self.api_versions = api_versions
+ self.default_api_version = None
+ self.zone_mappings = zone_mappings
+ self.api_profiles = None
+ self.capabilities = capabilities
+ self.properties = properties
+
+
+class ProviderResourceTypeListResult(_serialization.Model):
+ """List of resource types of a resource provider.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of resource types.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderResourceType]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[ProviderResourceType]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.ProviderResourceType"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of resource types.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ProviderResourceType]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ResourceGroup(_serialization.Model):
+ """Resource group information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: The ID of the resource group.
+ :vartype id: str
+ :ivar name: The name of the resource group.
+ :vartype name: str
+ :ivar type: The type of the resource group.
+ :vartype type: str
+ :ivar properties: The resource group properties.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupProperties
+ :ivar location: The location of the resource group. It cannot be changed after the resource
+ group has been created. It must be one of the supported Azure locations. Required.
+ :vartype location: str
+ :ivar managed_by: The ID of the resource that manages this resource group.
+ :vartype managed_by: str
+ :ivar tags: The tags attached to the resource group.
+ :vartype tags: dict[str, str]
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "location": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "properties": {"key": "properties", "type": "ResourceGroupProperties"},
+ "location": {"key": "location", "type": "str"},
+ "managed_by": {"key": "managedBy", "type": "str"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: str,
+ properties: Optional["_models.ResourceGroupProperties"] = None,
+ managed_by: Optional[str] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword properties: The resource group properties.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupProperties
+ :keyword location: The location of the resource group. It cannot be changed after the resource
+ group has been created. It must be one of the supported Azure locations. Required.
+ :paramtype location: str
+ :keyword managed_by: The ID of the resource that manages this resource group.
+ :paramtype managed_by: str
+ :keyword tags: The tags attached to the resource group.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.properties = properties
+ self.location = location
+ self.managed_by = managed_by
+ self.tags = tags
+
+
+class ResourceGroupExportResult(_serialization.Model):
+ """Resource group export result.
+
+ :ivar template: The template content. Used if outputFormat is empty or set to 'Json'.
+ :vartype template: JSON
+ :ivar output: The formatted export content. Used if outputFormat is set to 'Bicep'.
+ :vartype output: str
+ :ivar error: The template export error.
+ :vartype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ """
+
+ _attribute_map = {
+ "template": {"key": "template", "type": "object"},
+ "output": {"key": "output", "type": "str"},
+ "error": {"key": "error", "type": "ErrorResponse"},
+ }
+
+ def __init__(
+ self,
+ *,
+ template: Optional[JSON] = None,
+ output: Optional[str] = None,
+ error: Optional["_models.ErrorResponse"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword template: The template content. Used if outputFormat is empty or set to 'Json'.
+ :paramtype template: JSON
+ :keyword output: The formatted export content. Used if outputFormat is set to 'Bicep'.
+ :paramtype output: str
+ :keyword error: The template export error.
+ :paramtype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ """
+ super().__init__(**kwargs)
+ self.template = template
+ self.output = output
+ self.error = error
+
+
+class ResourceGroupFilter(_serialization.Model):
+ """Resource group filter.
+
+ :ivar tag_name: The tag name.
+ :vartype tag_name: str
+ :ivar tag_value: The tag value.
+ :vartype tag_value: str
+ """
+
+ _attribute_map = {
+ "tag_name": {"key": "tagName", "type": "str"},
+ "tag_value": {"key": "tagValue", "type": "str"},
+ }
+
+ def __init__(self, *, tag_name: Optional[str] = None, tag_value: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword tag_name: The tag name.
+ :paramtype tag_name: str
+ :keyword tag_value: The tag value.
+ :paramtype tag_value: str
+ """
+ super().__init__(**kwargs)
+ self.tag_name = tag_name
+ self.tag_value = tag_value
+
+
+class ResourceGroupListResult(_serialization.Model):
+ """List of resource groups.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of resource groups.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[ResourceGroup]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.ResourceGroup"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of resource groups.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ResourceGroupPatchable(_serialization.Model):
+ """Resource group information.
+
+ :ivar name: The name of the resource group.
+ :vartype name: str
+ :ivar properties: The resource group properties.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupProperties
+ :ivar managed_by: The ID of the resource that manages this resource group.
+ :vartype managed_by: str
+ :ivar tags: The tags attached to the resource group.
+ :vartype tags: dict[str, str]
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "properties": {"key": "properties", "type": "ResourceGroupProperties"},
+ "managed_by": {"key": "managedBy", "type": "str"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ properties: Optional["_models.ResourceGroupProperties"] = None,
+ managed_by: Optional[str] = None,
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The name of the resource group.
+ :paramtype name: str
+ :keyword properties: The resource group properties.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupProperties
+ :keyword managed_by: The ID of the resource that manages this resource group.
+ :paramtype managed_by: str
+ :keyword tags: The tags attached to the resource group.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.properties = properties
+ self.managed_by = managed_by
+ self.tags = tags
+
+
+class ResourceGroupProperties(_serialization.Model):
+ """The resource group properties.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar provisioning_state: The provisioning state.
+ :vartype provisioning_state: str
+ """
+
+ _validation = {
+ "provisioning_state": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "provisioning_state": {"key": "provisioningState", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.provisioning_state = None
+
+
+class ResourceListResult(_serialization.Model):
+ """List of resource groups.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of resources.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[GenericResourceExpanded]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.GenericResourceExpanded"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of resources.
+ :paramtype value:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class ResourceProviderOperationDisplayProperties(_serialization.Model): # pylint: disable=name-too-long
+ """Resource provider operation's display properties.
+
+ :ivar publisher: Operation description.
+ :vartype publisher: str
+ :ivar provider: Operation provider.
+ :vartype provider: str
+ :ivar resource: Operation resource.
+ :vartype resource: str
+ :ivar operation: Resource provider operation.
+ :vartype operation: str
+ :ivar description: Operation description.
+ :vartype description: str
+ """
+
+ _attribute_map = {
+ "publisher": {"key": "publisher", "type": "str"},
+ "provider": {"key": "provider", "type": "str"},
+ "resource": {"key": "resource", "type": "str"},
+ "operation": {"key": "operation", "type": "str"},
+ "description": {"key": "description", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ publisher: Optional[str] = None,
+ provider: Optional[str] = None,
+ resource: Optional[str] = None,
+ operation: Optional[str] = None,
+ description: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword publisher: Operation description.
+ :paramtype publisher: str
+ :keyword provider: Operation provider.
+ :paramtype provider: str
+ :keyword resource: Operation resource.
+ :paramtype resource: str
+ :keyword operation: Resource provider operation.
+ :paramtype operation: str
+ :keyword description: Operation description.
+ :paramtype description: str
+ """
+ super().__init__(**kwargs)
+ self.publisher = publisher
+ self.provider = provider
+ self.resource = resource
+ self.operation = operation
+ self.description = description
+
+
+class ResourceReference(_serialization.Model):
+ """The resource Id model.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The fully qualified resource Id.
+ :vartype id: str
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.id = None
+
+
+class ResourcesMoveInfo(_serialization.Model):
+ """Parameters of move resources.
+
+ :ivar resources: The IDs of the resources.
+ :vartype resources: list[str]
+ :ivar target_resource_group: The target resource group.
+ :vartype target_resource_group: str
+ """
+
+ _attribute_map = {
+ "resources": {"key": "resources", "type": "[str]"},
+ "target_resource_group": {"key": "targetResourceGroup", "type": "str"},
+ }
+
+ def __init__(
+ self, *, resources: Optional[List[str]] = None, target_resource_group: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword resources: The IDs of the resources.
+ :paramtype resources: list[str]
+ :keyword target_resource_group: The target resource group.
+ :paramtype target_resource_group: str
+ """
+ super().__init__(**kwargs)
+ self.resources = resources
+ self.target_resource_group = target_resource_group
+
+
+class RoleDefinition(_serialization.Model):
+ """Role definition properties.
+
+ :ivar id: The role definition ID.
+ :vartype id: str
+ :ivar name: The role definition name.
+ :vartype name: str
+ :ivar is_service_role: If this is a service role.
+ :vartype is_service_role: bool
+ :ivar permissions: Role definition permissions.
+ :vartype permissions: list[~azure.mgmt.resource.resources.v2024_07_01.models.Permission]
+ :ivar scopes: Role definition assignable scopes.
+ :vartype scopes: list[str]
+ """
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "is_service_role": {"key": "isServiceRole", "type": "bool"},
+ "permissions": {"key": "permissions", "type": "[Permission]"},
+ "scopes": {"key": "scopes", "type": "[str]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ name: Optional[str] = None,
+ is_service_role: Optional[bool] = None,
+ permissions: Optional[List["_models.Permission"]] = None,
+ scopes: Optional[List[str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword id: The role definition ID.
+ :paramtype id: str
+ :keyword name: The role definition name.
+ :paramtype name: str
+ :keyword is_service_role: If this is a service role.
+ :paramtype is_service_role: bool
+ :keyword permissions: Role definition permissions.
+ :paramtype permissions: list[~azure.mgmt.resource.resources.v2024_07_01.models.Permission]
+ :keyword scopes: Role definition assignable scopes.
+ :paramtype scopes: list[str]
+ """
+ super().__init__(**kwargs)
+ self.id = id
+ self.name = name
+ self.is_service_role = is_service_role
+ self.permissions = permissions
+ self.scopes = scopes
+
+
+class ScopedDeployment(_serialization.Model):
+ """Deployment operation parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar location: The location to store the deployment data. Required.
+ :vartype location: str
+ :ivar properties: The deployment properties. Required.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentProperties
+ :ivar tags: Deployment tags.
+ :vartype tags: dict[str, str]
+ """
+
+ _validation = {
+ "location": {"required": True},
+ "properties": {"required": True},
+ }
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentProperties"},
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ location: str,
+ properties: "_models.DeploymentProperties",
+ tags: Optional[Dict[str, str]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword location: The location to store the deployment data. Required.
+ :paramtype location: str
+ :keyword properties: The deployment properties. Required.
+ :paramtype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentProperties
+ :keyword tags: Deployment tags.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.properties = properties
+ self.tags = tags
+
+
+class ScopedDeploymentWhatIf(_serialization.Model):
+ """Deployment What-if operation parameters.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar location: The location to store the deployment data. Required.
+ :vartype location: str
+ :ivar properties: The deployment properties. Required.
+ :vartype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfProperties
+ """
+
+ _validation = {
+ "location": {"required": True},
+ "properties": {"required": True},
+ }
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "properties": {"key": "properties", "type": "DeploymentWhatIfProperties"},
+ }
+
+ def __init__(self, *, location: str, properties: "_models.DeploymentWhatIfProperties", **kwargs: Any) -> None:
+ """
+ :keyword location: The location to store the deployment data. Required.
+ :paramtype location: str
+ :keyword properties: The deployment properties. Required.
+ :paramtype properties:
+ ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIfProperties
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.properties = properties
+
+
+class Sku(_serialization.Model):
+ """SKU for the resource.
+
+ :ivar name: The SKU name.
+ :vartype name: str
+ :ivar tier: The SKU tier.
+ :vartype tier: str
+ :ivar size: The SKU size.
+ :vartype size: str
+ :ivar family: The SKU family.
+ :vartype family: str
+ :ivar model: The SKU model.
+ :vartype model: str
+ :ivar capacity: The SKU capacity.
+ :vartype capacity: int
+ """
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "tier": {"key": "tier", "type": "str"},
+ "size": {"key": "size", "type": "str"},
+ "family": {"key": "family", "type": "str"},
+ "model": {"key": "model", "type": "str"},
+ "capacity": {"key": "capacity", "type": "int"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: Optional[str] = None,
+ tier: Optional[str] = None,
+ size: Optional[str] = None,
+ family: Optional[str] = None,
+ model: Optional[str] = None,
+ capacity: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The SKU name.
+ :paramtype name: str
+ :keyword tier: The SKU tier.
+ :paramtype tier: str
+ :keyword size: The SKU size.
+ :paramtype size: str
+ :keyword family: The SKU family.
+ :paramtype family: str
+ :keyword model: The SKU model.
+ :paramtype model: str
+ :keyword capacity: The SKU capacity.
+ :paramtype capacity: int
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.tier = tier
+ self.size = size
+ self.family = family
+ self.model = model
+ self.capacity = capacity
+
+
+class StatusMessage(_serialization.Model):
+ """Operation status message object.
+
+ :ivar status: Status of the deployment operation.
+ :vartype status: str
+ :ivar error: The error reported by the operation.
+ :vartype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ """
+
+ _attribute_map = {
+ "status": {"key": "status", "type": "str"},
+ "error": {"key": "error", "type": "ErrorResponse"},
+ }
+
+ def __init__(
+ self, *, status: Optional[str] = None, error: Optional["_models.ErrorResponse"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword status: Status of the deployment operation.
+ :paramtype status: str
+ :keyword error: The error reported by the operation.
+ :paramtype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ """
+ super().__init__(**kwargs)
+ self.status = status
+ self.error = error
+
+
+class SubResource(_serialization.Model):
+ """Sub-resource.
+
+ :ivar id: Resource ID.
+ :vartype id: str
+ """
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ }
+
+ def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin
+ """
+ :keyword id: Resource ID.
+ :paramtype id: str
+ """
+ super().__init__(**kwargs)
+ self.id = id
+
+
+class TagCount(_serialization.Model):
+ """Tag count.
+
+ :ivar type: Type of count.
+ :vartype type: str
+ :ivar value: Value of count.
+ :vartype value: int
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "value": {"key": "value", "type": "int"},
+ }
+
+ def __init__(self, *, type: Optional[str] = None, value: Optional[int] = None, **kwargs: Any) -> None:
+ """
+ :keyword type: Type of count.
+ :paramtype type: str
+ :keyword value: Value of count.
+ :paramtype value: int
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.value = value
+
+
+class TagDetails(_serialization.Model):
+ """Tag details.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The tag name ID.
+ :vartype id: str
+ :ivar tag_name: The tag name.
+ :vartype tag_name: str
+ :ivar count: The total number of resources that use the resource tag. When a tag is initially
+ created and has no associated resources, the value is 0.
+ :vartype count: ~azure.mgmt.resource.resources.v2024_07_01.models.TagCount
+ :ivar values: The list of tag values.
+ :vartype values: list[~azure.mgmt.resource.resources.v2024_07_01.models.TagValue]
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "tag_name": {"key": "tagName", "type": "str"},
+ "count": {"key": "count", "type": "TagCount"},
+ "values": {"key": "values", "type": "[TagValue]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ tag_name: Optional[str] = None,
+ count: Optional["_models.TagCount"] = None,
+ values: Optional[List["_models.TagValue"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword tag_name: The tag name.
+ :paramtype tag_name: str
+ :keyword count: The total number of resources that use the resource tag. When a tag is
+ initially created and has no associated resources, the value is 0.
+ :paramtype count: ~azure.mgmt.resource.resources.v2024_07_01.models.TagCount
+ :keyword values: The list of tag values.
+ :paramtype values: list[~azure.mgmt.resource.resources.v2024_07_01.models.TagValue]
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.tag_name = tag_name
+ self.count = count
+ self.values = values
+
+
+class Tags(_serialization.Model):
+ """A dictionary of name and value pairs.
+
+ :ivar tags: Dictionary of :code:``.
+ :vartype tags: dict[str, str]
+ """
+
+ _attribute_map = {
+ "tags": {"key": "tags", "type": "{str}"},
+ }
+
+ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
+ """
+ :keyword tags: Dictionary of :code:``.
+ :paramtype tags: dict[str, str]
+ """
+ super().__init__(**kwargs)
+ self.tags = tags
+
+
+class TagsListResult(_serialization.Model):
+ """List of subscription tags.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: An array of tags.
+ :vartype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails]
+ :ivar next_link: The URL to use for getting the next set of results.
+ :vartype next_link: str
+ """
+
+ _validation = {
+ "next_link": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "value": {"key": "value", "type": "[TagDetails]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.TagDetails"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: An array of tags.
+ :paramtype value: list[~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class TagsPatchResource(_serialization.Model):
+ """Wrapper resource for tags patch API request only.
+
+ :ivar operation: The operation type for the patch API. Known values are: "Replace", "Merge",
+ and "Delete".
+ :vartype operation: str or ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchOperation
+ :ivar properties: The set of tags.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.Tags
+ """
+
+ _attribute_map = {
+ "operation": {"key": "operation", "type": "str"},
+ "properties": {"key": "properties", "type": "Tags"},
+ }
+
+ def __init__(
+ self,
+ *,
+ operation: Optional[Union[str, "_models.TagsPatchOperation"]] = None,
+ properties: Optional["_models.Tags"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword operation: The operation type for the patch API. Known values are: "Replace", "Merge",
+ and "Delete".
+ :paramtype operation: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchOperation
+ :keyword properties: The set of tags.
+ :paramtype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.Tags
+ """
+ super().__init__(**kwargs)
+ self.operation = operation
+ self.properties = properties
+
+
+class TagsResource(_serialization.Model):
+ """Wrapper resource for tags API requests and responses.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: The ID of the tags wrapper resource.
+ :vartype id: str
+ :ivar name: The name of the tags wrapper resource.
+ :vartype name: str
+ :ivar type: The type of the tags wrapper resource.
+ :vartype type: str
+ :ivar properties: The set of tags. Required.
+ :vartype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.Tags
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "properties": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "properties": {"key": "properties", "type": "Tags"},
+ }
+
+ def __init__(self, *, properties: "_models.Tags", **kwargs: Any) -> None:
+ """
+ :keyword properties: The set of tags. Required.
+ :paramtype properties: ~azure.mgmt.resource.resources.v2024_07_01.models.Tags
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.properties = properties
+
+
+class TagValue(_serialization.Model):
+ """Tag information.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar id: The tag value ID.
+ :vartype id: str
+ :ivar tag_value: The tag value.
+ :vartype tag_value: str
+ :ivar count: The tag value count.
+ :vartype count: ~azure.mgmt.resource.resources.v2024_07_01.models.TagCount
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "tag_value": {"key": "tagValue", "type": "str"},
+ "count": {"key": "count", "type": "TagCount"},
+ }
+
+ def __init__(
+ self, *, tag_value: Optional[str] = None, count: Optional["_models.TagCount"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword tag_value: The tag value.
+ :paramtype tag_value: str
+ :keyword count: The tag value count.
+ :paramtype count: ~azure.mgmt.resource.resources.v2024_07_01.models.TagCount
+ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.tag_value = tag_value
+ self.count = count
+
+
+class TargetResource(_serialization.Model):
+ """Target resource.
+
+ :ivar id: The ID of the resource.
+ :vartype id: str
+ :ivar resource_name: The name of the resource.
+ :vartype resource_name: str
+ :ivar resource_type: The type of the resource.
+ :vartype resource_type: str
+ """
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "resource_name": {"key": "resourceName", "type": "str"},
+ "resource_type": {"key": "resourceType", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ resource_name: Optional[str] = None,
+ resource_type: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword id: The ID of the resource.
+ :paramtype id: str
+ :keyword resource_name: The name of the resource.
+ :paramtype resource_name: str
+ :keyword resource_type: The type of the resource.
+ :paramtype resource_type: str
+ """
+ super().__init__(**kwargs)
+ self.id = id
+ self.resource_name = resource_name
+ self.resource_type = resource_type
+
+
+class TemplateHashResult(_serialization.Model):
+ """Result of the request to calculate template hash. It contains a string of minified template and
+ its hash.
+
+ :ivar minified_template: The minified template string.
+ :vartype minified_template: str
+ :ivar template_hash: The template hash.
+ :vartype template_hash: str
+ """
+
+ _attribute_map = {
+ "minified_template": {"key": "minifiedTemplate", "type": "str"},
+ "template_hash": {"key": "templateHash", "type": "str"},
+ }
+
+ def __init__(
+ self, *, minified_template: Optional[str] = None, template_hash: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword minified_template: The minified template string.
+ :paramtype minified_template: str
+ :keyword template_hash: The template hash.
+ :paramtype template_hash: str
+ """
+ super().__init__(**kwargs)
+ self.minified_template = minified_template
+ self.template_hash = template_hash
+
+
+class TemplateLink(_serialization.Model):
+ """Entity representing the reference to the template.
+
+ :ivar uri: The URI of the template to deploy. Use either the uri or id property, but not both.
+ :vartype uri: str
+ :ivar id: The resource id of a Template Spec. Use either the id or uri property, but not both.
+ :vartype id: str
+ :ivar relative_path: The relativePath property can be used to deploy a linked template at a
+ location relative to the parent. If the parent template was linked with a TemplateSpec, this
+ will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child
+ deployment will be a combination of the parent and relativePath URIs.
+ :vartype relative_path: str
+ :ivar content_version: If included, must match the ContentVersion in the template.
+ :vartype content_version: str
+ :ivar query_string: The query string (for example, a SAS token) to be used with the
+ templateLink URI.
+ :vartype query_string: str
+ """
+
+ _attribute_map = {
+ "uri": {"key": "uri", "type": "str"},
+ "id": {"key": "id", "type": "str"},
+ "relative_path": {"key": "relativePath", "type": "str"},
+ "content_version": {"key": "contentVersion", "type": "str"},
+ "query_string": {"key": "queryString", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ uri: Optional[str] = None,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ relative_path: Optional[str] = None,
+ content_version: Optional[str] = None,
+ query_string: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword uri: The URI of the template to deploy. Use either the uri or id property, but not
+ both.
+ :paramtype uri: str
+ :keyword id: The resource id of a Template Spec. Use either the id or uri property, but not
+ both.
+ :paramtype id: str
+ :keyword relative_path: The relativePath property can be used to deploy a linked template at a
+ location relative to the parent. If the parent template was linked with a TemplateSpec, this
+ will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child
+ deployment will be a combination of the parent and relativePath URIs.
+ :paramtype relative_path: str
+ :keyword content_version: If included, must match the ContentVersion in the template.
+ :paramtype content_version: str
+ :keyword query_string: The query string (for example, a SAS token) to be used with the
+ templateLink URI.
+ :paramtype query_string: str
+ """
+ super().__init__(**kwargs)
+ self.uri = uri
+ self.id = id
+ self.relative_path = relative_path
+ self.content_version = content_version
+ self.query_string = query_string
+
+
+class WhatIfChange(_serialization.Model):
+ """Information about a single resource change predicted by What-If operation.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar resource_id: Resource ID. Required.
+ :vartype resource_id: str
+ :ivar change_type: Type of change that will be made to the resource when the deployment is
+ executed. Required. Known values are: "Create", "Delete", "Ignore", "Deploy", "NoChange",
+ "Modify", and "Unsupported".
+ :vartype change_type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ChangeType
+ :ivar unsupported_reason: The explanation about why the resource is unsupported by What-If.
+ :vartype unsupported_reason: str
+ :ivar before: The snapshot of the resource before the deployment is executed.
+ :vartype before: JSON
+ :ivar after: The predicted snapshot of the resource after the deployment is executed.
+ :vartype after: JSON
+ :ivar delta: The predicted changes to resource properties.
+ :vartype delta: list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfPropertyChange]
+ """
+
+ _validation = {
+ "resource_id": {"required": True},
+ "change_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "resource_id": {"key": "resourceId", "type": "str"},
+ "change_type": {"key": "changeType", "type": "str"},
+ "unsupported_reason": {"key": "unsupportedReason", "type": "str"},
+ "before": {"key": "before", "type": "object"},
+ "after": {"key": "after", "type": "object"},
+ "delta": {"key": "delta", "type": "[WhatIfPropertyChange]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ resource_id: str,
+ change_type: Union[str, "_models.ChangeType"],
+ unsupported_reason: Optional[str] = None,
+ before: Optional[JSON] = None,
+ after: Optional[JSON] = None,
+ delta: Optional[List["_models.WhatIfPropertyChange"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword resource_id: Resource ID. Required.
+ :paramtype resource_id: str
+ :keyword change_type: Type of change that will be made to the resource when the deployment is
+ executed. Required. Known values are: "Create", "Delete", "Ignore", "Deploy", "NoChange",
+ "Modify", and "Unsupported".
+ :paramtype change_type: str or ~azure.mgmt.resource.resources.v2024_07_01.models.ChangeType
+ :keyword unsupported_reason: The explanation about why the resource is unsupported by What-If.
+ :paramtype unsupported_reason: str
+ :keyword before: The snapshot of the resource before the deployment is executed.
+ :paramtype before: JSON
+ :keyword after: The predicted snapshot of the resource after the deployment is executed.
+ :paramtype after: JSON
+ :keyword delta: The predicted changes to resource properties.
+ :paramtype delta: list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfPropertyChange]
+ """
+ super().__init__(**kwargs)
+ self.resource_id = resource_id
+ self.change_type = change_type
+ self.unsupported_reason = unsupported_reason
+ self.before = before
+ self.after = after
+ self.delta = delta
+
+
+class WhatIfOperationResult(_serialization.Model):
+ """Result of the What-If operation. Contains a list of predicted changes and a URL link to get to
+ the next set of results.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar status: Status of the What-If operation.
+ :vartype status: str
+ :ivar error: Error when What-If operation fails.
+ :vartype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ :ivar changes: List of resource changes predicted by What-If operation.
+ :vartype changes: list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfChange]
+ :ivar potential_changes: List of resource changes predicted by What-If operation.
+ :vartype potential_changes:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfChange]
+ :ivar diagnostics: List of resource diagnostics detected by What-If operation.
+ :vartype diagnostics:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentDiagnosticsDefinition]
+ """
+
+ _validation = {
+ "diagnostics": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "status": {"key": "status", "type": "str"},
+ "error": {"key": "error", "type": "ErrorResponse"},
+ "changes": {"key": "properties.changes", "type": "[WhatIfChange]"},
+ "potential_changes": {"key": "properties.potentialChanges", "type": "[WhatIfChange]"},
+ "diagnostics": {"key": "properties.diagnostics", "type": "[DeploymentDiagnosticsDefinition]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ status: Optional[str] = None,
+ error: Optional["_models.ErrorResponse"] = None,
+ changes: Optional[List["_models.WhatIfChange"]] = None,
+ potential_changes: Optional[List["_models.WhatIfChange"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword status: Status of the What-If operation.
+ :paramtype status: str
+ :keyword error: Error when What-If operation fails.
+ :paramtype error: ~azure.mgmt.resource.resources.v2024_07_01.models.ErrorResponse
+ :keyword changes: List of resource changes predicted by What-If operation.
+ :paramtype changes: list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfChange]
+ :keyword potential_changes: List of resource changes predicted by What-If operation.
+ :paramtype potential_changes:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfChange]
+ """
+ super().__init__(**kwargs)
+ self.status = status
+ self.error = error
+ self.changes = changes
+ self.potential_changes = potential_changes
+ self.diagnostics = None
+
+
+class WhatIfPropertyChange(_serialization.Model):
+ """The predicted change to the resource property.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar path: The path of the property. Required.
+ :vartype path: str
+ :ivar property_change_type: The type of property change. Required. Known values are: "Create",
+ "Delete", "Modify", "Array", and "NoEffect".
+ :vartype property_change_type: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.PropertyChangeType
+ :ivar before: The value of the property before the deployment is executed.
+ :vartype before: JSON
+ :ivar after: The value of the property after the deployment is executed.
+ :vartype after: JSON
+ :ivar children: Nested property changes.
+ :vartype children: list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfPropertyChange]
+ """
+
+ _validation = {
+ "path": {"required": True},
+ "property_change_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "path": {"key": "path", "type": "str"},
+ "property_change_type": {"key": "propertyChangeType", "type": "str"},
+ "before": {"key": "before", "type": "object"},
+ "after": {"key": "after", "type": "object"},
+ "children": {"key": "children", "type": "[WhatIfPropertyChange]"},
+ }
+
+ def __init__(
+ self,
+ *,
+ path: str,
+ property_change_type: Union[str, "_models.PropertyChangeType"],
+ before: Optional[JSON] = None,
+ after: Optional[JSON] = None,
+ children: Optional[List["_models.WhatIfPropertyChange"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword path: The path of the property. Required.
+ :paramtype path: str
+ :keyword property_change_type: The type of property change. Required. Known values are:
+ "Create", "Delete", "Modify", "Array", and "NoEffect".
+ :paramtype property_change_type: str or
+ ~azure.mgmt.resource.resources.v2024_07_01.models.PropertyChangeType
+ :keyword before: The value of the property before the deployment is executed.
+ :paramtype before: JSON
+ :keyword after: The value of the property after the deployment is executed.
+ :paramtype after: JSON
+ :keyword children: Nested property changes.
+ :paramtype children:
+ list[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfPropertyChange]
+ """
+ super().__init__(**kwargs)
+ self.path = path
+ self.property_change_type = property_change_type
+ self.before = before
+ self.after = after
+ self.children = children
+
+
+class ZoneMapping(_serialization.Model):
+ """ZoneMapping.
+
+ :ivar location: The location of the zone mapping.
+ :vartype location: str
+ :ivar zones:
+ :vartype zones: list[str]
+ """
+
+ _attribute_map = {
+ "location": {"key": "location", "type": "str"},
+ "zones": {"key": "zones", "type": "[str]"},
+ }
+
+ def __init__(self, *, location: Optional[str] = None, zones: Optional[List[str]] = None, **kwargs: Any) -> None:
+ """
+ :keyword location: The location of the zone mapping.
+ :paramtype location: str
+ :keyword zones:
+ :paramtype zones: list[str]
+ """
+ super().__init__(**kwargs)
+ self.location = location
+ self.zones = zones
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_patch.py
new file mode 100644
index 000000000000..f7dd32510333
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_patch.py
@@ -0,0 +1,20 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_resource_management_client_enums.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_resource_management_client_enums.py
new file mode 100644
index 000000000000..1227b21bcb44
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/models/_resource_management_client_enums.py
@@ -0,0 +1,235 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from enum import Enum
+from azure.core import CaseInsensitiveEnumMeta
+
+
+class AliasPathAttributes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The attributes of the token that the alias path is referring to."""
+
+ NONE = "None"
+ """The token that the alias path is referring to has no attributes."""
+ MODIFIABLE = "Modifiable"
+ """The token that the alias path is referring to is modifiable by policies with 'modify' effect."""
+
+
+class AliasPathTokenType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of the token that the alias path is referring to."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ """The token type is not specified."""
+ ANY = "Any"
+ """The token type can be anything."""
+ STRING = "String"
+ """The token type is string."""
+ OBJECT = "Object"
+ """The token type is object."""
+ ARRAY = "Array"
+ """The token type is array."""
+ INTEGER = "Integer"
+ """The token type is integer."""
+ NUMBER = "Number"
+ """The token type is number."""
+ BOOLEAN = "Boolean"
+ """The token type is boolean."""
+
+
+class AliasPatternType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of alias pattern."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ """NotSpecified is not allowed."""
+ EXTRACT = "Extract"
+ """Extract is the only allowed value."""
+
+
+class AliasType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of the alias."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ """Alias type is unknown (same as not providing alias type)."""
+ PLAIN_TEXT = "PlainText"
+ """Alias value is not secret."""
+ MASK = "Mask"
+ """Alias value is secret."""
+
+
+class ChangeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of change that will be made to the resource when the deployment is executed."""
+
+ CREATE = "Create"
+ """The resource does not exist in the current state but is present in the desired state. The
+ resource will be created when the deployment is executed."""
+ DELETE = "Delete"
+ """The resource exists in the current state and is missing from the desired state. The resource
+ will be deleted when the deployment is executed."""
+ IGNORE = "Ignore"
+ """The resource exists in the current state and is missing from the desired state. The resource
+ will not be deployed or modified when the deployment is executed."""
+ DEPLOY = "Deploy"
+ """The resource exists in the current state and the desired state and will be redeployed when the
+ deployment is executed. The properties of the resource may or may not change."""
+ NO_CHANGE = "NoChange"
+ """The resource exists in the current state and the desired state and will be redeployed when the
+ deployment is executed. The properties of the resource will not change."""
+ MODIFY = "Modify"
+ """The resource exists in the current state and the desired state and will be redeployed when the
+ deployment is executed. The properties of the resource will change."""
+ UNSUPPORTED = "Unsupported"
+ """The resource is not supported by What-If."""
+
+
+class DeploymentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The mode that is used to deploy resources. This value can be either Incremental or Complete. In
+ Incremental mode, resources are deployed without deleting existing resources that are not
+ included in the template. In Complete mode, resources are deployed and existing resources in
+ the resource group that are not included in the template are deleted. Be careful when using
+ Complete mode as you may unintentionally delete resources.
+ """
+
+ INCREMENTAL = "Incremental"
+ COMPLETE = "Complete"
+
+
+class ExportTemplateOutputFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The output format for the exported resources."""
+
+ JSON = "Json"
+ BICEP = "Bicep"
+
+
+class ExpressionEvaluationOptionsScopeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The scope to be used for evaluation of parameters, variables and functions in a nested
+ template.
+ """
+
+ NOT_SPECIFIED = "NotSpecified"
+ OUTER = "Outer"
+ INNER = "Inner"
+
+
+class ExtendedLocationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The extended location type."""
+
+ EDGE_ZONE = "EdgeZone"
+
+
+class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Denotes the additional response level."""
+
+ WARNING = "Warning"
+ INFO = "Info"
+ ERROR = "Error"
+
+
+class OnErrorDeploymentType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The deployment on error behavior type. Possible values are LastSuccessful and
+ SpecificDeployment.
+ """
+
+ LAST_SUCCESSFUL = "LastSuccessful"
+ SPECIFIC_DEPLOYMENT = "SpecificDeployment"
+
+
+class PropertyChangeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of property change."""
+
+ CREATE = "Create"
+ """The property does not exist in the current state but is present in the desired state. The
+ property will be created when the deployment is executed."""
+ DELETE = "Delete"
+ """The property exists in the current state and is missing from the desired state. It will be
+ deleted when the deployment is executed."""
+ MODIFY = "Modify"
+ """The property exists in both current and desired state and is different. The value of the
+ property will change when the deployment is executed."""
+ ARRAY = "Array"
+ """The property is an array and contains nested changes."""
+ NO_EFFECT = "NoEffect"
+ """The property will not be set or updated."""
+
+
+class ProviderAuthorizationConsentState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The provider authorization consent state."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ REQUIRED = "Required"
+ NOT_REQUIRED = "NotRequired"
+ CONSENTED = "Consented"
+
+
+class ProvisioningOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The name of the current provisioning operation."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ """The provisioning operation is not specified."""
+ CREATE = "Create"
+ """The provisioning operation is create."""
+ DELETE = "Delete"
+ """The provisioning operation is delete."""
+ WAITING = "Waiting"
+ """The provisioning operation is waiting."""
+ AZURE_ASYNC_OPERATION_WAITING = "AzureAsyncOperationWaiting"
+ """The provisioning operation is waiting Azure async operation."""
+ RESOURCE_CACHE_WAITING = "ResourceCacheWaiting"
+ """The provisioning operation is waiting for resource cache."""
+ ACTION = "Action"
+ """The provisioning operation is action."""
+ READ = "Read"
+ """The provisioning operation is read."""
+ EVALUATE_DEPLOYMENT_OUTPUT = "EvaluateDeploymentOutput"
+ """The provisioning operation is evaluate output."""
+ DEPLOYMENT_CLEANUP = "DeploymentCleanup"
+ """The provisioning operation is cleanup. This operation is part of the 'complete' mode
+ deployment."""
+
+
+class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Denotes the state of provisioning."""
+
+ NOT_SPECIFIED = "NotSpecified"
+ ACCEPTED = "Accepted"
+ RUNNING = "Running"
+ READY = "Ready"
+ CREATING = "Creating"
+ CREATED = "Created"
+ DELETING = "Deleting"
+ DELETED = "Deleted"
+ CANCELED = "Canceled"
+ FAILED = "Failed"
+ SUCCEEDED = "Succeeded"
+ UPDATING = "Updating"
+
+
+class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The identity type."""
+
+ SYSTEM_ASSIGNED = "SystemAssigned"
+ USER_ASSIGNED = "UserAssigned"
+ SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned"
+ NONE = "None"
+
+
+class TagsPatchOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The operation type for the patch API."""
+
+ REPLACE = "Replace"
+ """The 'replace' option replaces the entire set of existing tags with a new set."""
+ MERGE = "Merge"
+ """The 'merge' option allows adding tags with new names and updating the values of tags with
+ existing names."""
+ DELETE = "Delete"
+ """The 'delete' option allows selectively deleting tags based on given names or name/value pairs."""
+
+
+class WhatIfResultFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The format of the What-If results."""
+
+ RESOURCE_ID_ONLY = "ResourceIdOnly"
+ FULL_RESOURCE_PAYLOADS = "FullResourcePayloads"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/__init__.py
new file mode 100644
index 000000000000..fc92299ca9cb
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/__init__.py
@@ -0,0 +1,39 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
+
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import DeploymentsOperations # type: ignore
+from ._operations import ProvidersOperations # type: ignore
+from ._operations import ProviderResourceTypesOperations # type: ignore
+from ._operations import ResourcesOperations # type: ignore
+from ._operations import ResourceGroupsOperations # type: ignore
+from ._operations import TagsOperations # type: ignore
+from ._operations import DeploymentOperationsOperations # type: ignore
+
+from ._patch import __all__ as _patch_all
+from ._patch import *
+from ._patch import patch_sdk as _patch_sdk
+
+__all__ = [
+ "Operations",
+ "DeploymentsOperations",
+ "ProvidersOperations",
+ "ProviderResourceTypesOperations",
+ "ResourcesOperations",
+ "ResourceGroupsOperations",
+ "TagsOperations",
+ "DeploymentOperationsOperations",
+]
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
+_patch_sdk()
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_operations.py
new file mode 100644
index 000000000000..940e8e826185
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_operations.py
@@ -0,0 +1,12803 @@
+# pylint: disable=too-many-lines
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+from io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models as _models
+from ..._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_operations_list_request(**kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/operations")
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_delete_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_check_existence_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_create_or_update_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_cancel_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_validate_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_export_template_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ )
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_list_at_scope_request(
+ scope: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_delete_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_check_existence_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_create_or_update_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_get_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_cancel_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_validate_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_what_if_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_export_template_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_list_at_tenant_scope_request( # pylint: disable=name-too-long
+ *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/")
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_delete_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_check_existence_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_create_or_update_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_get_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_cancel_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_validate_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_what_if_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_export_template_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_list_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_delete_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_check_existence_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_create_or_update_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_get_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_cancel_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_validate_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_what_if_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_export_template_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_list_at_subscription_scope_request( # pylint: disable=name-too-long
+ subscription_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_delete_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_check_existence_request( # pylint: disable=name-too-long
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_create_or_update_request( # pylint: disable=name-too-long
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_get_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_cancel_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_validate_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_what_if_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_export_template_request( # pylint: disable=name-too-long
+ resource_group_name: str, deployment_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_list_by_resource_group_request( # pylint: disable=name-too-long
+ resource_group_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployments_calculate_template_hash_request( # pylint: disable=name-too-long
+ *, json: JSON, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/calculateTemplateHash")
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, json=json, **kwargs)
+
+
+def build_providers_unregister_request(
+ resource_provider_namespace: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"
+ )
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_register_at_management_group_scope_request( # pylint: disable=name-too-long
+ resource_provider_namespace: str, group_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_provider_permissions_request( # pylint: disable=name-too-long
+ resource_provider_namespace: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_register_request(
+ resource_provider_namespace: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register")
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_list_request(subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_list_at_tenant_scope_request( # pylint: disable=name-too-long
+ *, expand: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers")
+
+ # Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_get_request(
+ resource_provider_namespace: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}")
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_providers_get_at_tenant_scope_request( # pylint: disable=name-too-long
+ resource_provider_namespace: str, *, expand: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/{resourceProviderNamespace}")
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_provider_resource_types_list_request( # pylint: disable=name-too-long
+ resource_provider_namespace: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes"
+ )
+ path_format_arguments = {
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_list_by_resource_group_request( # pylint: disable=name-too-long
+ resource_group_name: str,
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_move_resources_request(
+ source_resource_group_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "sourceResourceGroupName": _SERIALIZER.url(
+ "source_resource_group_name",
+ source_resource_group_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[-\w\._\(\)]+$",
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_validate_move_resources_request( # pylint: disable=name-too-long
+ source_resource_group_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "sourceResourceGroupName": _SERIALIZER.url(
+ "source_resource_group_name",
+ source_resource_group_name,
+ "str",
+ max_length=90,
+ min_length=1,
+ pattern=r"^[-\w\._\(\)]+$",
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_list_request(
+ subscription_id: str,
+ *,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resources")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if expand is not None:
+ _params["$expand"] = _SERIALIZER.query("expand", expand, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_check_existence_request(
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ subscription_id: str,
+ *,
+ api_version: str,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "parentResourcePath": _SERIALIZER.url("parent_resource_path", parent_resource_path, "str", skip_quote=True),
+ "resourceType": _SERIALIZER.url("resource_type", resource_type, "str", skip_quote=True),
+ "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_delete_request(
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ subscription_id: str,
+ *,
+ api_version: str,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "parentResourcePath": _SERIALIZER.url("parent_resource_path", parent_resource_path, "str", skip_quote=True),
+ "resourceType": _SERIALIZER.url("resource_type", resource_type, "str", skip_quote=True),
+ "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_create_or_update_request(
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ subscription_id: str,
+ *,
+ api_version: str,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "parentResourcePath": _SERIALIZER.url("parent_resource_path", parent_resource_path, "str", skip_quote=True),
+ "resourceType": _SERIALIZER.url("resource_type", resource_type, "str", skip_quote=True),
+ "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_update_request(
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ subscription_id: str,
+ *,
+ api_version: str,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "parentResourcePath": _SERIALIZER.url("parent_resource_path", parent_resource_path, "str", skip_quote=True),
+ "resourceType": _SERIALIZER.url("resource_type", resource_type, "str", skip_quote=True),
+ "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_get_request(
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ subscription_id: str,
+ *,
+ api_version: str,
+ **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"),
+ "parentResourcePath": _SERIALIZER.url("parent_resource_path", parent_resource_path, "str", skip_quote=True),
+ "resourceType": _SERIALIZER.url("resource_type", resource_type, "str", skip_quote=True),
+ "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_check_existence_by_id_request( # pylint: disable=name-too-long
+ resource_id: str, *, api_version: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{resourceId}")
+ path_format_arguments = {
+ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{resourceId}")
+ path_format_arguments = {
+ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_create_or_update_by_id_request( # pylint: disable=name-too-long
+ resource_id: str, *, api_version: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{resourceId}")
+ path_format_arguments = {
+ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_update_by_id_request(resource_id: str, *, api_version: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{resourceId}")
+ path_format_arguments = {
+ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{resourceId}")
+ path_format_arguments = {
+ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_check_existence_request( # pylint: disable=name-too-long
+ resource_group_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_create_or_update_request( # pylint: disable=name-too-long
+ resource_group_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_delete_request(
+ resource_group_name: str, subscription_id: str, *, force_deletion_types: Optional[str] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if force_deletion_types is not None:
+ _params["forceDeletionTypes"] = _SERIALIZER.query("force_deletion_types", force_deletion_types, "str")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_get_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_update_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}")
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_export_template_request( # pylint: disable=name-too-long
+ resource_group_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate"
+ )
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_resource_groups_list_request(
+ subscription_id: str, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourcegroups")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if filter is not None:
+ _params["$filter"] = _SERIALIZER.query("filter", filter, "str")
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}")
+ path_format_arguments = {
+ "tagName": _SERIALIZER.url("tag_name", tag_name, "str"),
+ "tagValue": _SERIALIZER.url("tag_value", tag_value, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_create_or_update_value_request( # pylint: disable=name-too-long
+ tag_name: str, tag_value: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}")
+ path_format_arguments = {
+ "tagName": _SERIALIZER.url("tag_name", tag_name, "str"),
+ "tagValue": _SERIALIZER.url("tag_value", tag_value, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/tagNames/{tagName}")
+ path_format_arguments = {
+ "tagName": _SERIALIZER.url("tag_name", tag_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/tagNames/{tagName}")
+ path_format_arguments = {
+ "tagName": _SERIALIZER.url("tag_name", tag_name, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/tagNames")
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_create_or_update_at_scope_request( # pylint: disable=name-too-long
+ scope: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/tags/default")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/tags/default")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/tags/default")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/tags/default")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_get_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, operation_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_list_at_scope_request( # pylint: disable=name-too-long
+ scope: str, deployment_name: str, *, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations")
+ path_format_arguments = {
+ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_get_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, operation_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ )
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_list_at_tenant_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, *, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop("template_url", "/providers/Microsoft.Resources/deployments/{deploymentName}/operations")
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_get_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, operation_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_list_at_management_group_scope_request( # pylint: disable=name-too-long
+ group_id: str, deployment_name: str, *, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_get_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, operation_id: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_list_at_subscription_scope_request( # pylint: disable=name-too-long
+ deployment_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_get_request(
+ resource_group_name: str, deployment_name: str, operation_id: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "operationId": _SERIALIZER.url("operation_id", operation_id, "str"),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_deployment_operations_list_request(
+ resource_group_name: str, deployment_name: str, subscription_id: str, *, top: Optional[int] = None, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-07-01"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "deploymentName": _SERIALIZER.url(
+ "deployment_name", deployment_name, "str", max_length=64, min_length=1, pattern=r"^[-\w\._\(\)]+$"
+ ),
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ if top is not None:
+ _params["$top"] = _SERIALIZER.query("top", top, "int")
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class Operations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`operations` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
+ """Lists all of the available Microsoft.Resources REST API operations.
+
+ :return: An iterator like instance of either Operation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Operation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_operations_list_request(
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("OperationListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+
+class DeploymentsOperations: # pylint: disable=too-many-public-methods
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`deployments` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ def _delete_at_scope_initial(self, scope: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _create_or_update_at_scope_initial(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_at_scope(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at a given scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def cancel_at_scope( # pylint: disable=inconsistent-return-statements
+ self, scope: str, deployment_name: str, **kwargs: Any
+ ) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _validate_at_scope_initial(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate_at_scope(
+ self,
+ scope: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate_at_scope(
+ self, scope: str, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_at_scope_initial(
+ scope=scope,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def export_template_at_scope(
+ self, scope: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_scope(
+ self, scope: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentExtended"]:
+ """Get all the deployments at the given scope.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_scope_request(
+ scope=scope,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _delete_at_tenant_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _create_or_update_at_tenant_scope_initial( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_create_or_update_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at tenant scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a
+ ScopedDeployment type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements
+ self, deployment_name: str, **kwargs: Any
+ ) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _validate_at_tenant_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_validate_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeployment type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _what_if_at_tenant_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_what_if_at_tenant_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.ScopedDeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_what_if_at_tenant_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_what_if_at_tenant_scope(
+ self, deployment_name: str, parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the tenant
+ group.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeploymentWhatIf type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._what_if_at_tenant_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_tenant_scope(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentExtended"]:
+ """Get all the deployments at the tenant scope.
+
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_tenant_scope_request(
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _delete_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_at_management_group_scope(
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> LROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def check_existence_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> bool:
+ """Checks whether the deployment exists.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _create_or_update_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_create_or_update_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at management group scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a
+ ScopedDeployment type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_at_management_group_scope(
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _validate_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeployment")
+
+ _request = build_deployments_validate_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate_at_management_group_scope(
+ self, group_id: str, deployment_name: str, parameters: Union[_models.ScopedDeployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeployment type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeployment or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _what_if_at_management_group_scope_initial( # pylint: disable=name-too-long
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ScopedDeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: _models.ScopedDeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_what_if_at_management_group_scope(
+ self,
+ group_id: str,
+ deployment_name: str,
+ parameters: Union[_models.ScopedDeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the management
+ group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a ScopedDeploymentWhatIf type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ScopedDeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._what_if_at_management_group_scope_initial(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def export_template_at_management_group_scope( # pylint: disable=name-too-long
+ self, group_id: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_management_group_scope(
+ self, group_id: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a management group.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_management_group_scope_request(
+ group_id=group_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _delete_at_subscription_scope_initial(self, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. This is an asynchronous operation that
+ returns a status of 202 until the template deployment is successfully deleted. The Location
+ response header contains the URI that is used to obtain the status of the process. While the
+ process is running, a call to the URI in the Location header returns a status of 202. When the
+ process finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _create_or_update_at_subscription_scope_initial( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_at_subscription_scope( # pylint: disable=name-too-long
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources at subscription scope.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-statements
+ self, deployment_name: str, **kwargs: Any
+ ) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resources partially
+ deployed.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _validate_at_subscription_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate_at_subscription_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate_at_subscription_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate_at_subscription_scope(
+ self, deployment_name: str, parameters: Union[_models.Deployment, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _what_if_at_subscription_scope_initial(
+ self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "DeploymentWhatIf")
+
+ _request = build_deployments_what_if_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_what_if_at_subscription_scope(
+ self,
+ deployment_name: str,
+ parameters: _models.DeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_what_if_at_subscription_scope(
+ self, deployment_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_what_if_at_subscription_scope(
+ self, deployment_name: str, parameters: Union[_models.DeploymentWhatIf, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the
+ subscription.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to What If. Is either a DeploymentWhatIf type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._what_if_at_subscription_scope_initial(
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def export_template_at_subscription_scope(
+ self, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_subscription_scope(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a subscription.
+
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_at_subscription_scope_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _delete_initial(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_deployments_delete_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> LROPoller[None]:
+ """Deletes a deployment from the deployment history.
+
+ A template deployment that is currently running cannot be deleted. Deleting a template
+ deployment removes the associated deployment operations. Deleting a template deployment does
+ not affect the state of the resource group. This is an asynchronous operation that returns a
+ status of 202 until the template deployment is successfully deleted. The Location response
+ header contains the URI that is used to obtain the status of the process. While the process is
+ running, a call to the URI in the Location header returns a status of 202. When the process
+ finishes, the URI in the Location header returns a status of 204 on success. If the
+ asynchronous request failed, the URI in the Location header returns an error-level status code.
+
+ :param resource_group_name: The name of the resource group with the deployment to delete. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def check_existence(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> bool:
+ """Checks whether the deployment exists.
+
+ :param resource_group_name: The name of the resource group with the deployment to check. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_check_existence_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_create_or_update_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Deploys resources to a resource group.
+
+ You can provide the template and parameters directly in the request or link to JSON files.
+
+ :param resource_group_name: The name of the resource group to deploy the resources to. The name
+ is case insensitive. The resource group must already exist. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Additional parameters supplied to the operation. Is either a Deployment type
+ or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _models.DeploymentExtended:
+ """Gets a deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExtended or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+
+ _request = build_deployments_get_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def cancel( # pylint: disable=inconsistent-return-statements
+ self, resource_group_name: str, deployment_name: str, **kwargs: Any
+ ) -> None:
+ """Cancels a currently running template deployment.
+
+ You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+ deployment is canceled, the provisioningState is set to Canceled. Canceling a template
+ deployment stops the currently running template deployment and leaves the resource group
+ partially deployed.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_deployments_cancel_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ def _validate_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "Deployment")
+
+ _request = build_deployments_validate_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 400]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.Deployment,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.Deployment, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.DeploymentExtended]:
+ """Validates whether the specified template is syntactically correct and will be accepted by Azure
+ Resource Manager..
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a Deployment type or a IO[bytes] type.
+ Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.Deployment or IO[bytes]
+ :return: An instance of LROPoller that returns either DeploymentExtended or An instance of
+ LROPoller that returns either DeploymentValidationError or the result of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ or
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentValidationError]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("DeploymentExtended", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.DeploymentExtended].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.DeploymentExtended](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _what_if_initial(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "DeploymentWhatIf")
+
+ _request = build_deployments_what_if_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: _models.DeploymentWhatIf,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_what_if(
+ self,
+ resource_group_name: str,
+ deployment_name: str,
+ parameters: Union[_models.DeploymentWhatIf, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.WhatIfOperationResult]:
+ """Returns changes that will be made by the deployment if executed at the scope of the resource
+ group.
+
+ :param resource_group_name: The name of the resource group the template will be deployed to.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param parameters: Parameters to validate. Is either a DeploymentWhatIf type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentWhatIf or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either WhatIfOperationResult or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.WhatIfOperationResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._what_if_initial(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("WhatIfOperationResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.WhatIfOperationResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.WhatIfOperationResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def export_template(
+ self, resource_group_name: str, deployment_name: str, **kwargs: Any
+ ) -> _models.DeploymentExportResult:
+ """Exports the template used for specified deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :return: DeploymentExportResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExportResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None)
+
+ _request = build_deployments_export_template_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentExportResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_resource_group(
+ self, resource_group_name: str, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentExtended"]:
+ """Get all the deployments for a resource group.
+
+ :param resource_group_name: The name of the resource group with the deployments to get. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param filter: The filter to apply on the operation. For example, you can use
+ $filter=provisioningState eq '{state}'. Default value is None.
+ :type filter: str
+ :param top: The number of results to get. If null is passed, returns all deployments. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentExtended or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentExtended]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployments_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.TemplateHashResult:
+ """Calculate the hash of the given template.
+
+ :param template: The template provided to calculate hash. Required.
+ :type template: JSON
+ :return: TemplateHashResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TemplateHashResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
+ cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None)
+
+ _json = self._serialize.body(template, "object")
+
+ _request = build_deployments_calculate_template_hash_request(
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TemplateHashResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ProvidersOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`providers` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider:
+ """Unregisters a subscription from a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to unregister.
+ Required.
+ :type resource_provider_namespace: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_unregister_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def register_at_management_group_scope( # pylint: disable=inconsistent-return-statements
+ self, resource_provider_namespace: str, group_id: str, **kwargs: Any
+ ) -> None:
+ """Registers a management group with a resource provider. Use this operation to register a
+ resource provider with resource types that can be deployed at the management group scope. It
+ does not recursively register subscriptions within the management group. Instead, you must
+ register subscriptions individually.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_providers_register_at_management_group_scope_request(
+ resource_provider_namespace=resource_provider_namespace,
+ group_id=group_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace
+ def provider_permissions(
+ self, resource_provider_namespace: str, **kwargs: Any
+ ) -> _models.ProviderPermissionListResult:
+ """Get the provider permissions.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :return: ProviderPermissionListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderPermissionListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None)
+
+ _request = build_providers_provider_permissions_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ProviderPermissionListResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[_models.ProviderRegistrationRequest] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Default value is None.
+ :type properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderRegistrationRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Default value is None.
+ :type properties: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def register(
+ self,
+ resource_provider_namespace: str,
+ properties: Optional[Union[_models.ProviderRegistrationRequest, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.Provider:
+ """Registers a subscription with a resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider to register.
+ Required.
+ :type resource_provider_namespace: str
+ :param properties: The third party consent for S2S. Is either a ProviderRegistrationRequest
+ type or a IO[bytes] type. Default value is None.
+ :type properties: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderRegistrationRequest
+ or IO[bytes]
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(properties, (IOBase, bytes)):
+ _content = properties
+ else:
+ if properties is not None:
+ _json = self._serialize.body(properties, "ProviderRegistrationRequest")
+ else:
+ _json = None
+
+ _request = build_providers_register_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Provider"]:
+ """Gets all resource providers for a subscription.
+
+ :param expand: The properties to include in the results. For example, use &$expand=metadata in
+ the query string to retrieve resource provider metadata. To include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: An iterator like instance of either Provider or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_providers_list_request(
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProviderListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Provider"]:
+ """Gets all resource providers for the tenant.
+
+ :param expand: The properties to include in the results. For example, use &$expand=metadata in
+ the query string to retrieve resource provider metadata. To include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: An iterator like instance of either Provider or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.Provider]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_providers_list_at_tenant_scope_request(
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ProviderListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any) -> _models.Provider:
+ """Gets the specified resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_get_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def get_at_tenant_scope(
+ self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.Provider:
+ """Gets the specified resource provider at the tenant level.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: Provider or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.Provider
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.Provider] = kwargs.pop("cls", None)
+
+ _request = build_providers_get_at_tenant_scope_request(
+ resource_provider_namespace=resource_provider_namespace,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("Provider", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ProviderResourceTypesOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`provider_resource_types` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def list(
+ self, resource_provider_namespace: str, expand: Optional[str] = None, **kwargs: Any
+ ) -> _models.ProviderResourceTypeListResult:
+ """List the resource types for a specified resource provider.
+
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param expand: The $expand query parameter. For example, to include property aliases in
+ response, use $expand=resourceTypes/aliases. Default value is None.
+ :type expand: str
+ :return: ProviderResourceTypeListResult or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ProviderResourceTypeListResult
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None)
+
+ _request = build_provider_resource_types_list_request(
+ resource_provider_namespace=resource_provider_namespace,
+ subscription_id=self._config.subscription_id,
+ expand=expand,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ProviderResourceTypeListResult", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ResourcesOperations: # pylint: disable=too-many-public-methods
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`resources` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def list_by_resource_group(
+ self,
+ resource_group_name: str,
+ filter: Optional[str] = None,
+ expand: Optional[str] = None,
+ top: Optional[int] = None,
+ **kwargs: Any
+ ) -> Iterable["_models.GenericResourceExpanded"]:
+ """Get all the resources for a resource group.
+
+ :param resource_group_name: The resource group with the resources to get. Required.
+ :type resource_group_name: str
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`The properties you
+ can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup,
+ identity, identity/principalId, plan, plan/publisher, plan/product, plan/name, plan/version,
+ and plan/promotionCode.:code:`
`:code:`
`For example, to filter by a resource type, use:
+ $filter=resourceType eq 'Microsoft.Network/virtualNetworks':code:`
`:code:`
`You can use
+ substringof(value, property) in the filter. The properties you can use for substring are: name
+ and resourceGroup.:code:`
`:code:`
`For example, to get all resources with 'demo'
+ anywhere in the name, use: $filter=substringof('demo', name):code:`
`:code:`
`You can
+ link more than one substringof together by adding and/or operators.:code:`
`:code:`
`You
+ can filter by tag names and values. For example, to filter for a tag name and value, use
+ $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value,
+ the tags for each resource are not returned in the results.:code:`
`:code:`
`You can use
+ some properties together when filtering. The combinations you can use are: substringof and/or
+ resourceType, plan and plan/publisher and plan/name, identity and identity/principalId. Default
+ value is None.
+ :type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For
+ example, ``$expand=createdTime,changedTime``. Default value is None.
+ :type expand: str
+ :param top: The number of results to return. If null is passed, returns all resources. Default
+ value is None.
+ :type top: int
+ :return: An iterator like instance of either GenericResourceExpanded or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resources_list_by_resource_group_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ expand=expand,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _move_resources_initial(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourcesMoveInfo")
+
+ _request = build_resources_move_resources_request(
+ source_resource_group_name=source_resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: _models.ResourcesMoveInfo,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_move_resources(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[None]:
+ """Moves resources from one resource group to another resource group.
+
+ The resources to be moved must be in the same source resource group in the source subscription
+ being used. The target resource group may be in a different subscription. When moving
+ resources, both the source group and the target group are locked for the duration of the
+ operation. Write and delete operations are blocked on the groups until the move completes.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be moved. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Is either a ResourcesMoveInfo type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._move_resources_initial(
+ source_resource_group_name=source_resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ def _validate_move_resources_initial(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourcesMoveInfo")
+
+ _request = build_resources_validate_move_resources_request(
+ source_resource_group_name=source_resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_validate_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: _models.ResourcesMoveInfo,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_validate_move_resources(
+ self,
+ source_resource_group_name: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_validate_move_resources(
+ self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[None]:
+ """Validates whether resources can be moved from one resource group to another resource group.
+
+ This operation checks whether the specified resources can be moved to the target. The resources
+ to be moved must be in the same source resource group in the source subscription being used.
+ The target resource group may be in a different subscription. If validation succeeds, it
+ returns HTTP response code 204 (no content). If validation fails, it returns HTTP response code
+ 409 (Conflict) with an error message. Retrieve the URL in the Location header value to check
+ the result of the long-running operation.
+
+ :param source_resource_group_name: The name of the resource group from the source subscription
+ containing the resources to be validated for move. Required.
+ :type source_resource_group_name: str
+ :param parameters: Parameters for moving resources. Is either a ResourcesMoveInfo type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourcesMoveInfo or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._validate_move_resources_initial(
+ source_resource_group_name=source_resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def list(
+ self, filter: Optional[str] = None, expand: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.GenericResourceExpanded"]:
+ """Get all the resources in a subscription.
+
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`Filter comparison
+ operators include ``eq`` (equals) and ``ne`` (not equals) and may be used with the following
+ properties: ``location``\\ , ``resourceType``\\ , ``name``\\ , ``resourceGroup``\\ ,
+ ``identity``\\ , ``identity/principalId``\\ , ``plan``\\ , ``plan/publisher``\\ ,
+ ``plan/product``\\ , ``plan/name``\\ , ``plan/version``\\ , and
+ ``plan/promotionCode``.:code:`
`:code:`
`For example, to filter by a resource type, use
+ ``$filter=resourceType eq 'Microsoft.Network/virtualNetworks'``\\
+ :code:`
`:code:`
`:code:`
`\\ ``substringof(value, property)`` can be used to filter
+ for substrings of the following currently-supported properties: ``name`` and
+ ``resourceGroup``\\ :code:`
`:code:`
`For example, to get all resources with 'demo'
+ anywhere in the resource name, use ``$filter=substringof('demo', name)``\\
+ :code:`
`:code:`
`Multiple substring operations can also be combined using ``and``\\ /\\
+ ``or`` operators.:code:`
`:code:`
`Note that any truncated number of results queried via
+ ``$top`` may also not be compatible when using a
+ filter.:code:`
`:code:`
`:code:`
`Resources can be filtered by tag names and values.
+ For example, to filter for a tag name and value, use ``$filter=tagName eq 'tag1' and tagValue
+ eq 'Value1'``. Note that when resources are filtered by tag name and value, :code:`the
+ original tags for each resource will not be returned in the results.` Any list of
+ additional properties queried via ``$expand`` may also not be compatible when filtering by tag
+ names/values. :code:`
`:code:`
`For tag names only, resources can be filtered by prefix
+ using the following syntax: ``$filter=startswith(tagName, 'depart')``. This query will return
+ all resources with a tag name prefixed by the phrase ``depart`` (i.e.\\ ``department``\\ ,
+ ``departureDate``\\ , ``departureTime``\\ , etc.):code:`
`:code:`
`:code:`
`Note that
+ some properties can be combined when filtering resources, which include the following:
+ ``substringof() and/or resourceType``\\ , ``plan and plan/publisher and plan/name``\\ , and
+ ``identity and identity/principalId``. Default value is None.
+ :type filter: str
+ :param expand: Comma-separated list of additional properties to be included in the response.
+ Valid values include ``createdTime``\\ , ``changedTime`` and ``provisioningState``. For
+ example, ``$expand=createdTime,changedTime``. Default value is None.
+ :type expand: str
+ :param top: The number of recommendations per page if a paged version of this API is being
+ used. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either GenericResourceExpanded or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResourceExpanded]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resources_list_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ expand=expand,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def check_existence(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> bool:
+ """Checks whether a resource exists.
+
+ :param resource_group_name: The name of the resource group containing the resource to check.
+ The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The resource provider of the resource to check. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to check whether it exists. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resources_check_existence_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _delete_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resources_delete_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Deletes a resource.
+
+ :param resource_group_name: The name of the resource group that contains the resource to
+ delete. The name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to delete. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_create_or_update_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Creates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to create. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to create. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for creating or updating the resource. Is either a
+ GenericResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _update_initial(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_update_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_update(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ parameters: Union[_models.GenericResource, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ """Updates a resource.
+
+ :param resource_group_name: The name of the resource group for the resource. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource to update. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to update. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Parameters for updating the resource. Is either a GenericResource type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._update_initial(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get(
+ self,
+ resource_group_name: str,
+ resource_provider_namespace: str,
+ parent_resource_path: str,
+ resource_type: str,
+ resource_name: str,
+ api_version: str,
+ **kwargs: Any
+ ) -> _models.GenericResource:
+ """Gets a resource.
+
+ :param resource_group_name: The name of the resource group containing the resource to get. The
+ name is case insensitive. Required.
+ :type resource_group_name: str
+ :param resource_provider_namespace: The namespace of the resource provider. Required.
+ :type resource_provider_namespace: str
+ :param parent_resource_path: The parent resource identity. Required.
+ :type parent_resource_path: str
+ :param resource_type: The resource type of the resource. Required.
+ :type resource_type: str
+ :param resource_name: The name of the resource to get. Required.
+ :type resource_name: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: GenericResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+
+ _request = build_resources_get_request(
+ resource_group_name=resource_group_name,
+ resource_provider_namespace=resource_provider_namespace,
+ parent_resource_path=parent_resource_path,
+ resource_type=resource_type,
+ resource_name=resource_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def check_existence_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> bool:
+ # pylint: disable=line-too-long
+ """Checks by ID whether a resource exists. This API currently works only for a limited set of
+ Resource providers. In the event that a Resource provider does not implement this API, ARM will
+ respond with a 405. The alternative then is to use the GET API to check for the existence of
+ the resource.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resources_check_existence_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ def _delete_by_id_initial(self, resource_id: str, api_version: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resources_delete_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202, 204]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> LROPoller[None]:
+ # pylint: disable=line-too-long
+ """Deletes a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ def _create_or_update_by_id_initial(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_create_or_update_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_by_id(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Create a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Create or update resource parameters. Is either a GenericResource type or a
+ IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _update_by_id_initial(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "GenericResource")
+
+ _request = build_resources_update_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: _models.GenericResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_update_by_id(
+ self,
+ resource_id: str,
+ api_version: str,
+ parameters: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_update_by_id(
+ self, resource_id: str, api_version: str, parameters: Union[_models.GenericResource, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.GenericResource]:
+ # pylint: disable=line-too-long
+ """Updates a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :param parameters: Update resource parameters. Is either a GenericResource type or a IO[bytes]
+ type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either GenericResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = kwargs.pop("params", {}) or {}
+
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._update_by_id_initial(
+ resource_id=resource_id,
+ api_version=api_version,
+ parameters=parameters,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.GenericResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.GenericResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_by_id(self, resource_id: str, api_version: str, **kwargs: Any) -> _models.GenericResource:
+ # pylint: disable=line-too-long
+ """Gets a resource by ID.
+
+ :param resource_id: The fully qualified ID of the resource, including the resource name and
+ resource type. Use the format,
+ /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}.
+ Required.
+ :type resource_id: str
+ :param api_version: The API version to use for the operation. Required.
+ :type api_version: str
+ :return: GenericResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.GenericResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = kwargs.pop("params", {}) or {}
+
+ cls: ClsType[_models.GenericResource] = kwargs.pop("cls", None)
+
+ _request = build_resources_get_by_id_request(
+ resource_id=resource_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("GenericResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+
+class ResourceGroupsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`resource_groups` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool:
+ """Checks whether a resource group exists.
+
+ :param resource_group_name: The name of the resource group to check. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :return: bool or the result of cls(response)
+ :rtype: bool
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_check_existence_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204, 404]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+ return 200 <= response.status_code <= 299
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ parameters: _models.ResourceGroup,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def create_or_update(
+ self, resource_group_name: str, parameters: Union[_models.ResourceGroup, IO[bytes]], **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Creates or updates a resource group.
+
+ :param resource_group_name: The name of the resource group to create or update. Can include
+ alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters
+ that match the allowed characters. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to the create or update a resource group. Is either a
+ ResourceGroup type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup or IO[bytes]
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourceGroup")
+
+ _request = build_resource_groups_create_or_update_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ def _delete_initial(
+ self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_delete_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ force_deletion_types=force_deletion_types,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["location"] = self._deserialize("str", response.headers.get("location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete(
+ self, resource_group_name: str, force_deletion_types: Optional[str] = None, **kwargs: Any
+ ) -> LROPoller[None]:
+ """Deletes a resource group.
+
+ When you delete a resource group, all of its resources are also deleted. Deleting a resource
+ group deletes all of its template deployments and currently stored operations.
+
+ :param resource_group_name: The name of the resource group to delete. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param force_deletion_types: The resource types you want to force delete. Currently, only the
+ following is supported:
+ forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets.
+ Default value is None.
+ :type force_deletion_types: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_initial(
+ resource_group_name=resource_group_name,
+ force_deletion_types=force_deletion_types,
+ api_version=api_version,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+ @distributed_trace
+ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup:
+ """Gets a resource group.
+
+ :param resource_group_name: The name of the resource group to get. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ _request = build_resource_groups_get_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def update(
+ self,
+ resource_group_name: str,
+ parameters: _models.ResourceGroupPatchable,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupPatchable
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def update(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def update(
+ self, resource_group_name: str, parameters: Union[_models.ResourceGroupPatchable, IO[bytes]], **kwargs: Any
+ ) -> _models.ResourceGroup:
+ """Updates a resource group.
+
+ Resource groups can be updated through a simple PATCH operation to a group address. The format
+ of the request is the same as that for creating a resource group. If a field is unspecified,
+ the current value is retained.
+
+ :param resource_group_name: The name of the resource group to update. The name is case
+ insensitive. Required.
+ :type resource_group_name: str
+ :param parameters: Parameters supplied to update a resource group. Is either a
+ ResourceGroupPatchable type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupPatchable or
+ IO[bytes]
+ :return: ResourceGroup or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ResourceGroupPatchable")
+
+ _request = build_resource_groups_update_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ResourceGroup", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ def _export_template_initial(
+ self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "ExportTemplateRequest")
+
+ _request = build_resource_groups_export_template_request(
+ resource_group_name=resource_group_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_export_template(
+ self,
+ resource_group_name: str,
+ parameters: _models.ExportTemplateRequest,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateRequest
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either ResourceGroupExportResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_export_template(
+ self, resource_group_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either ResourceGroupExportResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_export_template(
+ self, resource_group_name: str, parameters: Union[_models.ExportTemplateRequest, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.ResourceGroupExportResult]:
+ """Captures the specified resource group as a template.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param parameters: Parameters for exporting the template. Is either a ExportTemplateRequest
+ type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.ExportTemplateRequest or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either ResourceGroupExportResult or the result
+ of cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroupExportResult]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._export_template_initial(
+ resource_group_name=resource_group_name,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("ResourceGroupExportResult", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.ResourceGroupExportResult].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.ResourceGroupExportResult](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def list(
+ self, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.ResourceGroup"]:
+ """Gets all the resource groups for a subscription.
+
+ :param filter: The filter to apply on the operation.:code:`
`:code:`
`You can filter by
+ tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq
+ 'tag1' and tagValue eq 'Value1'. Default value is None.
+ :type filter: str
+ :param top: The number of results to return. If null is passed, returns all resource groups.
+ Default value is None.
+ :type top: int
+ :return: An iterator like instance of either ResourceGroup or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.ResourceGroup]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_resource_groups_list_request(
+ subscription_id=self._config.subscription_id,
+ filter=filter,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ResourceGroupListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+
+class TagsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`tags` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def delete_value( # pylint: disable=inconsistent-return-statements
+ self, tag_name: str, tag_value: str, **kwargs: Any
+ ) -> None:
+ """Deletes a predefined tag value for a predefined tag name.
+
+ This operation allows deleting a value from the list of predefined values for an existing
+ predefined tag name. The value being deleted must not be in use as a tag value for the given
+ tag name for any resource.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :param tag_value: The value of the tag to delete. Required.
+ :type tag_value: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_value_request(
+ tag_name=tag_name,
+ tag_value=tag_value,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace
+ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) -> _models.TagValue:
+ """Creates a predefined value for a predefined tag name.
+
+ This operation allows adding a value to the list of predefined values for an existing
+ predefined tag name. A tag value can have a maximum of 256 characters.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :param tag_value: The value of the tag to create. Required.
+ :type tag_value: str
+ :return: TagValue or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagValue
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagValue] = kwargs.pop("cls", None)
+
+ _request = build_tags_create_or_update_value_request(
+ tag_name=tag_name,
+ tag_value=tag_value,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagValue", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails:
+ """Creates a predefined tag name.
+
+ This operation allows adding a name to the list of predefined tag names for the given
+ subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag
+ names cannot have the following prefixes which are reserved for Azure use: 'microsoft',
+ 'azure', 'windows'.
+
+ :param tag_name: The name of the tag to create. Required.
+ :type tag_name: str
+ :return: TagDetails or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None)
+
+ _request = build_tags_create_or_update_request(
+ tag_name=tag_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagDetails", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
+ """Deletes a predefined tag name.
+
+ This operation allows deleting a name from the list of predefined tag names for the given
+ subscription. The name being deleted must not be in use as a tag name for any resource. All
+ predefined values for the given name must have already been deleted.
+
+ :param tag_name: The name of the tag. Required.
+ :type tag_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_request(
+ tag_name=tag_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ @distributed_trace
+ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]:
+ """Gets a summary of tag usage under the subscription.
+
+ This operation performs a union of predefined tags, resource tags, resource group tags and
+ subscription tags, and returns a summary of usage for each tag name and value under the given
+ subscription. In case of a large number of tags, this operation may return a previously cached
+ result.
+
+ :return: An iterator like instance of either TagDetails or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.TagDetails]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_tags_list_request(
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("TagsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ def _create_or_update_at_scope_initial(
+ self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "TagsResource")
+
+ _request = build_tags_create_or_update_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update_at_scope(
+ self, scope: str, parameters: _models.TagsResource, *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update_at_scope(
+ self, scope: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update_at_scope(
+ self, scope: str, parameters: Union[_models.TagsResource, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Creates or updates the entire set of tags on a resource or subscription.
+
+ This operation allows adding or replacing the entire set of tags on the specified resource or
+ subscription. The specified entity can have a maximum of 50 tags.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Is either a TagsResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource or IO[bytes]
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_at_scope_initial(
+ scope=scope,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.TagsResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.TagsResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _update_at_scope_initial(
+ self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(parameters, (IOBase, bytes)):
+ _content = parameters
+ else:
+ _json = self._serialize.body(parameters, "TagsPatchResource")
+
+ _request = build_tags_update_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_update_at_scope(
+ self,
+ scope: str,
+ parameters: _models.TagsPatchResource,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchResource
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_update_at_scope(
+ self, scope: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Required.
+ :type parameters: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_update_at_scope(
+ self, scope: str, parameters: Union[_models.TagsPatchResource, IO[bytes]], **kwargs: Any
+ ) -> LROPoller[_models.TagsResource]:
+ """Selectively updates the set of tags on a resource or subscription.
+
+ This operation allows replacing, merging or selectively deleting tags on the specified resource
+ or subscription. The specified entity can have a maximum of 50 tags at the end of the
+ operation. The 'replace' option replaces the entire set of existing tags with a new set. The
+ 'merge' option allows adding tags with new names and updating the values of tags with existing
+ names. The 'delete' option allows selectively deleting tags based on given names or name/value
+ pairs.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param parameters: Is either a TagsPatchResource type or a IO[bytes] type. Required.
+ :type parameters: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsPatchResource or
+ IO[bytes]
+ :return: An instance of LROPoller that returns either TagsResource or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._update_at_scope_initial(
+ scope=scope,
+ parameters=parameters,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.TagsResource].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.TagsResource](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource:
+ """Gets the entire set of tags on a resource or subscription.
+
+ Gets the entire set of tags on a resource or subscription.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :return: TagsResource or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.TagsResource
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None)
+
+ _request = build_tags_get_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("TagsResource", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ def _delete_at_scope_initial(self, scope: str, **kwargs: Any) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ _request = build_tags_delete_at_scope_request(
+ scope=scope,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def begin_delete_at_scope(self, scope: str, **kwargs: Any) -> LROPoller[None]:
+ """Deletes the entire set of tags on a resource or subscription.
+
+ Deletes the entire set of tags on a resource or subscription.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._delete_at_scope_initial(
+ scope=scope, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs))
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
+
+
+class DeploymentOperationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.resource.resources.v2024_07_01.ResourceManagementClient`'s
+ :attr:`deployment_operations` attribute.
+ """
+
+ models = _models
+
+ 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._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version")
+
+ @distributed_trace
+ def get_at_scope(
+ self, scope: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_scope(
+ self, scope: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param scope: The resource scope. Required.
+ :type scope: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_scope_request(
+ scope=scope,
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get_at_tenant_scope(
+ self, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_tenant_scope(
+ self, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_tenant_scope_request(
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get_at_management_group_scope(
+ self, group_id: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_management_group_scope(
+ self, group_id: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param group_id: The management group ID. Required.
+ :type group_id: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_management_group_scope_request(
+ group_id=group_id,
+ deployment_name=deployment_name,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get_at_subscription_scope(
+ self, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_at_subscription_scope(
+ self, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_at_subscription_scope_request(
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
+
+ @distributed_trace
+ def get(
+ self, resource_group_name: str, deployment_name: str, operation_id: str, **kwargs: Any
+ ) -> _models.DeploymentOperation:
+ """Gets a deployments operation.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param operation_id: The ID of the operation to get. Required.
+ :type operation_id: str
+ :return: DeploymentOperation or the result of cls(response)
+ :rtype: ~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None)
+
+ _request = build_deployment_operations_get_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ operation_id=operation_id,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("DeploymentOperation", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list(
+ self, resource_group_name: str, deployment_name: str, top: Optional[int] = None, **kwargs: Any
+ ) -> Iterable["_models.DeploymentOperation"]:
+ """Gets all deployments operations for a deployment.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param deployment_name: The name of the deployment. Required.
+ :type deployment_name: str
+ :param top: The number of results to return. Default value is None.
+ :type top: int
+ :return: An iterator like instance of either DeploymentOperation or the result of cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.resource.resources.v2024_07_01.models.DeploymentOperation]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-07-01"))
+ cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_deployment_operations_list_request(
+ resource_group_name=resource_group_name,
+ deployment_name=deployment_name,
+ subscription_id=self._config.subscription_id,
+ top=top,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("DeploymentOperationsListResult", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_patch.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_patch.py
new file mode 100644
index 000000000000..f7dd32510333
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/operations/_patch.py
@@ -0,0 +1,20 @@
+# ------------------------------------
+# Copyright (c) Microsoft Corporation.
+# Licensed under the MIT License.
+# ------------------------------------
+"""Customize generated code here.
+
+Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
+"""
+from typing import List
+
+__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
+
+
+def patch_sdk():
+ """Do not remove from this file.
+
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
+ you can't accomplish using the techniques described in
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
+ """
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/py.typed b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/py.typed
new file mode 100644
index 000000000000..e5aff4f83af8
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2024_07_01/py.typed
@@ -0,0 +1 @@
+# Marker file for PEP 561.
\ No newline at end of file
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_configuration.py
index 288b67c27976..bf4924d77359 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py
index 8e02c9e80512..b49fd3989e6f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_configuration.py
index 2d9119b0b5c4..32d31050b6d7 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py
index 1331054f9c96..3cebdbfb50e4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py
index 5f41b72d3b7a..de58785fb405 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +181,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +251,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,7 +306,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,7 +422,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -499,6 +498,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -512,7 +512,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,7 +645,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py
index 46042cbbc444..95e6cba1fe35 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/__init__.py
@@ -5,34 +5,45 @@
# 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 AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDefinition
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDefinition,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+)
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__ = [
@@ -61,5 +72,5 @@
"SpendingLimit",
"SubscriptionState",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/_models_py3.py
index 96be4b0cf44f..87fc63c59f30 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py
index 24005de51ec3..34062bcf3ee5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -234,7 +233,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -334,7 +333,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +403,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -459,7 +458,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +574,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -664,7 +663,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -797,7 +796,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2016_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_configuration.py
index f2364a2fd114..1f2807091508 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py
index c99125be2d1e..ee297575a3c0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_configuration.py
index 7d9c8bf91e3c..70e021bfc71a 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py
index 298226574876..dd45c5bc8ef2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py
index 14702609d1b8..c8930b14aac4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +181,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +251,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,7 +306,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,7 +422,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -499,6 +498,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -512,7 +512,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,7 +645,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py
index 46042cbbc444..95e6cba1fe35 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/__init__.py
@@ -5,34 +5,45 @@
# 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 AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDefinition
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDefinition,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+)
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__ = [
@@ -61,5 +72,5 @@
"SpendingLimit",
"SubscriptionState",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py
index d1e1280849a9..9f56ac4fcafc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py
index e04a99c04101..ab51db945f54 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -234,7 +233,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -334,7 +333,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +403,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -459,7 +458,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +574,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -664,7 +663,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -797,7 +796,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2018_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_configuration.py
index 95ab94a14805..7915479f2f7d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py
index 0ab8ff30c367..d9faab997fd8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_configuration.py
index 910264db32f4..bfa4f8be07c5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py
index d1721efd6fd8..ef563b6f6d7c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py
index aaed69835d44..14d6b6eb6b58 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +181,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +251,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,7 +306,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,7 +422,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -499,6 +498,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -512,7 +512,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,7 +645,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py
index 0877a84ce3f0..234bfbdf934e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/__init__.py
@@ -5,36 +5,47 @@
# 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 AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDefinition
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import ManagedByTenant
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
-from ._subscription_client_enums import TenantCategory
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDefinition,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ ManagedByTenant,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+ TenantCategory,
+)
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__ = [
@@ -65,5 +76,5 @@
"SubscriptionState",
"TenantCategory",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py
index 2c4fa487ba32..853195e101df 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py
index d48d075bb93a..e47535a748b0 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -234,7 +233,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -334,7 +333,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +403,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -459,7 +458,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +574,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -664,7 +663,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -797,7 +796,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_06_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py
index 31c9c8882f6f..f1f536c5a621 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py
index a1b4d267c015..5620b9d16866 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_configuration.py
index a33f99bde2ba..6f982c0e33d5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py
index 2a01248aebf3..3432a723a6d2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py
index e71952a9e474..9eeae2aae08e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -182,7 +181,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +251,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -307,7 +306,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,7 +422,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -499,6 +498,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -512,7 +512,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -645,7 +645,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py
index ea3966709fb9..427355cd3890 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/__init__.py
@@ -5,40 +5,51 @@
# 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 AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDefinition
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import LocationMetadata
-from ._models_py3 import ManagedByTenant
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import PairedRegion
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import RegionCategory
-from ._subscription_client_enums import RegionType
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
-from ._subscription_client_enums import TenantCategory
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDefinition,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ LocationMetadata,
+ ManagedByTenant,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ PairedRegion,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ RegionCategory,
+ RegionType,
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+ TenantCategory,
+)
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__ = [
@@ -73,5 +84,5 @@
"SubscriptionState",
"TenantCategory",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py
index ee886ffaf0d2..406ef39ce721 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py
index ba52e9af841f..856f31679ecd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -234,7 +233,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -334,7 +333,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -404,7 +403,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -459,7 +458,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +574,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -664,7 +663,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -797,7 +796,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2019_11_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_configuration.py
index 2e706f27e40c..4113f3e6531f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py
index 73a3f7be20e7..5af1a6f1df0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_configuration.py
index eb8a7a0f58fd..f9496310ff0e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py
index 9635ca24af44..d9dce62cc737 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/__init__.py
index 85d6e330e1a4..5d99d6bb095f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -19,5 +25,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py
index 169f6d3157df..516c1e408045 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -41,7 +40,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -91,7 +90,7 @@ def list_locations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -162,7 +161,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -217,7 +216,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -333,7 +332,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -409,6 +408,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -422,7 +422,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -555,7 +555,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/__init__.py
index 3feca34bddd9..cacc92d8757d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/__init__.py
@@ -5,40 +5,51 @@
# 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 AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import LocationMetadata
-from ._models_py3 import ManagedByTenant
-from ._models_py3 import Operation
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationListResult
-from ._models_py3 import PairedRegion
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import LocationType
-from ._subscription_client_enums import RegionCategory
-from ._subscription_client_enums import RegionType
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
-from ._subscription_client_enums import TenantCategory
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ LocationMetadata,
+ ManagedByTenant,
+ Operation,
+ OperationDisplay,
+ OperationListResult,
+ PairedRegion,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ LocationType,
+ RegionCategory,
+ RegionType,
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+ TenantCategory,
+)
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__ = [
@@ -73,5 +84,5 @@
"SubscriptionState",
"TenantCategory",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/_models_py3.py
index 66753e12081c..90005bc2e068 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -12,7 +11,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/__init__.py
index 85d6e330e1a4..5d99d6bb095f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/__init__.py
@@ -5,13 +5,19 @@
# 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 ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -19,5 +25,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py
index f218e2ed0d3e..097092f7a14d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -229,7 +228,7 @@ def list_locations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -300,7 +299,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -355,7 +354,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -471,7 +470,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -560,7 +559,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -693,7 +692,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2021_01_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/__init__.py
index 5505b1d16f47..2ce2c3a5dd64 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/__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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_configuration.py
index ce04fa4dc45a..b00fd2d8b220 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py
index 3a1333c1024e..fa41ba11f01d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py
index 51b719fee290..c2b8c75e49c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient
from .._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/__init__.py
index cee23feb3f8b..bb5ad1b4e042 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/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 ._subscription_client import SubscriptionClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._subscription_client import SubscriptionClient # 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__ = [
"SubscriptionClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_configuration.py
index b93e96dbb2b6..518d42d158eb 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/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 SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class SubscriptionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for SubscriptionClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py
index e02f2e991a28..aa00bbcabecd 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py
@@ -21,11 +21,10 @@
from .operations import Operations, SubscriptionClientOperationsMixin, SubscriptionsOperations, TenantsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class SubscriptionClient(SubscriptionClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
+class SubscriptionClient(SubscriptionClientOperationsMixin):
"""All resource groups and resources exist within subscriptions. These operation enable you get
information about your subscriptions and tenants. A tenant is a dedicated instance of Azure
Active Directory (Azure AD) for your organization.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_vendor.py
index 3bc9cbbb67a6..2442a1ec9c7b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_vendor.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_vendor.py
@@ -11,7 +11,6 @@
from ._configuration import SubscriptionClientConfiguration
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient
from ..._serialization import Deserializer, Serializer
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py
index b440e0ddcbfb..a6654b0b82d9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -82,7 +81,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -187,7 +186,7 @@ def list_locations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -258,7 +257,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -313,7 +312,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -429,7 +428,7 @@ async def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -505,6 +504,7 @@ def __init__(self, *args, **kwargs) -> None:
@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
+ # pylint: disable=line-too-long
"""Gets the tenants for your account.
:return: An iterator like instance of either TenantIdDescription or the result of cls(response)
@@ -518,7 +518,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -651,7 +651,7 @@ async def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/__init__.py
index 0a9171f3a572..58d161b82e76 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/__init__.py
@@ -5,46 +5,57 @@
# 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 AvailabilityZoneMappings
-from ._models_py3 import AvailabilityZonePeers
-from ._models_py3 import CheckResourceNameResult
-from ._models_py3 import CheckZonePeersRequest
-from ._models_py3 import CheckZonePeersResult
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ErrorResponseAutoGenerated
-from ._models_py3 import Location
-from ._models_py3 import LocationListResult
-from ._models_py3 import LocationMetadata
-from ._models_py3 import ManagedByTenant
-from ._models_py3 import Operation
-from ._models_py3 import OperationAutoGenerated
-from ._models_py3 import OperationDisplay
-from ._models_py3 import OperationDisplayAutoGenerated
-from ._models_py3 import OperationListResult
-from ._models_py3 import OperationListResultAutoGenerated
-from ._models_py3 import PairedRegion
-from ._models_py3 import Peers
-from ._models_py3 import ResourceName
-from ._models_py3 import Subscription
-from ._models_py3 import SubscriptionListResult
-from ._models_py3 import SubscriptionPolicies
-from ._models_py3 import TenantIdDescription
-from ._models_py3 import TenantListResult
+from typing import TYPE_CHECKING
-from ._subscription_client_enums import ActionType
-from ._subscription_client_enums import LocationType
-from ._subscription_client_enums import Origin
-from ._subscription_client_enums import RegionCategory
-from ._subscription_client_enums import RegionType
-from ._subscription_client_enums import ResourceNameStatus
-from ._subscription_client_enums import SpendingLimit
-from ._subscription_client_enums import SubscriptionState
-from ._subscription_client_enums import TenantCategory
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AvailabilityZoneMappings,
+ AvailabilityZonePeers,
+ CheckResourceNameResult,
+ CheckZonePeersRequest,
+ CheckZonePeersResult,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ErrorResponseAutoGenerated,
+ Location,
+ LocationListResult,
+ LocationMetadata,
+ ManagedByTenant,
+ Operation,
+ OperationAutoGenerated,
+ OperationDisplay,
+ OperationDisplayAutoGenerated,
+ OperationListResult,
+ OperationListResultAutoGenerated,
+ PairedRegion,
+ Peers,
+ ResourceName,
+ Subscription,
+ SubscriptionListResult,
+ SubscriptionPolicies,
+ TenantIdDescription,
+ TenantListResult,
+)
+
+from ._subscription_client_enums import ( # type: ignore
+ ActionType,
+ LocationType,
+ Origin,
+ RegionCategory,
+ RegionType,
+ ResourceNameStatus,
+ SpendingLimit,
+ SubscriptionState,
+ TenantCategory,
+)
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__ = [
@@ -85,5 +96,5 @@
"SubscriptionState",
"TenantCategory",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/_models_py3.py
index 49091b3f0c62..ac4e44d3c637 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@@ -12,7 +12,6 @@
from ... import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/__init__.py
index 8ba7fd81aa98..6cfd4645416c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/__init__.py
@@ -5,14 +5,20 @@
# 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 ._operations import Operations
-from ._operations import SubscriptionsOperations
-from ._operations import TenantsOperations
-from ._operations import SubscriptionClientOperationsMixin
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._operations import SubscriptionsOperations # type: ignore
+from ._operations import TenantsOperations # type: ignore
+from ._operations import SubscriptionClientOperationsMixin # 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__ = [
@@ -21,5 +27,5 @@
"TenantsOperations",
"SubscriptionClientOperationsMixin",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py
index e7a23725c301..3e0c2d75c2f6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/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.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -238,7 +237,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -343,7 +342,7 @@ def list_locations(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -414,7 +413,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription:
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.Subscription
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -469,7 +468,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -585,7 +584,7 @@ def check_zone_peers(
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.CheckZonePeersResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -674,7 +673,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01"))
cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -807,7 +806,7 @@ def check_resource_name(
:rtype: ~azure.mgmt.resource.subscriptions.v2022_12_01.models.CheckResourceNameResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py
index 59f1fcf71bc9..dc8692e6ec0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py
@@ -24,7 +24,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +51,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +89,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 +112,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 +155,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +189,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +226,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +255,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +329,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 +365,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,14 +389,14 @@ 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,
keep_readonly: bool = True,
- key_transformer: Callable[
- [str, Dict[str, Any], Any], Any
- ] = attribute_transformer,
+ key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
@@ -382,12 +425,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):
@@ -397,7 +443,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -410,6 +456,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -428,9 +475,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -450,21 +499,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:
@@ -503,11 +556,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(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -542,7 +597,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,
@@ -562,13 +617,16 @@ def __init__(self, classes: Optional[Mapping[str, type]]=None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -594,12 +652,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"] == "":
@@ -635,7 +695,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
@@ -666,17 +727,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -705,7 +766,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
@@ -714,9 +775,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -730,27 +793,26 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
- do_quote = not kwargs.get('skip_quote', False)
+ do_quote = not kwargs.get("skip_quote", False)
return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)
# Not a list, regular serialization
@@ -761,19 +823,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -782,21 +845,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -807,7 +869,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
@@ -823,11 +885,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
@@ -843,23 +904,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
@@ -873,8 +937,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.
@@ -884,15 +947,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.")
@@ -909,12 +970,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
raise
serialized.append(None)
- if kwargs.get('do_quote', False):
- serialized = [
- '' if s is None else quote(str(s), safe='')
- for s
- in serialized
- ]
+ if kwargs.get("do_quote", False):
+ serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
if div:
serialized = ["" if s is None else str(s) for s in serialized]
@@ -951,9 +1008,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 = {}
@@ -977,7 +1033,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
@@ -985,6 +1041,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
@@ -1009,7 +1066,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:
@@ -1040,56 +1097,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)
@@ -1097,11 +1159,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)
@@ -1111,30 +1174,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1147,12 +1212,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1178,13 +1244,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1192,11 +1259,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
@@ -1217,7 +1284,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
@@ -1238,17 +1307,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)
@@ -1285,7 +1366,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
@@ -1337,22 +1418,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1369,9 +1449,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,
@@ -1409,11 +1489,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1422,12 +1503,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1446,13 +1528,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"...
@@ -1482,9 +1564,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:
@@ -1511,6 +1592,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
@@ -1522,7 +1605,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
@@ -1537,10 +1620,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
)
@@ -1558,10 +1643,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", {})
@@ -1585,14 +1672,21 @@ 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() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
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:
@@ -1602,7 +1696,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
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():
@@ -1611,15 +1705,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1633,7 +1728,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)
@@ -1653,14 +1752,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:
@@ -1677,6 +1776,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):
@@ -1687,11 +1787,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1726,11 +1827,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
@@ -1738,6 +1838,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1749,24 +1850,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):
@@ -1774,6 +1874,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,
@@ -1787,8 +1888,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):
@@ -1800,6 +1900,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:
@@ -1810,9 +1911,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:
@@ -1828,6 +1929,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1840,6 +1942,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1855,8 +1958,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1871,6 +1975,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1883,6 +1988,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1893,14 +1999,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1916,6 +2022,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1930,6 +2037,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1945,14 +2053,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1982,8 +2090,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):
@@ -1991,6 +2098,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -2002,5 +2110,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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/__init__.py
index 02636d550f87..b1c5959e7385 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/__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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_configuration.py
index de05cfeaa2f4..510fe701fd04 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py
index 06ccafe98d1c..e12a731ab498 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/__init__.py
index a2bcb77d7603..7c4b67e1c414 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_configuration.py
index d968d188533f..8341f1c1f09f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py
index a77e5cd826bf..129740c029f4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py
index 401559753488..af0fe0e4b4c9 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -45,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -147,7 +147,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -285,7 +285,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -368,7 +368,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -415,9 +415,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, template_spec_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, template_spec_name: str, **kwargs: Any) -> None:
"""Deletes a Template Spec by name. When operation completes, status code 200 returned without
content.
@@ -430,7 +428,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,
@@ -475,6 +473,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list_by_subscription(
self, expand: Optional[Union[str, _models.TemplateSpecExpandKind]] = None, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpec"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Specs within the specified subscriptions.
:param expand: Allows for expansion of additional Template Spec details in the response.
@@ -494,7 +493,7 @@ def list_by_subscription(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -563,6 +562,7 @@ def list_by_resource_group(
expand: Optional[Union[str, _models.TemplateSpecExpandKind]] = None,
**kwargs: Any
) -> AsyncIterable["_models.TemplateSpec"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Specs within the specified resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -585,7 +585,7 @@ def list_by_resource_group(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -756,7 +756,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -905,7 +905,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -983,7 +983,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1030,7 +1030,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, template_spec_name: str, template_spec_version: str, **kwargs: Any
) -> None:
"""Deletes a specific version from a Template Spec. When operation completes, status code 200
@@ -1047,7 +1047,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,
@@ -1093,6 +1093,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list(
self, resource_group_name: str, template_spec_name: str, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpecVersion"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Spec versions in the specified Template Spec.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1113,7 +1114,7 @@ def list(
)
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/__init__.py
index f15d7c7caf50..c3d4a0ae8408 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/__init__.py
@@ -5,27 +5,38 @@
# 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 AzureResourceBase
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import SystemData
-from ._models_py3 import TemplateSpec
-from ._models_py3 import TemplateSpecArtifact
-from ._models_py3 import TemplateSpecTemplateArtifact
-from ._models_py3 import TemplateSpecUpdateModel
-from ._models_py3 import TemplateSpecVersion
-from ._models_py3 import TemplateSpecVersionInfo
-from ._models_py3 import TemplateSpecVersionUpdateModel
-from ._models_py3 import TemplateSpecVersionsListResult
-from ._models_py3 import TemplateSpecsError
-from ._models_py3 import TemplateSpecsListResult
+from typing import TYPE_CHECKING
-from ._template_specs_client_enums import CreatedByType
-from ._template_specs_client_enums import TemplateSpecArtifactKind
-from ._template_specs_client_enums import TemplateSpecExpandKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureResourceBase,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ SystemData,
+ TemplateSpec,
+ TemplateSpecArtifact,
+ TemplateSpecTemplateArtifact,
+ TemplateSpecUpdateModel,
+ TemplateSpecVersion,
+ TemplateSpecVersionInfo,
+ TemplateSpecVersionUpdateModel,
+ TemplateSpecVersionsListResult,
+ TemplateSpecsError,
+ TemplateSpecsListResult,
+)
+
+from ._template_specs_client_enums import ( # type: ignore
+ CreatedByType,
+ TemplateSpecArtifactKind,
+ TemplateSpecExpandKind,
+)
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__ = [
@@ -47,5 +58,5 @@
"TemplateSpecArtifactKind",
"TemplateSpecExpandKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/_models_py3.py
index 088be8fb6ddf..d112a9c4aa0f 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py
index 34c6f56e0ed3..dda789d877e4 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -569,7 +569,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -707,7 +707,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -790,7 +790,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -852,7 +852,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,
@@ -916,7 +916,7 @@ def list_by_subscription(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1007,7 +1007,7 @@ def list_by_resource_group(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1178,7 +1178,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1327,7 +1327,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1405,7 +1405,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2019_06_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1469,7 +1469,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,
@@ -1535,7 +1535,7 @@ def list(
)
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py
index 02636d550f87..b1c5959e7385 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/__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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py
index 2717596da304..7db34224df6e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py
index 8eb14282a341..3ea7334ae2d5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/__init__.py
index a2bcb77d7603..7c4b67e1c414 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_configuration.py
index 9c9059def27a..241ef4b2533e 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py
index bb6bbb55aeb6..1f4faa485e91 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py
index 934176f7e5a0..66564ca2c74c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -45,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -147,7 +147,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -285,7 +285,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -368,7 +368,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -415,9 +415,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, template_spec_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, template_spec_name: str, **kwargs: Any) -> None:
"""Deletes a Template Spec by name. When operation completes, status code 200 returned without
content.
@@ -430,7 +428,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,
@@ -475,6 +473,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list_by_subscription(
self, expand: Optional[Union[str, _models.TemplateSpecExpandKind]] = None, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpec"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Specs within the specified subscriptions.
:param expand: Allows for expansion of additional Template Spec details in the response.
@@ -494,7 +493,7 @@ def list_by_subscription(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -563,6 +562,7 @@ def list_by_resource_group(
expand: Optional[Union[str, _models.TemplateSpecExpandKind]] = None,
**kwargs: Any
) -> AsyncIterable["_models.TemplateSpec"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Specs within the specified resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -585,7 +585,7 @@ def list_by_resource_group(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -756,7 +756,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -905,7 +905,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -983,7 +983,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1030,7 +1030,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, template_spec_name: str, template_spec_version: str, **kwargs: Any
) -> None:
"""Deletes a specific version from a Template Spec. When operation completes, status code 200
@@ -1047,7 +1047,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,
@@ -1093,6 +1093,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list(
self, resource_group_name: str, template_spec_name: str, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpecVersion"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Spec versions in the specified Template Spec.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1113,7 +1114,7 @@ def list(
)
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py
index c83689999b1f..236c1a274743 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/__init__.py
@@ -5,25 +5,36 @@
# 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 AzureResourceBase
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import LinkedTemplateArtifact
-from ._models_py3 import SystemData
-from ._models_py3 import TemplateSpec
-from ._models_py3 import TemplateSpecUpdateModel
-from ._models_py3 import TemplateSpecVersion
-from ._models_py3 import TemplateSpecVersionInfo
-from ._models_py3 import TemplateSpecVersionUpdateModel
-from ._models_py3 import TemplateSpecVersionsListResult
-from ._models_py3 import TemplateSpecsError
-from ._models_py3 import TemplateSpecsListResult
+from typing import TYPE_CHECKING
-from ._template_specs_client_enums import CreatedByType
-from ._template_specs_client_enums import TemplateSpecExpandKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureResourceBase,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ LinkedTemplateArtifact,
+ SystemData,
+ TemplateSpec,
+ TemplateSpecUpdateModel,
+ TemplateSpecVersion,
+ TemplateSpecVersionInfo,
+ TemplateSpecVersionUpdateModel,
+ TemplateSpecVersionsListResult,
+ TemplateSpecsError,
+ TemplateSpecsListResult,
+)
+
+from ._template_specs_client_enums import ( # type: ignore
+ CreatedByType,
+ TemplateSpecExpandKind,
+)
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__ = [
@@ -43,5 +54,5 @@
"CreatedByType",
"TemplateSpecExpandKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py
index ea2294052b81..9ddbfcb72c29 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -426,7 +424,7 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N
self.tags = tags
-class TemplateSpecVersion(AzureResourceBase): # pylint: disable=too-many-instance-attributes
+class TemplateSpecVersion(AzureResourceBase):
"""Template Spec Version object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py
index 21d2d1ed021a..6ad0bd9a7129 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -569,7 +569,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -707,7 +707,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -790,7 +790,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -852,7 +852,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,
@@ -916,7 +916,7 @@ def list_by_subscription(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1007,7 +1007,7 @@ def list_by_resource_group(
)
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1178,7 +1178,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1327,7 +1327,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1405,7 +1405,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_03_01_preview.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1469,7 +1469,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,
@@ -1535,7 +1535,7 @@ def list(
)
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py
index 02636d550f87..b1c5959e7385 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/__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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py
index 5f6966094752..024471e69b4d 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py
index daa642a449de..38082e0531ca 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/__init__.py
index a2bcb77d7603..7c4b67e1c414 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_configuration.py
index 170bc002e58c..9cbd39096fbc 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py
index c83e321683e2..8a75d91aa4df 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py
index 9aeff4d84079..956772b2ec1b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -45,7 +45,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -147,7 +147,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -282,7 +282,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -363,7 +363,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -408,9 +408,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, template_spec_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, template_spec_name: str, **kwargs: Any) -> None:
"""Deletes a Template Spec by name. When operation completes, status code 200 returned without
content.
@@ -423,7 +421,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,
@@ -483,7 +481,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -572,7 +570,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -743,7 +741,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -890,7 +888,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -966,7 +964,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1011,7 +1009,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, template_spec_name: str, template_spec_version: str, **kwargs: Any
) -> None:
"""Deletes a specific version from a Template Spec. When operation completes, status code 200
@@ -1028,7 +1026,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,
@@ -1072,6 +1070,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list(
self, resource_group_name: str, template_spec_name: str, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpecVersion"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Spec versions in the specified Template Spec.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1090,7 +1089,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py
index c83689999b1f..236c1a274743 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/__init__.py
@@ -5,25 +5,36 @@
# 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 AzureResourceBase
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import LinkedTemplateArtifact
-from ._models_py3 import SystemData
-from ._models_py3 import TemplateSpec
-from ._models_py3 import TemplateSpecUpdateModel
-from ._models_py3 import TemplateSpecVersion
-from ._models_py3 import TemplateSpecVersionInfo
-from ._models_py3 import TemplateSpecVersionUpdateModel
-from ._models_py3 import TemplateSpecVersionsListResult
-from ._models_py3 import TemplateSpecsError
-from ._models_py3 import TemplateSpecsListResult
+from typing import TYPE_CHECKING
-from ._template_specs_client_enums import CreatedByType
-from ._template_specs_client_enums import TemplateSpecExpandKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureResourceBase,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ LinkedTemplateArtifact,
+ SystemData,
+ TemplateSpec,
+ TemplateSpecUpdateModel,
+ TemplateSpecVersion,
+ TemplateSpecVersionInfo,
+ TemplateSpecVersionUpdateModel,
+ TemplateSpecVersionsListResult,
+ TemplateSpecsError,
+ TemplateSpecsListResult,
+)
+
+from ._template_specs_client_enums import ( # type: ignore
+ CreatedByType,
+ TemplateSpecExpandKind,
+)
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__ = [
@@ -43,5 +54,5 @@
"CreatedByType",
"TemplateSpecExpandKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py
index 98e1fb6dde67..90fa620e2ee2 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -423,7 +421,7 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N
self.tags = tags
-class TemplateSpecVersion(AzureResourceBase): # pylint: disable=too-many-instance-attributes
+class TemplateSpecVersion(AzureResourceBase):
"""Template Spec Version object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py
index ff5bcfb933ef..6438561bb171 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -569,7 +569,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -704,7 +704,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -785,7 +785,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -845,7 +845,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,
@@ -905,7 +905,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -994,7 +994,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1165,7 +1165,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1312,7 +1312,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1388,7 +1388,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2021_05_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1450,7 +1450,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,
@@ -1512,7 +1512,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__init__.py
index 02636d550f87..b1c5959e7385 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/__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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py
index 69c326b36cdc..d2ec72302c98 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py
index 60b3bb0dcabb..59a1878260b5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py
index 62c540d4a8b6..e5754a47ce68 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "23.2.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/__init__.py
index a2bcb77d7603..7c4b67e1c414 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/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 ._template_specs_client import TemplateSpecsClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._template_specs_client import TemplateSpecsClient # 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__ = [
"TemplateSpecsClient",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py
index e38c8268bc75..aa832c5bc65b 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_configuration.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/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 TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
+class TemplateSpecsClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for TemplateSpecsClient.
Note that all parameters used to create this instance are saved as instance
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py
index ceb032691d01..b7f7faee8d97 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py
@@ -21,11 +21,10 @@
from .operations import TemplateSpecVersionsOperations, TemplateSpecsOperations
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class TemplateSpecsClient: # pylint: disable=client-accepts-api-version-keyword
+class TemplateSpecsClient:
"""The APIs listed in this specification can be used to manage Template Spec resources through the
Azure Resource Manager.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py
index e0472ef20af8..add74bf155f5 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -49,7 +49,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -151,7 +151,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -286,7 +286,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -367,7 +367,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -412,9 +412,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, template_spec_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, template_spec_name: str, **kwargs: Any) -> None:
"""Deletes a Template Spec by name. When operation completes, status code 200 returned without
content.
@@ -427,7 +425,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,
@@ -487,7 +485,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -576,7 +574,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -658,7 +656,7 @@ async def get_built_in(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -721,7 +719,7 @@ def list_built_ins(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -890,7 +888,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1037,7 +1035,7 @@ async def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1113,7 +1111,7 @@ async def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1158,7 +1156,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, template_spec_name: str, template_spec_version: str, **kwargs: Any
) -> None:
"""Deletes a specific version from a Template Spec. When operation completes, status code 200
@@ -1175,7 +1173,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,
@@ -1219,6 +1217,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
def list(
self, resource_group_name: str, template_spec_name: str, **kwargs: Any
) -> AsyncIterable["_models.TemplateSpecVersion"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Spec versions in the specified Template Spec.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -1237,7 +1236,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1302,6 +1301,7 @@ async def get_next(next_link=None):
@distributed_trace
def list_built_ins(self, template_spec_name: str, **kwargs: Any) -> AsyncIterable["_models.TemplateSpecVersion"]:
+ # pylint: disable=line-too-long
"""Lists all the Template Spec versions in the specified built-in Template Spec.
:param template_spec_name: Name of the Template Spec. Required.
@@ -1317,7 +1317,7 @@ def list_built_ins(self, template_spec_name: str, **kwargs: Any) -> AsyncIterabl
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1392,7 +1392,7 @@ async def get_built_in(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py
index c83689999b1f..236c1a274743 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/__init__.py
@@ -5,25 +5,36 @@
# 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 AzureResourceBase
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorResponse
-from ._models_py3 import LinkedTemplateArtifact
-from ._models_py3 import SystemData
-from ._models_py3 import TemplateSpec
-from ._models_py3 import TemplateSpecUpdateModel
-from ._models_py3 import TemplateSpecVersion
-from ._models_py3 import TemplateSpecVersionInfo
-from ._models_py3 import TemplateSpecVersionUpdateModel
-from ._models_py3 import TemplateSpecVersionsListResult
-from ._models_py3 import TemplateSpecsError
-from ._models_py3 import TemplateSpecsListResult
+from typing import TYPE_CHECKING
-from ._template_specs_client_enums import CreatedByType
-from ._template_specs_client_enums import TemplateSpecExpandKind
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ AzureResourceBase,
+ ErrorAdditionalInfo,
+ ErrorResponse,
+ LinkedTemplateArtifact,
+ SystemData,
+ TemplateSpec,
+ TemplateSpecUpdateModel,
+ TemplateSpecVersion,
+ TemplateSpecVersionInfo,
+ TemplateSpecVersionUpdateModel,
+ TemplateSpecVersionsListResult,
+ TemplateSpecsError,
+ TemplateSpecsListResult,
+)
+
+from ._template_specs_client_enums import ( # type: ignore
+ CreatedByType,
+ TemplateSpecExpandKind,
+)
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__ = [
@@ -43,5 +54,5 @@
"CreatedByType",
"TemplateSpecExpandKind",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py
index 2af20833fa81..529e8268f9e8 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/models/_models_py3.py
@@ -1,5 +1,4 @@
# 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.
@@ -16,10 +15,9 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
@@ -423,7 +421,7 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N
self.tags = tags
-class TemplateSpecVersion(AzureResourceBase): # pylint: disable=too-many-instance-attributes
+class TemplateSpecVersion(AzureResourceBase):
"""Template Spec Version object.
Variables are only populated by the server, and will be ignored when sending a request.
diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py
index bc37e18e5a34..0fbc5cf4114c 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/__init__.py
@@ -5,17 +5,23 @@
# 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 ._operations import TemplateSpecsOperations
-from ._operations import TemplateSpecVersionsOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import TemplateSpecsOperations # type: ignore
+from ._operations import TemplateSpecVersionsOperations # 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__ = [
"TemplateSpecsOperations",
"TemplateSpecVersionsOperations",
]
-__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/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py
index ffb918047879..2b3cebc59ec6 100644
--- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py
+++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -689,7 +689,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -824,7 +824,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -905,7 +905,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -965,7 +965,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,
@@ -1025,7 +1025,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1114,7 +1114,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1196,7 +1196,7 @@ def get_built_in(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpec
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1259,7 +1259,7 @@ def list_built_ins(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1428,7 +1428,7 @@ def create_or_update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1575,7 +1575,7 @@ def update(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1651,7 +1651,7 @@ def get(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1713,7 +1713,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,
@@ -1775,7 +1775,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1855,7 +1855,7 @@ def list_built_ins(self, template_spec_name: str, **kwargs: Any) -> Iterable["_m
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01"))
cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1930,7 +1930,7 @@ def get_built_in(
:rtype: ~azure.mgmt.resource.templatespecs.v2022_02_01.models.TemplateSpecVersion
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/export_resource_group_as_bicep.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/export_resource_group_as_bicep.py
new file mode 100644
index 000000000000..ce6388f42949
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/export_resource_group_as_bicep.py
@@ -0,0 +1,46 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python export_resource_group_as_bicep.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000000",
+ )
+
+ response = client.resource_groups.begin_export_template(
+ resource_group_name="my-resource-group",
+ parameters={
+ "options": "IncludeParameterDefaultValue,IncludeComments",
+ "outputFormat": "Bicep",
+ "resources": ["*"],
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/ExportResourceGroupAsBicep.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_management_group.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_management_group.py
new file mode 100644
index 000000000000..81e31ec540e5
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_management_group.py
@@ -0,0 +1,50 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python post_deployment_validate_on_management_group.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="SUBSCRIPTION_ID",
+ )
+
+ response = client.deployments.begin_validate_at_management_group_scope(
+ group_id="my-management-group-id",
+ deployment_name="my-deployment",
+ parameters={
+ "location": "eastus",
+ "properties": {
+ "mode": "Incremental",
+ "parameters": {},
+ "templateLink": {"uri": "https://example.com/exampleTemplate.json"},
+ },
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/PostDeploymentValidateOnManagementGroup.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_resource_group.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_resource_group.py
new file mode 100644
index 000000000000..c23854d41d19
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_resource_group.py
@@ -0,0 +1,52 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python post_deployment_validate_on_resource_group.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000001",
+ )
+
+ response = client.deployments.begin_validate(
+ resource_group_name="my-resource-group",
+ deployment_name="my-deployment",
+ parameters={
+ "properties": {
+ "mode": "Incremental",
+ "parameters": {},
+ "templateLink": {
+ "queryString": "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d",
+ "uri": "https://example.com/exampleTemplate.json",
+ },
+ }
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/PostDeploymentValidateOnResourceGroup.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_scope.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_scope.py
new file mode 100644
index 000000000000..ed30bdee40bb
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_scope.py
@@ -0,0 +1,52 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python post_deployment_validate_on_scope.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="SUBSCRIPTION_ID",
+ )
+
+ response = client.deployments.begin_validate_at_scope(
+ scope="subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group",
+ deployment_name="my-deployment",
+ parameters={
+ "properties": {
+ "mode": "Incremental",
+ "parameters": {},
+ "templateLink": {
+ "queryString": "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d",
+ "uri": "https://example.com/exampleTemplate.json",
+ },
+ }
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/PostDeploymentValidateOnScope.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_subscription.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_subscription.py
new file mode 100644
index 000000000000..9320bdbac961
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_subscription.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python post_deployment_validate_on_subscription.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="00000000-0000-0000-0000-000000000001",
+ )
+
+ response = client.deployments.begin_validate_at_subscription_scope(
+ deployment_name="my-deployment",
+ parameters={
+ "location": "eastus",
+ "properties": {
+ "mode": "Incremental",
+ "parameters": {},
+ "templateLink": {"uri": "https://example.com/exampleTemplate.json"},
+ },
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/PostDeploymentValidateOnSubscription.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_tenant.py b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_tenant.py
new file mode 100644
index 000000000000..12ebce1d1588
--- /dev/null
+++ b/sdk/resources/azure-mgmt-resource/generated_samples/resources/post_deployment_validate_on_tenant.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.resource import ResourceManagementClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-resource
+# USAGE
+ python post_deployment_validate_on_tenant.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = ResourceManagementClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="SUBSCRIPTION_ID",
+ )
+
+ response = client.deployments.begin_validate_at_tenant_scope(
+ deployment_name="my-deployment",
+ parameters={
+ "location": "eastus",
+ "properties": {
+ "mode": "Incremental",
+ "parameters": {},
+ "templateLink": {"uri": "https://example.com/exampleTemplate.json"},
+ },
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/examples/PostDeploymentValidateOnTenant.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/conftest.py b/sdk/resources/azure-mgmt-resource/generated_tests/conftest.py
index e6271e901671..d0a3b52e198a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/conftest.py
+++ b/sdk/resources/azure-mgmt-resource/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):
databoundarymgmt_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000")
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations.py
index e1b545801a0d..58e9c549a300 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_application_definitions_get(self, resource_group):
response = self.client.application_definitions.get(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_application_definitions_begin_delete(self, resource_group):
response = self.client.application_definitions.begin_delete(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -44,7 +44,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_application_definitions_begin_create_or_update(self, resource_group):
response = self.client.application_definitions.begin_create_or_update(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -79,7 +79,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_application_definitions_list_by_resource_group(self, resource_group):
response = self.client.application_definitions.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
@@ -90,7 +90,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_id(self, resource_group):
+ def test_application_definitions_get_by_id(self, resource_group):
response = self.client.application_definitions.get_by_id(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -102,7 +102,7 @@ def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_by_id(self, resource_group):
+ def test_application_definitions_begin_delete_by_id(self, resource_group):
response = self.client.application_definitions.begin_delete_by_id(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -114,7 +114,7 @@ def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_by_id(self, resource_group):
+ def test_application_definitions_begin_create_or_update_by_id(self, resource_group):
response = self.client.application_definitions.begin_create_or_update_by_id(
resource_group_name=resource_group.name,
application_definition_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations_async.py
index 2503007a55b3..ec05d8abcd4a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_application_definitions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_application_definitions_get(self, resource_group):
response = await self.client.application_definitions.get(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_application_definitions_begin_delete(self, resource_group):
response = await (
await self.client.application_definitions.begin_delete(
resource_group_name=resource_group.name,
@@ -47,7 +47,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_application_definitions_begin_create_or_update(self, resource_group):
response = await (
await self.client.application_definitions.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -91,7 +91,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_application_definitions_list_by_resource_group(self, resource_group):
response = self.client.application_definitions.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
@@ -102,7 +102,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_id(self, resource_group):
+ async def test_application_definitions_get_by_id(self, resource_group):
response = await self.client.application_definitions.get_by_id(
resource_group_name=resource_group.name,
application_definition_name="str",
@@ -114,7 +114,7 @@ async def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_by_id(self, resource_group):
+ async def test_application_definitions_begin_delete_by_id(self, resource_group):
response = await (
await self.client.application_definitions.begin_delete_by_id(
resource_group_name=resource_group.name,
@@ -128,7 +128,7 @@ async def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_by_id(self, resource_group):
+ async def test_application_definitions_begin_create_or_update_by_id(self, resource_group):
response = await (
await self.client.application_definitions.begin_create_or_update_by_id(
resource_group_name=resource_group.name,
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations.py
index bbec842cae7f..89623565331f 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_applications_get(self, resource_group):
response = self.client.applications.get(
resource_group_name=resource_group.name,
application_name="str",
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_applications_begin_delete(self, resource_group):
response = self.client.applications.begin_delete(
resource_group_name=resource_group.name,
application_name="str",
@@ -44,7 +44,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_applications_begin_create_or_update(self, resource_group):
response = self.client.applications.begin_create_or_update(
resource_group_name=resource_group.name,
application_name="str",
@@ -93,7 +93,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_applications_update(self, resource_group):
response = self.client.applications.update(
resource_group_name=resource_group.name,
application_name="str",
@@ -105,7 +105,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_applications_list_by_resource_group(self, resource_group):
response = self.client.applications.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
@@ -116,7 +116,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_applications_list_by_subscription(self, resource_group):
response = self.client.applications.list_by_subscription(
api_version="2019-07-01",
)
@@ -126,7 +126,7 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_id(self, resource_group):
+ def test_applications_get_by_id(self, resource_group):
response = self.client.applications.get_by_id(
application_id="str",
api_version="2019-07-01",
@@ -137,7 +137,7 @@ def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_by_id(self, resource_group):
+ def test_applications_begin_delete_by_id(self, resource_group):
response = self.client.applications.begin_delete_by_id(
application_id="str",
api_version="2019-07-01",
@@ -148,7 +148,7 @@ def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_by_id(self, resource_group):
+ def test_applications_begin_create_or_update_by_id(self, resource_group):
response = self.client.applications.begin_create_or_update_by_id(
application_id="str",
parameters={
@@ -196,7 +196,7 @@ def test_begin_create_or_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update_by_id(self, resource_group):
+ def test_applications_update_by_id(self, resource_group):
response = self.client.applications.update_by_id(
application_id="str",
api_version="2019-07-01",
@@ -207,7 +207,7 @@ def test_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_refresh_permissions(self, resource_group):
+ def test_applications_begin_refresh_permissions(self, resource_group):
response = self.client.applications.begin_refresh_permissions(
resource_group_name=resource_group.name,
application_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations_async.py
index 09516a6daa1c..6508fc500142 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_applications_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_applications_get(self, resource_group):
response = await self.client.applications.get(
resource_group_name=resource_group.name,
application_name="str",
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_applications_begin_delete(self, resource_group):
response = await (
await self.client.applications.begin_delete(
resource_group_name=resource_group.name,
@@ -47,7 +47,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_applications_begin_create_or_update(self, resource_group):
response = await (
await self.client.applications.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -111,7 +111,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_applications_update(self, resource_group):
response = await self.client.applications.update(
resource_group_name=resource_group.name,
application_name="str",
@@ -123,7 +123,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_applications_list_by_resource_group(self, resource_group):
response = self.client.applications.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
@@ -134,7 +134,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_applications_list_by_subscription(self, resource_group):
response = self.client.applications.list_by_subscription(
api_version="2019-07-01",
)
@@ -144,7 +144,7 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_id(self, resource_group):
+ async def test_applications_get_by_id(self, resource_group):
response = await self.client.applications.get_by_id(
application_id="str",
api_version="2019-07-01",
@@ -155,7 +155,7 @@ async def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_by_id(self, resource_group):
+ async def test_applications_begin_delete_by_id(self, resource_group):
response = await (
await self.client.applications.begin_delete_by_id(
application_id="str",
@@ -168,7 +168,7 @@ async def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_by_id(self, resource_group):
+ async def test_applications_begin_create_or_update_by_id(self, resource_group):
response = await (
await self.client.applications.begin_create_or_update_by_id(
application_id="str",
@@ -231,7 +231,7 @@ async def test_begin_create_or_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update_by_id(self, resource_group):
+ async def test_applications_update_by_id(self, resource_group):
response = await self.client.applications.update_by_id(
application_id="str",
api_version="2019-07-01",
@@ -242,7 +242,7 @@ async def test_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_refresh_permissions(self, resource_group):
+ async def test_applications_begin_refresh_permissions(self, resource_group):
response = await (
await self.client.applications.begin_refresh_permissions(
resource_group_name=resource_group.name,
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations.py
index c0ded9a8e10e..d9f3fcf92218 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_jit_requests_get(self, resource_group):
response = self.client.jit_requests.get(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_jit_requests_begin_create_or_update(self, resource_group):
response = self.client.jit_requests.begin_create_or_update(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -63,7 +63,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_jit_requests_update(self, resource_group):
response = self.client.jit_requests.update(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -76,7 +76,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_jit_requests_delete(self, resource_group):
response = self.client.jit_requests.delete(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -88,7 +88,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_jit_requests_list_by_subscription(self, resource_group):
response = self.client.jit_requests.list_by_subscription(
api_version="2019-07-01",
)
@@ -98,7 +98,7 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_jit_requests_list_by_resource_group(self, resource_group):
response = self.client.jit_requests.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations_async.py
index 1a865afd86c0..f026d2c30f9b 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_application_jit_requests_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_jit_requests_get(self, resource_group):
response = await self.client.jit_requests.get(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_jit_requests_begin_create_or_update(self, resource_group):
response = await (
await self.client.jit_requests.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -66,7 +66,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_jit_requests_update(self, resource_group):
response = await self.client.jit_requests.update(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -79,7 +79,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_jit_requests_delete(self, resource_group):
response = await self.client.jit_requests.delete(
resource_group_name=resource_group.name,
jit_request_name="str",
@@ -91,7 +91,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_jit_requests_list_by_subscription(self, resource_group):
response = await self.client.jit_requests.list_by_subscription(
api_version="2019-07-01",
)
@@ -101,7 +101,7 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_jit_requests_list_by_resource_group(self, resource_group):
response = await self.client.jit_requests.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2019-07-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations.py
index b2382bb1b503..68b8bd178d13 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_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_changes_list(self, resource_group):
response = self.client.changes.list(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -34,7 +34,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_changes_get(self, resource_group):
response = self.client.changes.get(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations_async.py
index 6ceee38d7bd2..01ebd0a156f8 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_changes_changes_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_changes_list(self, resource_group):
response = self.client.changes.list(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -35,7 +35,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_changes_get(self, resource_group):
response = await self.client.changes.get(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations.py
index 172f281a159e..2bff02598456 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_put(self, resource_group):
+ def test_data_boundaries_put(self, resource_group):
response = self.client.data_boundaries.put(
default="str",
data_boundary_definition={
@@ -45,7 +45,7 @@ def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_tenant(self, resource_group):
+ def test_data_boundaries_get_tenant(self, resource_group):
response = self.client.data_boundaries.get_tenant(
default="str",
api_version="2024-08-01",
@@ -56,7 +56,7 @@ def test_get_tenant(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_scope(self, resource_group):
+ def test_data_boundaries_get_scope(self, resource_group):
response = self.client.data_boundaries.get_scope(
scope="str",
default="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations_async.py
index 28bb1e87686d..1d8bd7bd2066 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_data_boundary_mgmt_data_boundaries_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_put(self, resource_group):
+ async def test_data_boundaries_put(self, resource_group):
response = await self.client.data_boundaries.put(
default="str",
data_boundary_definition={
@@ -46,7 +46,7 @@ async def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_tenant(self, resource_group):
+ async def test_data_boundaries_get_tenant(self, resource_group):
response = await self.client.data_boundaries.get_tenant(
default="str",
api_version="2024-08-01",
@@ -57,7 +57,7 @@ async def test_get_tenant(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_scope(self, resource_group):
+ async def test_data_boundaries_get_scope(self, resource_group):
response = await self.client.data_boundaries.get_scope(
scope="str",
default="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations.py
index 49b50aeffef5..ce0903ccf6bd 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_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_deployment_scripts_begin_create(self, resource_group):
response = self.client.deployment_scripts.begin_create(
resource_group_name=resource_group.name,
script_name="str",
@@ -81,7 +81,7 @@ def test_begin_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_deployment_scripts_update(self, resource_group):
response = self.client.deployment_scripts.update(
resource_group_name=resource_group.name,
script_name="str",
@@ -93,7 +93,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_deployment_scripts_get(self, resource_group):
response = self.client.deployment_scripts.get(
resource_group_name=resource_group.name,
script_name="str",
@@ -105,7 +105,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_deployment_scripts_delete(self, resource_group):
response = self.client.deployment_scripts.delete(
resource_group_name=resource_group.name,
script_name="str",
@@ -117,7 +117,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_deployment_scripts_list_by_subscription(self, resource_group):
response = self.client.deployment_scripts.list_by_subscription(
api_version="2020-10-01",
)
@@ -127,7 +127,7 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_logs(self, resource_group):
+ def test_deployment_scripts_get_logs(self, resource_group):
response = self.client.deployment_scripts.get_logs(
resource_group_name=resource_group.name,
script_name="str",
@@ -139,7 +139,7 @@ def test_get_logs(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_logs_default(self, resource_group):
+ def test_deployment_scripts_get_logs_default(self, resource_group):
response = self.client.deployment_scripts.get_logs_default(
resource_group_name=resource_group.name,
script_name="str",
@@ -151,7 +151,7 @@ def test_get_logs_default(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_deployment_scripts_list_by_resource_group(self, resource_group):
response = self.client.deployment_scripts.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2020-10-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations_async.py
index 7365d3a305cf..bd5bf8cc3671 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_scripts_deployment_scripts_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_deployment_scripts_begin_create(self, resource_group):
response = await (
await self.client.deployment_scripts.begin_create(
resource_group_name=resource_group.name,
@@ -84,7 +84,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_deployment_scripts_update(self, resource_group):
response = await self.client.deployment_scripts.update(
resource_group_name=resource_group.name,
script_name="str",
@@ -96,7 +96,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_deployment_scripts_get(self, resource_group):
response = await self.client.deployment_scripts.get(
resource_group_name=resource_group.name,
script_name="str",
@@ -108,7 +108,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_deployment_scripts_delete(self, resource_group):
response = await self.client.deployment_scripts.delete(
resource_group_name=resource_group.name,
script_name="str",
@@ -120,7 +120,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_deployment_scripts_list_by_subscription(self, resource_group):
response = self.client.deployment_scripts.list_by_subscription(
api_version="2020-10-01",
)
@@ -130,7 +130,7 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_logs(self, resource_group):
+ async def test_deployment_scripts_get_logs(self, resource_group):
response = await self.client.deployment_scripts.get_logs(
resource_group_name=resource_group.name,
script_name="str",
@@ -142,7 +142,7 @@ async def test_get_logs(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_logs_default(self, resource_group):
+ async def test_deployment_scripts_get_logs_default(self, resource_group):
response = await self.client.deployment_scripts.get_logs_default(
resource_group_name=resource_group.name,
script_name="str",
@@ -154,7 +154,7 @@ async def test_get_logs_default(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_deployment_scripts_list_by_resource_group(self, resource_group):
response = self.client.deployment_scripts.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2020-10-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations.py
index a3bc4551fe19..b16f9c73d480 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_resource_group(self, resource_group):
+ def test_deployment_stacks_list_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.list_at_resource_group(
resource_group_name=resource_group.name,
api_version="2022-08-01-preview",
@@ -31,7 +31,7 @@ def test_list_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_subscription(self, resource_group):
+ def test_deployment_stacks_list_at_subscription(self, resource_group):
response = self.client.deployment_stacks.list_at_subscription(
api_version="2022-08-01-preview",
)
@@ -41,7 +41,7 @@ def test_list_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_management_group(self, resource_group):
+ def test_deployment_stacks_list_at_management_group(self, resource_group):
response = self.client.deployment_stacks.list_at_management_group(
management_group_id="str",
api_version="2022-08-01-preview",
@@ -52,7 +52,7 @@ def test_list_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_resource_group(self, resource_group):
+ def test_deployment_stacks_begin_create_or_update_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.begin_create_or_update_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -129,7 +129,7 @@ def test_begin_create_or_update_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_resource_group(self, resource_group):
+ def test_deployment_stacks_get_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.get_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -141,7 +141,7 @@ def test_get_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_resource_group(self, resource_group):
+ def test_deployment_stacks_begin_delete_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.begin_delete_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -153,7 +153,7 @@ def test_begin_delete_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_subscription(self, resource_group):
+ def test_deployment_stacks_begin_create_or_update_at_subscription(self, resource_group):
response = self.client.deployment_stacks.begin_create_or_update_at_subscription(
deployment_stack_name="str",
deployment_stack={
@@ -229,7 +229,7 @@ def test_begin_create_or_update_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_subscription(self, resource_group):
+ def test_deployment_stacks_get_at_subscription(self, resource_group):
response = self.client.deployment_stacks.get_at_subscription(
deployment_stack_name="str",
api_version="2022-08-01-preview",
@@ -240,7 +240,7 @@ def test_get_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_subscription(self, resource_group):
+ def test_deployment_stacks_begin_delete_at_subscription(self, resource_group):
response = self.client.deployment_stacks.begin_delete_at_subscription(
deployment_stack_name="str",
api_version="2022-08-01-preview",
@@ -251,7 +251,7 @@ def test_begin_delete_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_management_group(self, resource_group):
+ def test_deployment_stacks_begin_create_or_update_at_management_group(self, resource_group):
response = self.client.deployment_stacks.begin_create_or_update_at_management_group(
management_group_id="str",
deployment_stack_name="str",
@@ -328,7 +328,7 @@ def test_begin_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group(self, resource_group):
+ def test_deployment_stacks_get_at_management_group(self, resource_group):
response = self.client.deployment_stacks.get_at_management_group(
management_group_id="str",
deployment_stack_name="str",
@@ -340,7 +340,7 @@ def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_management_group(self, resource_group):
+ def test_deployment_stacks_begin_delete_at_management_group(self, resource_group):
response = self.client.deployment_stacks.begin_delete_at_management_group(
management_group_id="str",
deployment_stack_name="str",
@@ -352,7 +352,7 @@ def test_begin_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_resource_group(self, resource_group):
+ def test_deployment_stacks_export_template_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.export_template_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -364,7 +364,7 @@ def test_export_template_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_subscription(self, resource_group):
+ def test_deployment_stacks_export_template_at_subscription(self, resource_group):
response = self.client.deployment_stacks.export_template_at_subscription(
deployment_stack_name="str",
api_version="2022-08-01-preview",
@@ -375,7 +375,7 @@ def test_export_template_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_management_group(self, resource_group):
+ def test_deployment_stacks_export_template_at_management_group(self, resource_group):
response = self.client.deployment_stacks.export_template_at_management_group(
management_group_id="str",
deployment_stack_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations_async.py
index cb2d476591a8..c659531daa4e 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_deployment_stacks_deployment_stacks_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_resource_group(self, resource_group):
+ async def test_deployment_stacks_list_at_resource_group(self, resource_group):
response = self.client.deployment_stacks.list_at_resource_group(
resource_group_name=resource_group.name,
api_version="2022-08-01-preview",
@@ -32,7 +32,7 @@ async def test_list_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_subscription(self, resource_group):
+ async def test_deployment_stacks_list_at_subscription(self, resource_group):
response = self.client.deployment_stacks.list_at_subscription(
api_version="2022-08-01-preview",
)
@@ -42,7 +42,7 @@ async def test_list_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_management_group(self, resource_group):
+ async def test_deployment_stacks_list_at_management_group(self, resource_group):
response = self.client.deployment_stacks.list_at_management_group(
management_group_id="str",
api_version="2022-08-01-preview",
@@ -53,7 +53,7 @@ async def test_list_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_resource_group(self, resource_group):
+ async def test_deployment_stacks_begin_create_or_update_at_resource_group(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_create_or_update_at_resource_group(
resource_group_name=resource_group.name,
@@ -132,7 +132,7 @@ async def test_begin_create_or_update_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_resource_group(self, resource_group):
+ async def test_deployment_stacks_get_at_resource_group(self, resource_group):
response = await self.client.deployment_stacks.get_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -144,7 +144,7 @@ async def test_get_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_resource_group(self, resource_group):
+ async def test_deployment_stacks_begin_delete_at_resource_group(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_delete_at_resource_group(
resource_group_name=resource_group.name,
@@ -158,7 +158,7 @@ async def test_begin_delete_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_subscription(self, resource_group):
+ async def test_deployment_stacks_begin_create_or_update_at_subscription(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_create_or_update_at_subscription(
deployment_stack_name="str",
@@ -236,7 +236,7 @@ async def test_begin_create_or_update_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_subscription(self, resource_group):
+ async def test_deployment_stacks_get_at_subscription(self, resource_group):
response = await self.client.deployment_stacks.get_at_subscription(
deployment_stack_name="str",
api_version="2022-08-01-preview",
@@ -247,7 +247,7 @@ async def test_get_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_subscription(self, resource_group):
+ async def test_deployment_stacks_begin_delete_at_subscription(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_delete_at_subscription(
deployment_stack_name="str",
@@ -260,7 +260,7 @@ async def test_begin_delete_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_management_group(self, resource_group):
+ async def test_deployment_stacks_begin_create_or_update_at_management_group(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_create_or_update_at_management_group(
management_group_id="str",
@@ -339,7 +339,7 @@ async def test_begin_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group(self, resource_group):
+ async def test_deployment_stacks_get_at_management_group(self, resource_group):
response = await self.client.deployment_stacks.get_at_management_group(
management_group_id="str",
deployment_stack_name="str",
@@ -351,7 +351,7 @@ async def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_management_group(self, resource_group):
+ async def test_deployment_stacks_begin_delete_at_management_group(self, resource_group):
response = await (
await self.client.deployment_stacks.begin_delete_at_management_group(
management_group_id="str",
@@ -365,7 +365,7 @@ async def test_begin_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_resource_group(self, resource_group):
+ async def test_deployment_stacks_export_template_at_resource_group(self, resource_group):
response = await self.client.deployment_stacks.export_template_at_resource_group(
resource_group_name=resource_group.name,
deployment_stack_name="str",
@@ -377,7 +377,7 @@ async def test_export_template_at_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_subscription(self, resource_group):
+ async def test_deployment_stacks_export_template_at_subscription(self, resource_group):
response = await self.client.deployment_stacks.export_template_at_subscription(
deployment_stack_name="str",
api_version="2022-08-01-preview",
@@ -388,7 +388,7 @@ async def test_export_template_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_management_group(self, resource_group):
+ async def test_deployment_stacks_export_template_at_management_group(self, resource_group):
response = await self.client.deployment_stacks.export_template_at_management_group(
management_group_id="str",
deployment_stack_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations.py
index e2d5e0d98ae5..593fb2cfecce 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all(self, resource_group):
+ def test_features_list_all(self, resource_group):
response = self.client.features.list_all(
api_version="2021-07-01",
)
@@ -30,7 +30,7 @@ def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_features_list(self, resource_group):
response = self.client.features.list(
resource_provider_namespace="str",
api_version="2021-07-01",
@@ -41,7 +41,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_features_get(self, resource_group):
response = self.client.features.get(
resource_provider_namespace="str",
feature_name="str",
@@ -53,7 +53,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_register(self, resource_group):
+ def test_features_register(self, resource_group):
response = self.client.features.register(
resource_provider_namespace="str",
feature_name="str",
@@ -65,7 +65,7 @@ def test_register(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_unregister(self, resource_group):
+ def test_features_unregister(self, resource_group):
response = self.client.features.unregister(
resource_provider_namespace="str",
feature_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations_async.py
index f70977df99f6..c6d8655c769b 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_features_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all(self, resource_group):
+ async def test_features_list_all(self, resource_group):
response = self.client.features.list_all(
api_version="2021-07-01",
)
@@ -31,7 +31,7 @@ async def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_features_list(self, resource_group):
response = self.client.features.list(
resource_provider_namespace="str",
api_version="2021-07-01",
@@ -42,7 +42,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_features_get(self, resource_group):
response = await self.client.features.get(
resource_provider_namespace="str",
feature_name="str",
@@ -54,7 +54,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_register(self, resource_group):
+ async def test_features_register(self, resource_group):
response = await self.client.features.register(
resource_provider_namespace="str",
feature_name="str",
@@ -66,7 +66,7 @@ async def test_register(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_unregister(self, resource_group):
+ async def test_features_unregister(self, resource_group):
response = await self.client.features.unregister(
resource_provider_namespace="str",
feature_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations.py
index 1fe733388ad4..cf24bbe7736c 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_subscription_feature_registrations_get(self, resource_group):
response = self.client.subscription_feature_registrations.get(
provider_namespace="str",
feature_name="str",
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_subscription_feature_registrations_create_or_update(self, resource_group):
response = self.client.subscription_feature_registrations.create_or_update(
provider_namespace="str",
feature_name="str",
@@ -44,7 +44,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_subscription_feature_registrations_delete(self, resource_group):
response = self.client.subscription_feature_registrations.delete(
provider_namespace="str",
feature_name="str",
@@ -56,7 +56,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_subscription_feature_registrations_list_by_subscription(self, resource_group):
response = self.client.subscription_feature_registrations.list_by_subscription(
provider_namespace="str",
api_version="2021-07-01",
@@ -67,7 +67,7 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all_by_subscription(self, resource_group):
+ def test_subscription_feature_registrations_list_all_by_subscription(self, resource_group):
response = self.client.subscription_feature_registrations.list_all_by_subscription(
api_version="2021-07-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations_async.py
index 421ce2170fd3..643d6de62265 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_feature_subscription_feature_registrations_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_subscription_feature_registrations_get(self, resource_group):
response = await self.client.subscription_feature_registrations.get(
provider_namespace="str",
feature_name="str",
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_subscription_feature_registrations_create_or_update(self, resource_group):
response = await self.client.subscription_feature_registrations.create_or_update(
provider_namespace="str",
feature_name="str",
@@ -45,7 +45,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_subscription_feature_registrations_delete(self, resource_group):
response = await self.client.subscription_feature_registrations.delete(
provider_namespace="str",
feature_name="str",
@@ -57,7 +57,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_subscription_feature_registrations_list_by_subscription(self, resource_group):
response = self.client.subscription_feature_registrations.list_by_subscription(
provider_namespace="str",
api_version="2021-07-01",
@@ -68,7 +68,7 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all_by_subscription(self, resource_group):
+ async def test_subscription_feature_registrations_list_all_by_subscription(self, resource_group):
response = self.client.subscription_feature_registrations.list_all_by_subscription(
api_version="2021-07-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations.py
index 37553e7032dd..515219c697df 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_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="2016-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations_async.py
index 3f264a52fb92..3b7630b39849 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_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="2016-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations.py
index 88cafe404960..4a6266f4c8c5 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_resource_links_delete(self, resource_group):
response = self.client.resource_links.delete(
link_id="str",
api_version="2016-09-01",
@@ -31,7 +31,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_resource_links_create_or_update(self, resource_group):
response = self.client.resource_links.create_or_update(
link_id="str",
parameters={
@@ -48,7 +48,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_resource_links_get(self, resource_group):
response = self.client.resource_links.get(
link_id="str",
api_version="2016-09-01",
@@ -59,7 +59,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_subscription(self, resource_group):
+ def test_resource_links_list_at_subscription(self, resource_group):
response = self.client.resource_links.list_at_subscription(
api_version="2016-09-01",
)
@@ -69,7 +69,7 @@ def test_list_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_source_scope(self, resource_group):
+ def test_resource_links_list_at_source_scope(self, resource_group):
response = self.client.resource_links.list_at_source_scope(
scope="str",
api_version="2016-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations_async.py
index 31e2e19d4ac4..e70b34cd517c 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_link_resource_links_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_resource_links_delete(self, resource_group):
response = await self.client.resource_links.delete(
link_id="str",
api_version="2016-09-01",
@@ -32,7 +32,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_resource_links_create_or_update(self, resource_group):
response = await self.client.resource_links.create_or_update(
link_id="str",
parameters={
@@ -49,7 +49,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_resource_links_get(self, resource_group):
response = await self.client.resource_links.get(
link_id="str",
api_version="2016-09-01",
@@ -60,7 +60,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_subscription(self, resource_group):
+ async def test_resource_links_list_at_subscription(self, resource_group):
response = self.client.resource_links.list_at_subscription(
api_version="2016-09-01",
)
@@ -70,7 +70,7 @@ async def test_list_at_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_source_scope(self, resource_group):
+ async def test_resource_links_list_at_source_scope(self, resource_group):
response = self.client.resource_links.list_at_source_scope(
scope="str",
api_version="2016-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations.py
index b9bc1c7a747d..87a1681def0c 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_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_authorization_operations_list(self, resource_group):
response = self.client.authorization_operations.list(
api_version="2016-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations_async.py
index 3b56fabf0f6e..0a88b65b47a6 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_authorization_operations_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_authorization_operations_list(self, resource_group):
response = self.client.authorization_operations.list(
api_version="2016-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations.py
index beacc861a061..fb5c3335cd6d 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_resource_group_level(self, resource_group):
+ def test_management_locks_create_or_update_at_resource_group_level(self, resource_group):
response = self.client.management_locks.create_or_update_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -40,7 +40,7 @@ def test_create_or_update_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_resource_group_level(self, resource_group):
+ def test_management_locks_delete_at_resource_group_level(self, resource_group):
response = self.client.management_locks.delete_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -52,7 +52,7 @@ def test_delete_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_resource_group_level(self, resource_group):
+ def test_management_locks_get_at_resource_group_level(self, resource_group):
response = self.client.management_locks.get_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -64,7 +64,7 @@ def test_get_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_by_scope(self, resource_group):
+ def test_management_locks_create_or_update_by_scope(self, resource_group):
response = self.client.management_locks.create_or_update_by_scope(
scope="str",
lock_name="str",
@@ -84,7 +84,7 @@ def test_create_or_update_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_by_scope(self, resource_group):
+ def test_management_locks_delete_by_scope(self, resource_group):
response = self.client.management_locks.delete_by_scope(
scope="str",
lock_name="str",
@@ -96,7 +96,7 @@ def test_delete_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_scope(self, resource_group):
+ def test_management_locks_get_by_scope(self, resource_group):
response = self.client.management_locks.get_by_scope(
scope="str",
lock_name="str",
@@ -108,7 +108,7 @@ def test_get_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_resource_level(self, resource_group):
+ def test_management_locks_create_or_update_at_resource_level(self, resource_group):
response = self.client.management_locks.create_or_update_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -132,7 +132,7 @@ def test_create_or_update_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_resource_level(self, resource_group):
+ def test_management_locks_delete_at_resource_level(self, resource_group):
response = self.client.management_locks.delete_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -148,7 +148,7 @@ def test_delete_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_resource_level(self, resource_group):
+ def test_management_locks_get_at_resource_level(self, resource_group):
response = self.client.management_locks.get_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -164,7 +164,7 @@ def test_get_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_subscription_level(self, resource_group):
+ def test_management_locks_create_or_update_at_subscription_level(self, resource_group):
response = self.client.management_locks.create_or_update_at_subscription_level(
lock_name="str",
parameters={
@@ -183,7 +183,7 @@ def test_create_or_update_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_subscription_level(self, resource_group):
+ def test_management_locks_delete_at_subscription_level(self, resource_group):
response = self.client.management_locks.delete_at_subscription_level(
lock_name="str",
api_version="2016-09-01",
@@ -194,7 +194,7 @@ def test_delete_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_subscription_level(self, resource_group):
+ def test_management_locks_get_at_subscription_level(self, resource_group):
response = self.client.management_locks.get_at_subscription_level(
lock_name="str",
api_version="2016-09-01",
@@ -205,7 +205,7 @@ def test_get_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_resource_group_level(self, resource_group):
+ def test_management_locks_list_at_resource_group_level(self, resource_group):
response = self.client.management_locks.list_at_resource_group_level(
resource_group_name=resource_group.name,
api_version="2016-09-01",
@@ -216,7 +216,7 @@ def test_list_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_resource_level(self, resource_group):
+ def test_management_locks_list_at_resource_level(self, resource_group):
response = self.client.management_locks.list_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -231,7 +231,7 @@ def test_list_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_subscription_level(self, resource_group):
+ def test_management_locks_list_at_subscription_level(self, resource_group):
response = self.client.management_locks.list_at_subscription_level(
api_version="2016-09-01",
)
@@ -241,7 +241,7 @@ def test_list_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_scope(self, resource_group):
+ def test_management_locks_list_by_scope(self, resource_group):
response = self.client.management_locks.list_by_scope(
scope="str",
api_version="2016-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations_async.py
index 7d4454d56e29..0488d5a8e6e2 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_management_lock_management_locks_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_resource_group_level(self, resource_group):
+ async def test_management_locks_create_or_update_at_resource_group_level(self, resource_group):
response = await self.client.management_locks.create_or_update_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -41,7 +41,7 @@ async def test_create_or_update_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_resource_group_level(self, resource_group):
+ async def test_management_locks_delete_at_resource_group_level(self, resource_group):
response = await self.client.management_locks.delete_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -53,7 +53,7 @@ async def test_delete_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_resource_group_level(self, resource_group):
+ async def test_management_locks_get_at_resource_group_level(self, resource_group):
response = await self.client.management_locks.get_at_resource_group_level(
resource_group_name=resource_group.name,
lock_name="str",
@@ -65,7 +65,7 @@ async def test_get_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_by_scope(self, resource_group):
+ async def test_management_locks_create_or_update_by_scope(self, resource_group):
response = await self.client.management_locks.create_or_update_by_scope(
scope="str",
lock_name="str",
@@ -85,7 +85,7 @@ async def test_create_or_update_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_by_scope(self, resource_group):
+ async def test_management_locks_delete_by_scope(self, resource_group):
response = await self.client.management_locks.delete_by_scope(
scope="str",
lock_name="str",
@@ -97,7 +97,7 @@ async def test_delete_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_scope(self, resource_group):
+ async def test_management_locks_get_by_scope(self, resource_group):
response = await self.client.management_locks.get_by_scope(
scope="str",
lock_name="str",
@@ -109,7 +109,7 @@ async def test_get_by_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_resource_level(self, resource_group):
+ async def test_management_locks_create_or_update_at_resource_level(self, resource_group):
response = await self.client.management_locks.create_or_update_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -133,7 +133,7 @@ async def test_create_or_update_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_resource_level(self, resource_group):
+ async def test_management_locks_delete_at_resource_level(self, resource_group):
response = await self.client.management_locks.delete_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -149,7 +149,7 @@ async def test_delete_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_resource_level(self, resource_group):
+ async def test_management_locks_get_at_resource_level(self, resource_group):
response = await self.client.management_locks.get_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -165,7 +165,7 @@ async def test_get_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_subscription_level(self, resource_group):
+ async def test_management_locks_create_or_update_at_subscription_level(self, resource_group):
response = await self.client.management_locks.create_or_update_at_subscription_level(
lock_name="str",
parameters={
@@ -184,7 +184,7 @@ async def test_create_or_update_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_subscription_level(self, resource_group):
+ async def test_management_locks_delete_at_subscription_level(self, resource_group):
response = await self.client.management_locks.delete_at_subscription_level(
lock_name="str",
api_version="2016-09-01",
@@ -195,7 +195,7 @@ async def test_delete_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_subscription_level(self, resource_group):
+ async def test_management_locks_get_at_subscription_level(self, resource_group):
response = await self.client.management_locks.get_at_subscription_level(
lock_name="str",
api_version="2016-09-01",
@@ -206,7 +206,7 @@ async def test_get_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_resource_group_level(self, resource_group):
+ async def test_management_locks_list_at_resource_group_level(self, resource_group):
response = self.client.management_locks.list_at_resource_group_level(
resource_group_name=resource_group.name,
api_version="2016-09-01",
@@ -217,7 +217,7 @@ async def test_list_at_resource_group_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_resource_level(self, resource_group):
+ async def test_management_locks_list_at_resource_level(self, resource_group):
response = self.client.management_locks.list_at_resource_level(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -232,7 +232,7 @@ async def test_list_at_resource_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_subscription_level(self, resource_group):
+ async def test_management_locks_list_at_subscription_level(self, resource_group):
response = self.client.management_locks.list_at_subscription_level(
api_version="2016-09-01",
)
@@ -242,7 +242,7 @@ async def test_list_at_subscription_level(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_scope(self, resource_group):
+ async def test_management_locks_list_by_scope(self, resource_group):
response = self.client.management_locks.list_by_scope(
scope="str",
api_version="2016-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations.py
index 828d7520219c..f70cf20ed221 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_policy_assignments_delete(self, resource_group):
response = self.client.policy_assignments.delete(
scope="str",
policy_assignment_name="str",
@@ -32,7 +32,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_policy_assignments_create(self, resource_group):
response = self.client.policy_assignments.create(
scope="str",
policy_assignment_name="str",
@@ -77,7 +77,7 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_policy_assignments_get(self, resource_group):
response = self.client.policy_assignments.get(
scope="str",
policy_assignment_name="str",
@@ -89,7 +89,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_policy_assignments_update(self, resource_group):
response = self.client.policy_assignments.update(
scope="str",
policy_assignment_name="str",
@@ -114,7 +114,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_for_resource_group(self, resource_group):
+ def test_policy_assignments_list_for_resource_group(self, resource_group):
response = self.client.policy_assignments.list_for_resource_group(
resource_group_name=resource_group.name,
api_version="2022-06-01",
@@ -125,7 +125,7 @@ def test_list_for_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_for_resource(self, resource_group):
+ def test_policy_assignments_list_for_resource(self, resource_group):
response = self.client.policy_assignments.list_for_resource(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -140,7 +140,7 @@ def test_list_for_resource(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_for_management_group(self, resource_group):
+ def test_policy_assignments_list_for_management_group(self, resource_group):
response = self.client.policy_assignments.list_for_management_group(
management_group_id="str",
api_version="2022-06-01",
@@ -151,7 +151,7 @@ def test_list_for_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_policy_assignments_list(self, resource_group):
response = self.client.policy_assignments.list(
api_version="2022-06-01",
)
@@ -161,7 +161,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_by_id(self, resource_group):
+ def test_policy_assignments_delete_by_id(self, resource_group):
response = self.client.policy_assignments.delete_by_id(
policy_assignment_id="str",
api_version="2022-06-01",
@@ -172,7 +172,7 @@ def test_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_by_id(self, resource_group):
+ def test_policy_assignments_create_by_id(self, resource_group):
response = self.client.policy_assignments.create_by_id(
policy_assignment_id="str",
parameters={
@@ -216,7 +216,7 @@ def test_create_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_id(self, resource_group):
+ def test_policy_assignments_get_by_id(self, resource_group):
response = self.client.policy_assignments.get_by_id(
policy_assignment_id="str",
api_version="2022-06-01",
@@ -227,7 +227,7 @@ def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update_by_id(self, resource_group):
+ def test_policy_assignments_update_by_id(self, resource_group):
response = self.client.policy_assignments.update_by_id(
policy_assignment_id="str",
parameters={
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations_async.py
index 9b1498d784c3..4d7e10abef85 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_assignments_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_policy_assignments_delete(self, resource_group):
response = await self.client.policy_assignments.delete(
scope="str",
policy_assignment_name="str",
@@ -33,7 +33,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_policy_assignments_create(self, resource_group):
response = await self.client.policy_assignments.create(
scope="str",
policy_assignment_name="str",
@@ -78,7 +78,7 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_policy_assignments_get(self, resource_group):
response = await self.client.policy_assignments.get(
scope="str",
policy_assignment_name="str",
@@ -90,7 +90,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_policy_assignments_update(self, resource_group):
response = await self.client.policy_assignments.update(
scope="str",
policy_assignment_name="str",
@@ -115,7 +115,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_for_resource_group(self, resource_group):
+ async def test_policy_assignments_list_for_resource_group(self, resource_group):
response = self.client.policy_assignments.list_for_resource_group(
resource_group_name=resource_group.name,
api_version="2022-06-01",
@@ -126,7 +126,7 @@ async def test_list_for_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_for_resource(self, resource_group):
+ async def test_policy_assignments_list_for_resource(self, resource_group):
response = self.client.policy_assignments.list_for_resource(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -141,7 +141,7 @@ async def test_list_for_resource(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_for_management_group(self, resource_group):
+ async def test_policy_assignments_list_for_management_group(self, resource_group):
response = self.client.policy_assignments.list_for_management_group(
management_group_id="str",
api_version="2022-06-01",
@@ -152,7 +152,7 @@ async def test_list_for_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_policy_assignments_list(self, resource_group):
response = self.client.policy_assignments.list(
api_version="2022-06-01",
)
@@ -162,7 +162,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_by_id(self, resource_group):
+ async def test_policy_assignments_delete_by_id(self, resource_group):
response = await self.client.policy_assignments.delete_by_id(
policy_assignment_id="str",
api_version="2022-06-01",
@@ -173,7 +173,7 @@ async def test_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_by_id(self, resource_group):
+ async def test_policy_assignments_create_by_id(self, resource_group):
response = await self.client.policy_assignments.create_by_id(
policy_assignment_id="str",
parameters={
@@ -217,7 +217,7 @@ async def test_create_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_id(self, resource_group):
+ async def test_policy_assignments_get_by_id(self, resource_group):
response = await self.client.policy_assignments.get_by_id(
policy_assignment_id="str",
api_version="2022-06-01",
@@ -228,7 +228,7 @@ async def test_get_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update_by_id(self, resource_group):
+ async def test_policy_assignments_update_by_id(self, resource_group):
response = await self.client.policy_assignments.update_by_id(
policy_assignment_id="str",
parameters={
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations.py
index 42c6500a584c..fd06581987fb 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all_builtins(self, resource_group):
+ def test_policy_definition_versions_list_all_builtins(self, resource_group):
response = self.client.policy_definition_versions.list_all_builtins(
api_version="2023-04-01",
)
@@ -30,7 +30,7 @@ def test_list_all_builtins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all_at_management_group(self, resource_group):
+ def test_policy_definition_versions_list_all_at_management_group(self, resource_group):
response = self.client.policy_definition_versions.list_all_at_management_group(
management_group_name="str",
api_version="2023-04-01",
@@ -41,7 +41,7 @@ def test_list_all_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all(self, resource_group):
+ def test_policy_definition_versions_list_all(self, resource_group):
response = self.client.policy_definition_versions.list_all(
api_version="2023-04-01",
)
@@ -51,7 +51,7 @@ def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_policy_definition_versions_create_or_update(self, resource_group):
response = self.client.policy_definition_versions.create_or_update(
policy_definition_name="str",
policy_definition_version="str",
@@ -97,7 +97,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_policy_definition_versions_delete(self, resource_group):
response = self.client.policy_definition_versions.delete(
policy_definition_name="str",
policy_definition_version="str",
@@ -109,7 +109,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_policy_definition_versions_get(self, resource_group):
response = self.client.policy_definition_versions.get(
policy_definition_name="str",
policy_definition_version="str",
@@ -121,7 +121,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_policy_definition_versions_get_built_in(self, resource_group):
response = self.client.policy_definition_versions.get_built_in(
policy_definition_name="str",
policy_definition_version="str",
@@ -133,7 +133,7 @@ def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_management_group(self, resource_group):
+ def test_policy_definition_versions_create_or_update_at_management_group(self, resource_group):
response = self.client.policy_definition_versions.create_or_update_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -180,7 +180,7 @@ def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_management_group(self, resource_group):
+ def test_policy_definition_versions_delete_at_management_group(self, resource_group):
response = self.client.policy_definition_versions.delete_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -193,7 +193,7 @@ def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group(self, resource_group):
+ def test_policy_definition_versions_get_at_management_group(self, resource_group):
response = self.client.policy_definition_versions.get_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -206,7 +206,7 @@ def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_policy_definition_versions_list(self, resource_group):
response = self.client.policy_definition_versions.list(
policy_definition_name="str",
api_version="2023-04-01",
@@ -217,7 +217,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_in(self, resource_group):
+ def test_policy_definition_versions_list_built_in(self, resource_group):
response = self.client.policy_definition_versions.list_built_in(
policy_definition_name="str",
api_version="2023-04-01",
@@ -228,7 +228,7 @@ def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_management_group(self, resource_group):
+ def test_policy_definition_versions_list_by_management_group(self, resource_group):
response = self.client.policy_definition_versions.list_by_management_group(
management_group_name="str",
policy_definition_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations_async.py
index cee0d2c5ffb2..6196fb58b2f3 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definition_versions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all_builtins(self, resource_group):
+ async def test_policy_definition_versions_list_all_builtins(self, resource_group):
response = await self.client.policy_definition_versions.list_all_builtins(
api_version="2023-04-01",
)
@@ -31,7 +31,7 @@ async def test_list_all_builtins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all_at_management_group(self, resource_group):
+ async def test_policy_definition_versions_list_all_at_management_group(self, resource_group):
response = await self.client.policy_definition_versions.list_all_at_management_group(
management_group_name="str",
api_version="2023-04-01",
@@ -42,7 +42,7 @@ async def test_list_all_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all(self, resource_group):
+ async def test_policy_definition_versions_list_all(self, resource_group):
response = await self.client.policy_definition_versions.list_all(
api_version="2023-04-01",
)
@@ -52,7 +52,7 @@ async def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_policy_definition_versions_create_or_update(self, resource_group):
response = await self.client.policy_definition_versions.create_or_update(
policy_definition_name="str",
policy_definition_version="str",
@@ -98,7 +98,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_policy_definition_versions_delete(self, resource_group):
response = await self.client.policy_definition_versions.delete(
policy_definition_name="str",
policy_definition_version="str",
@@ -110,7 +110,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_policy_definition_versions_get(self, resource_group):
response = await self.client.policy_definition_versions.get(
policy_definition_name="str",
policy_definition_version="str",
@@ -122,7 +122,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_policy_definition_versions_get_built_in(self, resource_group):
response = await self.client.policy_definition_versions.get_built_in(
policy_definition_name="str",
policy_definition_version="str",
@@ -134,7 +134,7 @@ async def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_management_group(self, resource_group):
+ async def test_policy_definition_versions_create_or_update_at_management_group(self, resource_group):
response = await self.client.policy_definition_versions.create_or_update_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -181,7 +181,7 @@ async def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_management_group(self, resource_group):
+ async def test_policy_definition_versions_delete_at_management_group(self, resource_group):
response = await self.client.policy_definition_versions.delete_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -194,7 +194,7 @@ async def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group(self, resource_group):
+ async def test_policy_definition_versions_get_at_management_group(self, resource_group):
response = await self.client.policy_definition_versions.get_at_management_group(
management_group_name="str",
policy_definition_name="str",
@@ -207,7 +207,7 @@ async def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_policy_definition_versions_list(self, resource_group):
response = self.client.policy_definition_versions.list(
policy_definition_name="str",
api_version="2023-04-01",
@@ -218,7 +218,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_in(self, resource_group):
+ async def test_policy_definition_versions_list_built_in(self, resource_group):
response = self.client.policy_definition_versions.list_built_in(
policy_definition_name="str",
api_version="2023-04-01",
@@ -229,7 +229,7 @@ async def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_management_group(self, resource_group):
+ async def test_policy_definition_versions_list_by_management_group(self, resource_group):
response = self.client.policy_definition_versions.list_by_management_group(
management_group_name="str",
policy_definition_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations.py
index 1a9660c062fb..568f2310564f 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_policy_definitions_create_or_update(self, resource_group):
response = self.client.policy_definitions.create_or_update(
policy_definition_name="str",
parameters={
@@ -66,7 +66,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_policy_definitions_delete(self, resource_group):
response = self.client.policy_definitions.delete(
policy_definition_name="str",
api_version="2023-04-01",
@@ -77,7 +77,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_policy_definitions_get(self, resource_group):
response = self.client.policy_definitions.get(
policy_definition_name="str",
api_version="2023-04-01",
@@ -88,7 +88,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_policy_definitions_get_built_in(self, resource_group):
response = self.client.policy_definitions.get_built_in(
policy_definition_name="str",
api_version="2023-04-01",
@@ -99,7 +99,7 @@ def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_management_group(self, resource_group):
+ def test_policy_definitions_create_or_update_at_management_group(self, resource_group):
response = self.client.policy_definitions.create_or_update_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -146,7 +146,7 @@ def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_management_group(self, resource_group):
+ def test_policy_definitions_delete_at_management_group(self, resource_group):
response = self.client.policy_definitions.delete_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -158,7 +158,7 @@ def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group(self, resource_group):
+ def test_policy_definitions_get_at_management_group(self, resource_group):
response = self.client.policy_definitions.get_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -170,7 +170,7 @@ def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_policy_definitions_list(self, resource_group):
response = self.client.policy_definitions.list(
api_version="2023-04-01",
)
@@ -180,7 +180,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_in(self, resource_group):
+ def test_policy_definitions_list_built_in(self, resource_group):
response = self.client.policy_definitions.list_built_in(
api_version="2023-04-01",
)
@@ -190,7 +190,7 @@ def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_management_group(self, resource_group):
+ def test_policy_definitions_list_by_management_group(self, resource_group):
response = self.client.policy_definitions.list_by_management_group(
management_group_id="str",
api_version="2023-04-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations_async.py
index eb43842a2ff5..8d1e62af6bb9 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_definitions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_policy_definitions_create_or_update(self, resource_group):
response = await self.client.policy_definitions.create_or_update(
policy_definition_name="str",
parameters={
@@ -67,7 +67,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_policy_definitions_delete(self, resource_group):
response = await self.client.policy_definitions.delete(
policy_definition_name="str",
api_version="2023-04-01",
@@ -78,7 +78,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_policy_definitions_get(self, resource_group):
response = await self.client.policy_definitions.get(
policy_definition_name="str",
api_version="2023-04-01",
@@ -89,7 +89,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_policy_definitions_get_built_in(self, resource_group):
response = await self.client.policy_definitions.get_built_in(
policy_definition_name="str",
api_version="2023-04-01",
@@ -100,7 +100,7 @@ async def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_management_group(self, resource_group):
+ async def test_policy_definitions_create_or_update_at_management_group(self, resource_group):
response = await self.client.policy_definitions.create_or_update_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -147,7 +147,7 @@ async def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_management_group(self, resource_group):
+ async def test_policy_definitions_delete_at_management_group(self, resource_group):
response = await self.client.policy_definitions.delete_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -159,7 +159,7 @@ async def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group(self, resource_group):
+ async def test_policy_definitions_get_at_management_group(self, resource_group):
response = await self.client.policy_definitions.get_at_management_group(
management_group_id="str",
policy_definition_name="str",
@@ -171,7 +171,7 @@ async def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_policy_definitions_list(self, resource_group):
response = self.client.policy_definitions.list(
api_version="2023-04-01",
)
@@ -181,7 +181,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_in(self, resource_group):
+ async def test_policy_definitions_list_built_in(self, resource_group):
response = self.client.policy_definitions.list_built_in(
api_version="2023-04-01",
)
@@ -191,7 +191,7 @@ async def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_management_group(self, resource_group):
+ async def test_policy_definitions_list_by_management_group(self, resource_group):
response = self.client.policy_definitions.list_by_management_group(
management_group_id="str",
api_version="2023-04-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations.py
index 957c6c1252c8..b49a0265910f 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all_builtins(self, resource_group):
+ def test_policy_set_definition_versions_list_all_builtins(self, resource_group):
response = self.client.policy_set_definition_versions.list_all_builtins(
api_version="2023-04-01",
)
@@ -30,7 +30,7 @@ def test_list_all_builtins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all_at_management_group(self, resource_group):
+ def test_policy_set_definition_versions_list_all_at_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.list_all_at_management_group(
management_group_name="str",
api_version="2023-04-01",
@@ -41,7 +41,7 @@ def test_list_all_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_all(self, resource_group):
+ def test_policy_set_definition_versions_list_all(self, resource_group):
response = self.client.policy_set_definition_versions.list_all(
api_version="2023-04-01",
)
@@ -51,7 +51,7 @@ def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_policy_set_definition_versions_create_or_update(self, resource_group):
response = self.client.policy_set_definition_versions.create_or_update(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -88,7 +88,9 @@ def test_create_or_update(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -113,7 +115,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_policy_set_definition_versions_delete(self, resource_group):
response = self.client.policy_set_definition_versions.delete(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -125,7 +127,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_policy_set_definition_versions_get(self, resource_group):
response = self.client.policy_set_definition_versions.get(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -137,7 +139,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_policy_set_definition_versions_get_built_in(self, resource_group):
response = self.client.policy_set_definition_versions.get_built_in(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -149,7 +151,7 @@ def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_policy_set_definition_versions_list(self, resource_group):
response = self.client.policy_set_definition_versions.list(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -160,7 +162,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_in(self, resource_group):
+ def test_policy_set_definition_versions_list_built_in(self, resource_group):
response = self.client.policy_set_definition_versions.list_built_in(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -171,7 +173,7 @@ def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_management_group(self, resource_group):
+ def test_policy_set_definition_versions_create_or_update_at_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.create_or_update_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -209,7 +211,9 @@ def test_create_or_update_at_management_group(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -234,7 +238,7 @@ def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_management_group(self, resource_group):
+ def test_policy_set_definition_versions_delete_at_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.delete_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -247,7 +251,7 @@ def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group(self, resource_group):
+ def test_policy_set_definition_versions_get_at_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.get_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -260,7 +264,7 @@ def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_management_group(self, resource_group):
+ def test_policy_set_definition_versions_list_by_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.list_by_management_group(
management_group_name="str",
policy_set_definition_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations_async.py
index 3ff76f5f5beb..f703d0696f7c 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definition_versions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all_builtins(self, resource_group):
+ async def test_policy_set_definition_versions_list_all_builtins(self, resource_group):
response = await self.client.policy_set_definition_versions.list_all_builtins(
api_version="2023-04-01",
)
@@ -31,7 +31,7 @@ async def test_list_all_builtins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all_at_management_group(self, resource_group):
+ async def test_policy_set_definition_versions_list_all_at_management_group(self, resource_group):
response = await self.client.policy_set_definition_versions.list_all_at_management_group(
management_group_name="str",
api_version="2023-04-01",
@@ -42,7 +42,7 @@ async def test_list_all_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_all(self, resource_group):
+ async def test_policy_set_definition_versions_list_all(self, resource_group):
response = await self.client.policy_set_definition_versions.list_all(
api_version="2023-04-01",
)
@@ -52,7 +52,7 @@ async def test_list_all(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_policy_set_definition_versions_create_or_update(self, resource_group):
response = await self.client.policy_set_definition_versions.create_or_update(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -89,7 +89,9 @@ async def test_create_or_update(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -114,7 +116,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_policy_set_definition_versions_delete(self, resource_group):
response = await self.client.policy_set_definition_versions.delete(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -126,7 +128,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_policy_set_definition_versions_get(self, resource_group):
response = await self.client.policy_set_definition_versions.get(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -138,7 +140,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_policy_set_definition_versions_get_built_in(self, resource_group):
response = await self.client.policy_set_definition_versions.get_built_in(
policy_set_definition_name="str",
policy_definition_version="str",
@@ -150,7 +152,7 @@ async def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_policy_set_definition_versions_list(self, resource_group):
response = self.client.policy_set_definition_versions.list(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -161,7 +163,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_in(self, resource_group):
+ async def test_policy_set_definition_versions_list_built_in(self, resource_group):
response = self.client.policy_set_definition_versions.list_built_in(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -172,7 +174,7 @@ async def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_management_group(self, resource_group):
+ async def test_policy_set_definition_versions_create_or_update_at_management_group(self, resource_group):
response = await self.client.policy_set_definition_versions.create_or_update_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -210,7 +212,9 @@ async def test_create_or_update_at_management_group(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -235,7 +239,7 @@ async def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_management_group(self, resource_group):
+ async def test_policy_set_definition_versions_delete_at_management_group(self, resource_group):
response = await self.client.policy_set_definition_versions.delete_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -248,7 +252,7 @@ async def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group(self, resource_group):
+ async def test_policy_set_definition_versions_get_at_management_group(self, resource_group):
response = await self.client.policy_set_definition_versions.get_at_management_group(
management_group_name="str",
policy_set_definition_name="str",
@@ -261,7 +265,7 @@ async def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_management_group(self, resource_group):
+ async def test_policy_set_definition_versions_list_by_management_group(self, resource_group):
response = self.client.policy_set_definition_versions.list_by_management_group(
management_group_name="str",
policy_set_definition_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations.py
index 72de4dadf0bb..20fa18a1e79a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_policy_set_definitions_create_or_update(self, resource_group):
response = self.client.policy_set_definitions.create_or_update(
policy_set_definition_name="str",
parameters={
@@ -56,7 +56,9 @@ def test_create_or_update(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -82,7 +84,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_policy_set_definitions_delete(self, resource_group):
response = self.client.policy_set_definitions.delete(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -93,7 +95,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_policy_set_definitions_get(self, resource_group):
response = self.client.policy_set_definitions.get(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -104,7 +106,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_policy_set_definitions_get_built_in(self, resource_group):
response = self.client.policy_set_definitions.get_built_in(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -115,7 +117,7 @@ def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_policy_set_definitions_list(self, resource_group):
response = self.client.policy_set_definitions.list(
api_version="2023-04-01",
)
@@ -125,7 +127,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_in(self, resource_group):
+ def test_policy_set_definitions_list_built_in(self, resource_group):
response = self.client.policy_set_definitions.list_built_in(
api_version="2023-04-01",
)
@@ -135,7 +137,7 @@ def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_at_management_group(self, resource_group):
+ def test_policy_set_definitions_create_or_update_at_management_group(self, resource_group):
response = self.client.policy_set_definitions.create_or_update_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -172,7 +174,9 @@ def test_create_or_update_at_management_group(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -198,7 +202,7 @@ def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_at_management_group(self, resource_group):
+ def test_policy_set_definitions_delete_at_management_group(self, resource_group):
response = self.client.policy_set_definitions.delete_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -210,7 +214,7 @@ def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group(self, resource_group):
+ def test_policy_set_definitions_get_at_management_group(self, resource_group):
response = self.client.policy_set_definitions.get_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -222,7 +226,7 @@ def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_management_group(self, resource_group):
+ def test_policy_set_definitions_list_by_management_group(self, resource_group):
response = self.client.policy_set_definitions.list_by_management_group(
management_group_id="str",
api_version="2023-04-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations_async.py
index 2277ee5c873c..0161723fb65a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_policy_policy_set_definitions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_policy_set_definitions_create_or_update(self, resource_group):
response = await self.client.policy_set_definitions.create_or_update(
policy_set_definition_name="str",
parameters={
@@ -57,7 +57,9 @@ async def test_create_or_update(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -83,7 +85,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_policy_set_definitions_delete(self, resource_group):
response = await self.client.policy_set_definitions.delete(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -94,7 +96,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_policy_set_definitions_get(self, resource_group):
response = await self.client.policy_set_definitions.get(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -105,7 +107,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_policy_set_definitions_get_built_in(self, resource_group):
response = await self.client.policy_set_definitions.get_built_in(
policy_set_definition_name="str",
api_version="2023-04-01",
@@ -116,7 +118,7 @@ async def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_policy_set_definitions_list(self, resource_group):
response = self.client.policy_set_definitions.list(
api_version="2023-04-01",
)
@@ -126,7 +128,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_in(self, resource_group):
+ async def test_policy_set_definitions_list_built_in(self, resource_group):
response = self.client.policy_set_definitions.list_built_in(
api_version="2023-04-01",
)
@@ -136,7 +138,7 @@ async def test_list_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_at_management_group(self, resource_group):
+ async def test_policy_set_definitions_create_or_update_at_management_group(self, resource_group):
response = await self.client.policy_set_definitions.create_or_update_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -173,7 +175,9 @@ async def test_create_or_update_at_management_group(self, resource_group):
{
"policyDefinitionId": "str",
"definitionVersion": "str",
+ "effectiveDefinitionVersion": "str",
"groupNames": ["str"],
+ "latestDefinitionVersion": "str",
"parameters": {"str": {"value": {}}},
"policyDefinitionReferenceId": "str",
}
@@ -199,7 +203,7 @@ async def test_create_or_update_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_at_management_group(self, resource_group):
+ async def test_policy_set_definitions_delete_at_management_group(self, resource_group):
response = await self.client.policy_set_definitions.delete_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -211,7 +215,7 @@ async def test_delete_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group(self, resource_group):
+ async def test_policy_set_definitions_get_at_management_group(self, resource_group):
response = await self.client.policy_set_definitions.get_at_management_group(
management_group_id="str",
policy_set_definition_name="str",
@@ -223,7 +227,7 @@ async def test_get_at_management_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_management_group(self, resource_group):
+ async def test_policy_set_definitions_list_by_management_group(self, resource_group):
response = self.client.policy_set_definitions.list_by_management_group(
management_group_id="str",
api_version="2023-04-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations.py
index c1e2eb72abbf..a797cf5851b1 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_scope(self, resource_group):
+ def test_deployment_operations_get_at_scope(self, resource_group):
response = self.client.deployment_operations.get_at_scope(
scope="str",
deployment_name="str",
@@ -33,7 +33,7 @@ def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_scope(self, resource_group):
+ def test_deployment_operations_list_at_scope(self, resource_group):
response = self.client.deployment_operations.list_at_scope(
scope="str",
deployment_name="str",
@@ -45,7 +45,7 @@ def test_list_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_tenant_scope(self, resource_group):
+ def test_deployment_operations_get_at_tenant_scope(self, resource_group):
response = self.client.deployment_operations.get_at_tenant_scope(
deployment_name="str",
operation_id="str",
@@ -57,7 +57,7 @@ def test_get_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_tenant_scope(self, resource_group):
+ def test_deployment_operations_list_at_tenant_scope(self, resource_group):
response = self.client.deployment_operations.list_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -68,7 +68,7 @@ def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group_scope(self, resource_group):
+ def test_deployment_operations_get_at_management_group_scope(self, resource_group):
response = self.client.deployment_operations.get_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -81,7 +81,7 @@ def test_get_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_management_group_scope(self, resource_group):
+ def test_deployment_operations_list_at_management_group_scope(self, resource_group):
response = self.client.deployment_operations.list_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -93,7 +93,7 @@ def test_list_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_subscription_scope(self, resource_group):
+ def test_deployment_operations_get_at_subscription_scope(self, resource_group):
response = self.client.deployment_operations.get_at_subscription_scope(
deployment_name="str",
operation_id="str",
@@ -105,7 +105,7 @@ def test_get_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_subscription_scope(self, resource_group):
+ def test_deployment_operations_list_at_subscription_scope(self, resource_group):
response = self.client.deployment_operations.list_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -116,7 +116,7 @@ def test_list_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_deployment_operations_get(self, resource_group):
response = self.client.deployment_operations.get(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -129,7 +129,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_deployment_operations_list(self, resource_group):
response = self.client.deployment_operations.list(
resource_group_name=resource_group.name,
deployment_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations_async.py
index 18f86873278c..04d8e87402ee 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployment_operations_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_scope(self, resource_group):
+ async def test_deployment_operations_get_at_scope(self, resource_group):
response = await self.client.deployment_operations.get_at_scope(
scope="str",
deployment_name="str",
@@ -34,7 +34,7 @@ async def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_scope(self, resource_group):
+ async def test_deployment_operations_list_at_scope(self, resource_group):
response = self.client.deployment_operations.list_at_scope(
scope="str",
deployment_name="str",
@@ -46,7 +46,7 @@ async def test_list_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_tenant_scope(self, resource_group):
+ async def test_deployment_operations_get_at_tenant_scope(self, resource_group):
response = await self.client.deployment_operations.get_at_tenant_scope(
deployment_name="str",
operation_id="str",
@@ -58,7 +58,7 @@ async def test_get_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_tenant_scope(self, resource_group):
+ async def test_deployment_operations_list_at_tenant_scope(self, resource_group):
response = self.client.deployment_operations.list_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -69,7 +69,7 @@ async def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group_scope(self, resource_group):
+ async def test_deployment_operations_get_at_management_group_scope(self, resource_group):
response = await self.client.deployment_operations.get_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -82,7 +82,7 @@ async def test_get_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_management_group_scope(self, resource_group):
+ async def test_deployment_operations_list_at_management_group_scope(self, resource_group):
response = self.client.deployment_operations.list_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -94,7 +94,7 @@ async def test_list_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_subscription_scope(self, resource_group):
+ async def test_deployment_operations_get_at_subscription_scope(self, resource_group):
response = await self.client.deployment_operations.get_at_subscription_scope(
deployment_name="str",
operation_id="str",
@@ -106,7 +106,7 @@ async def test_get_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_subscription_scope(self, resource_group):
+ async def test_deployment_operations_list_at_subscription_scope(self, resource_group):
response = self.client.deployment_operations.list_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -117,7 +117,7 @@ async def test_list_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_deployment_operations_get(self, resource_group):
response = await self.client.deployment_operations.get(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -130,7 +130,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_deployment_operations_list(self, resource_group):
response = self.client.deployment_operations.list(
resource_group_name=resource_group.name,
deployment_name="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations.py
index 0b99eb133131..d40ca22decf4 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_scope(self, resource_group):
+ def test_deployments_begin_delete_at_scope(self, resource_group):
response = self.client.deployments.begin_delete_at_scope(
scope="str",
deployment_name="str",
@@ -32,7 +32,7 @@ def test_begin_delete_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence_at_scope(self, resource_group):
+ def test_deployments_check_existence_at_scope(self, resource_group):
response = self.client.deployments.check_existence_at_scope(
scope="str",
deployment_name="str",
@@ -44,7 +44,7 @@ def test_check_existence_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_scope(self, resource_group):
+ def test_deployments_begin_create_or_update_at_scope(self, resource_group):
response = self.client.deployments.begin_create_or_update_at_scope(
scope="str",
deployment_name="str",
@@ -81,7 +81,7 @@ def test_begin_create_or_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_scope(self, resource_group):
+ def test_deployments_get_at_scope(self, resource_group):
response = self.client.deployments.get_at_scope(
scope="str",
deployment_name="str",
@@ -93,7 +93,7 @@ def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel_at_scope(self, resource_group):
+ def test_deployments_cancel_at_scope(self, resource_group):
response = self.client.deployments.cancel_at_scope(
scope="str",
deployment_name="str",
@@ -105,7 +105,7 @@ def test_cancel_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate_at_scope(self, resource_group):
+ def test_deployments_begin_validate_at_scope(self, resource_group):
response = self.client.deployments.begin_validate_at_scope(
scope="str",
deployment_name="str",
@@ -142,7 +142,7 @@ def test_begin_validate_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_scope(self, resource_group):
+ def test_deployments_export_template_at_scope(self, resource_group):
response = self.client.deployments.export_template_at_scope(
scope="str",
deployment_name="str",
@@ -154,7 +154,7 @@ def test_export_template_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_scope(self, resource_group):
+ def test_deployments_list_at_scope(self, resource_group):
response = self.client.deployments.list_at_scope(
scope="str",
api_version="2022-09-01",
@@ -165,7 +165,7 @@ def test_list_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_tenant_scope(self, resource_group):
+ def test_deployments_begin_delete_at_tenant_scope(self, resource_group):
response = self.client.deployments.begin_delete_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -176,7 +176,7 @@ def test_begin_delete_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence_at_tenant_scope(self, resource_group):
+ def test_deployments_check_existence_at_tenant_scope(self, resource_group):
response = self.client.deployments.check_existence_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -187,7 +187,7 @@ def test_check_existence_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_tenant_scope(self, resource_group):
+ def test_deployments_begin_create_or_update_at_tenant_scope(self, resource_group):
response = self.client.deployments.begin_create_or_update_at_tenant_scope(
deployment_name="str",
parameters={
@@ -223,7 +223,7 @@ def test_begin_create_or_update_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_tenant_scope(self, resource_group):
+ def test_deployments_get_at_tenant_scope(self, resource_group):
response = self.client.deployments.get_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -234,7 +234,7 @@ def test_get_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel_at_tenant_scope(self, resource_group):
+ def test_deployments_cancel_at_tenant_scope(self, resource_group):
response = self.client.deployments.cancel_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -245,7 +245,7 @@ def test_cancel_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate_at_tenant_scope(self, resource_group):
+ def test_deployments_begin_validate_at_tenant_scope(self, resource_group):
response = self.client.deployments.begin_validate_at_tenant_scope(
deployment_name="str",
parameters={
@@ -281,7 +281,7 @@ def test_begin_validate_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_what_if_at_tenant_scope(self, resource_group):
+ def test_deployments_begin_what_if_at_tenant_scope(self, resource_group):
response = self.client.deployments.begin_what_if_at_tenant_scope(
deployment_name="str",
parameters={
@@ -317,7 +317,7 @@ def test_begin_what_if_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_tenant_scope(self, resource_group):
+ def test_deployments_export_template_at_tenant_scope(self, resource_group):
response = self.client.deployments.export_template_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -328,7 +328,7 @@ def test_export_template_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_tenant_scope(self, resource_group):
+ def test_deployments_list_at_tenant_scope(self, resource_group):
response = self.client.deployments.list_at_tenant_scope(
api_version="2022-09-01",
)
@@ -338,7 +338,7 @@ def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_management_group_scope(self, resource_group):
+ def test_deployments_begin_delete_at_management_group_scope(self, resource_group):
response = self.client.deployments.begin_delete_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -350,7 +350,7 @@ def test_begin_delete_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence_at_management_group_scope(self, resource_group):
+ def test_deployments_check_existence_at_management_group_scope(self, resource_group):
response = self.client.deployments.check_existence_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -362,7 +362,7 @@ def test_check_existence_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_management_group_scope(self, resource_group):
+ def test_deployments_begin_create_or_update_at_management_group_scope(self, resource_group):
response = self.client.deployments.begin_create_or_update_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -399,7 +399,7 @@ def test_begin_create_or_update_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_management_group_scope(self, resource_group):
+ def test_deployments_get_at_management_group_scope(self, resource_group):
response = self.client.deployments.get_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -411,7 +411,7 @@ def test_get_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel_at_management_group_scope(self, resource_group):
+ def test_deployments_cancel_at_management_group_scope(self, resource_group):
response = self.client.deployments.cancel_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -423,7 +423,7 @@ def test_cancel_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate_at_management_group_scope(self, resource_group):
+ def test_deployments_begin_validate_at_management_group_scope(self, resource_group):
response = self.client.deployments.begin_validate_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -460,7 +460,7 @@ def test_begin_validate_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_what_if_at_management_group_scope(self, resource_group):
+ def test_deployments_begin_what_if_at_management_group_scope(self, resource_group):
response = self.client.deployments.begin_what_if_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -497,7 +497,7 @@ def test_begin_what_if_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_management_group_scope(self, resource_group):
+ def test_deployments_export_template_at_management_group_scope(self, resource_group):
response = self.client.deployments.export_template_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -509,7 +509,7 @@ def test_export_template_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_management_group_scope(self, resource_group):
+ def test_deployments_list_at_management_group_scope(self, resource_group):
response = self.client.deployments.list_at_management_group_scope(
group_id="str",
api_version="2022-09-01",
@@ -520,7 +520,7 @@ def test_list_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_subscription_scope(self, resource_group):
+ def test_deployments_begin_delete_at_subscription_scope(self, resource_group):
response = self.client.deployments.begin_delete_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -531,7 +531,7 @@ def test_begin_delete_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence_at_subscription_scope(self, resource_group):
+ def test_deployments_check_existence_at_subscription_scope(self, resource_group):
response = self.client.deployments.check_existence_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -542,7 +542,7 @@ def test_check_existence_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_subscription_scope(self, resource_group):
+ def test_deployments_begin_create_or_update_at_subscription_scope(self, resource_group):
response = self.client.deployments.begin_create_or_update_at_subscription_scope(
deployment_name="str",
parameters={
@@ -578,7 +578,7 @@ def test_begin_create_or_update_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_subscription_scope(self, resource_group):
+ def test_deployments_get_at_subscription_scope(self, resource_group):
response = self.client.deployments.get_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -589,7 +589,7 @@ def test_get_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel_at_subscription_scope(self, resource_group):
+ def test_deployments_cancel_at_subscription_scope(self, resource_group):
response = self.client.deployments.cancel_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -600,7 +600,7 @@ def test_cancel_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate_at_subscription_scope(self, resource_group):
+ def test_deployments_begin_validate_at_subscription_scope(self, resource_group):
response = self.client.deployments.begin_validate_at_subscription_scope(
deployment_name="str",
parameters={
@@ -636,7 +636,7 @@ def test_begin_validate_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_what_if_at_subscription_scope(self, resource_group):
+ def test_deployments_begin_what_if_at_subscription_scope(self, resource_group):
response = self.client.deployments.begin_what_if_at_subscription_scope(
deployment_name="str",
parameters={
@@ -672,7 +672,7 @@ def test_begin_what_if_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template_at_subscription_scope(self, resource_group):
+ def test_deployments_export_template_at_subscription_scope(self, resource_group):
response = self.client.deployments.export_template_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -683,7 +683,7 @@ def test_export_template_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_subscription_scope(self, resource_group):
+ def test_deployments_list_at_subscription_scope(self, resource_group):
response = self.client.deployments.list_at_subscription_scope(
api_version="2022-09-01",
)
@@ -693,7 +693,7 @@ def test_list_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_deployments_begin_delete(self, resource_group):
response = self.client.deployments.begin_delete(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -705,7 +705,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence(self, resource_group):
+ def test_deployments_check_existence(self, resource_group):
response = self.client.deployments.check_existence(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -717,7 +717,7 @@ def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_deployments_begin_create_or_update(self, resource_group):
response = self.client.deployments.begin_create_or_update(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -754,7 +754,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_deployments_get(self, resource_group):
response = self.client.deployments.get(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -766,7 +766,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_cancel(self, resource_group):
+ def test_deployments_cancel(self, resource_group):
response = self.client.deployments.cancel(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -778,7 +778,7 @@ def test_cancel(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate(self, resource_group):
+ def test_deployments_begin_validate(self, resource_group):
response = self.client.deployments.begin_validate(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -815,7 +815,7 @@ def test_begin_validate(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_what_if(self, resource_group):
+ def test_deployments_begin_what_if(self, resource_group):
response = self.client.deployments.begin_what_if(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -852,7 +852,7 @@ def test_begin_what_if(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_export_template(self, resource_group):
+ def test_deployments_export_template(self, resource_group):
response = self.client.deployments.export_template(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -864,7 +864,7 @@ def test_export_template(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_deployments_list_by_resource_group(self, resource_group):
response = self.client.deployments.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -875,7 +875,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_calculate_template_hash(self, resource_group):
+ def test_deployments_calculate_template_hash(self, resource_group):
response = self.client.deployments.calculate_template_hash(
template={},
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations_async.py
index 69a4dd527b75..57ce873362da 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_deployments_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_scope(self, resource_group):
+ async def test_deployments_begin_delete_at_scope(self, resource_group):
response = await (
await self.client.deployments.begin_delete_at_scope(
scope="str",
@@ -35,7 +35,7 @@ async def test_begin_delete_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence_at_scope(self, resource_group):
+ async def test_deployments_check_existence_at_scope(self, resource_group):
response = await self.client.deployments.check_existence_at_scope(
scope="str",
deployment_name="str",
@@ -47,7 +47,7 @@ async def test_check_existence_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_scope(self, resource_group):
+ async def test_deployments_begin_create_or_update_at_scope(self, resource_group):
response = await (
await self.client.deployments.begin_create_or_update_at_scope(
scope="str",
@@ -86,7 +86,7 @@ async def test_begin_create_or_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_scope(self, resource_group):
+ async def test_deployments_get_at_scope(self, resource_group):
response = await self.client.deployments.get_at_scope(
scope="str",
deployment_name="str",
@@ -98,7 +98,7 @@ async def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel_at_scope(self, resource_group):
+ async def test_deployments_cancel_at_scope(self, resource_group):
response = await self.client.deployments.cancel_at_scope(
scope="str",
deployment_name="str",
@@ -110,7 +110,7 @@ async def test_cancel_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate_at_scope(self, resource_group):
+ async def test_deployments_begin_validate_at_scope(self, resource_group):
response = await (
await self.client.deployments.begin_validate_at_scope(
scope="str",
@@ -149,7 +149,7 @@ async def test_begin_validate_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_scope(self, resource_group):
+ async def test_deployments_export_template_at_scope(self, resource_group):
response = await self.client.deployments.export_template_at_scope(
scope="str",
deployment_name="str",
@@ -161,7 +161,7 @@ async def test_export_template_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_scope(self, resource_group):
+ async def test_deployments_list_at_scope(self, resource_group):
response = self.client.deployments.list_at_scope(
scope="str",
api_version="2022-09-01",
@@ -172,7 +172,7 @@ async def test_list_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_tenant_scope(self, resource_group):
+ async def test_deployments_begin_delete_at_tenant_scope(self, resource_group):
response = await (
await self.client.deployments.begin_delete_at_tenant_scope(
deployment_name="str",
@@ -185,7 +185,7 @@ async def test_begin_delete_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence_at_tenant_scope(self, resource_group):
+ async def test_deployments_check_existence_at_tenant_scope(self, resource_group):
response = await self.client.deployments.check_existence_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -196,7 +196,7 @@ async def test_check_existence_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_tenant_scope(self, resource_group):
+ async def test_deployments_begin_create_or_update_at_tenant_scope(self, resource_group):
response = await (
await self.client.deployments.begin_create_or_update_at_tenant_scope(
deployment_name="str",
@@ -234,7 +234,7 @@ async def test_begin_create_or_update_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_tenant_scope(self, resource_group):
+ async def test_deployments_get_at_tenant_scope(self, resource_group):
response = await self.client.deployments.get_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -245,7 +245,7 @@ async def test_get_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel_at_tenant_scope(self, resource_group):
+ async def test_deployments_cancel_at_tenant_scope(self, resource_group):
response = await self.client.deployments.cancel_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -256,7 +256,7 @@ async def test_cancel_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate_at_tenant_scope(self, resource_group):
+ async def test_deployments_begin_validate_at_tenant_scope(self, resource_group):
response = await (
await self.client.deployments.begin_validate_at_tenant_scope(
deployment_name="str",
@@ -294,7 +294,7 @@ async def test_begin_validate_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_what_if_at_tenant_scope(self, resource_group):
+ async def test_deployments_begin_what_if_at_tenant_scope(self, resource_group):
response = await (
await self.client.deployments.begin_what_if_at_tenant_scope(
deployment_name="str",
@@ -332,7 +332,7 @@ async def test_begin_what_if_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_tenant_scope(self, resource_group):
+ async def test_deployments_export_template_at_tenant_scope(self, resource_group):
response = await self.client.deployments.export_template_at_tenant_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -343,7 +343,7 @@ async def test_export_template_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_tenant_scope(self, resource_group):
+ async def test_deployments_list_at_tenant_scope(self, resource_group):
response = self.client.deployments.list_at_tenant_scope(
api_version="2022-09-01",
)
@@ -353,7 +353,7 @@ async def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_management_group_scope(self, resource_group):
+ async def test_deployments_begin_delete_at_management_group_scope(self, resource_group):
response = await (
await self.client.deployments.begin_delete_at_management_group_scope(
group_id="str",
@@ -367,7 +367,7 @@ async def test_begin_delete_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence_at_management_group_scope(self, resource_group):
+ async def test_deployments_check_existence_at_management_group_scope(self, resource_group):
response = await self.client.deployments.check_existence_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -379,7 +379,7 @@ async def test_check_existence_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_management_group_scope(self, resource_group):
+ async def test_deployments_begin_create_or_update_at_management_group_scope(self, resource_group):
response = await (
await self.client.deployments.begin_create_or_update_at_management_group_scope(
group_id="str",
@@ -418,7 +418,7 @@ async def test_begin_create_or_update_at_management_group_scope(self, resource_g
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_management_group_scope(self, resource_group):
+ async def test_deployments_get_at_management_group_scope(self, resource_group):
response = await self.client.deployments.get_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -430,7 +430,7 @@ async def test_get_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel_at_management_group_scope(self, resource_group):
+ async def test_deployments_cancel_at_management_group_scope(self, resource_group):
response = await self.client.deployments.cancel_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -442,7 +442,7 @@ async def test_cancel_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate_at_management_group_scope(self, resource_group):
+ async def test_deployments_begin_validate_at_management_group_scope(self, resource_group):
response = await (
await self.client.deployments.begin_validate_at_management_group_scope(
group_id="str",
@@ -481,7 +481,7 @@ async def test_begin_validate_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_what_if_at_management_group_scope(self, resource_group):
+ async def test_deployments_begin_what_if_at_management_group_scope(self, resource_group):
response = await (
await self.client.deployments.begin_what_if_at_management_group_scope(
group_id="str",
@@ -520,7 +520,7 @@ async def test_begin_what_if_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_management_group_scope(self, resource_group):
+ async def test_deployments_export_template_at_management_group_scope(self, resource_group):
response = await self.client.deployments.export_template_at_management_group_scope(
group_id="str",
deployment_name="str",
@@ -532,7 +532,7 @@ async def test_export_template_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_management_group_scope(self, resource_group):
+ async def test_deployments_list_at_management_group_scope(self, resource_group):
response = self.client.deployments.list_at_management_group_scope(
group_id="str",
api_version="2022-09-01",
@@ -543,7 +543,7 @@ async def test_list_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_subscription_scope(self, resource_group):
+ async def test_deployments_begin_delete_at_subscription_scope(self, resource_group):
response = await (
await self.client.deployments.begin_delete_at_subscription_scope(
deployment_name="str",
@@ -556,7 +556,7 @@ async def test_begin_delete_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence_at_subscription_scope(self, resource_group):
+ async def test_deployments_check_existence_at_subscription_scope(self, resource_group):
response = await self.client.deployments.check_existence_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -567,7 +567,7 @@ async def test_check_existence_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_subscription_scope(self, resource_group):
+ async def test_deployments_begin_create_or_update_at_subscription_scope(self, resource_group):
response = await (
await self.client.deployments.begin_create_or_update_at_subscription_scope(
deployment_name="str",
@@ -605,7 +605,7 @@ async def test_begin_create_or_update_at_subscription_scope(self, resource_group
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_subscription_scope(self, resource_group):
+ async def test_deployments_get_at_subscription_scope(self, resource_group):
response = await self.client.deployments.get_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -616,7 +616,7 @@ async def test_get_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel_at_subscription_scope(self, resource_group):
+ async def test_deployments_cancel_at_subscription_scope(self, resource_group):
response = await self.client.deployments.cancel_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -627,7 +627,7 @@ async def test_cancel_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate_at_subscription_scope(self, resource_group):
+ async def test_deployments_begin_validate_at_subscription_scope(self, resource_group):
response = await (
await self.client.deployments.begin_validate_at_subscription_scope(
deployment_name="str",
@@ -665,7 +665,7 @@ async def test_begin_validate_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_what_if_at_subscription_scope(self, resource_group):
+ async def test_deployments_begin_what_if_at_subscription_scope(self, resource_group):
response = await (
await self.client.deployments.begin_what_if_at_subscription_scope(
deployment_name="str",
@@ -703,7 +703,7 @@ async def test_begin_what_if_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template_at_subscription_scope(self, resource_group):
+ async def test_deployments_export_template_at_subscription_scope(self, resource_group):
response = await self.client.deployments.export_template_at_subscription_scope(
deployment_name="str",
api_version="2022-09-01",
@@ -714,7 +714,7 @@ async def test_export_template_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_subscription_scope(self, resource_group):
+ async def test_deployments_list_at_subscription_scope(self, resource_group):
response = self.client.deployments.list_at_subscription_scope(
api_version="2022-09-01",
)
@@ -724,7 +724,7 @@ async def test_list_at_subscription_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_deployments_begin_delete(self, resource_group):
response = await (
await self.client.deployments.begin_delete(
resource_group_name=resource_group.name,
@@ -738,7 +738,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence(self, resource_group):
+ async def test_deployments_check_existence(self, resource_group):
response = await self.client.deployments.check_existence(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -750,7 +750,7 @@ async def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_deployments_begin_create_or_update(self, resource_group):
response = await (
await self.client.deployments.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -789,7 +789,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_deployments_get(self, resource_group):
response = await self.client.deployments.get(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -801,7 +801,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_cancel(self, resource_group):
+ async def test_deployments_cancel(self, resource_group):
response = await self.client.deployments.cancel(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -813,7 +813,7 @@ async def test_cancel(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate(self, resource_group):
+ async def test_deployments_begin_validate(self, resource_group):
response = await (
await self.client.deployments.begin_validate(
resource_group_name=resource_group.name,
@@ -852,7 +852,7 @@ async def test_begin_validate(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_what_if(self, resource_group):
+ async def test_deployments_begin_what_if(self, resource_group):
response = await (
await self.client.deployments.begin_what_if(
resource_group_name=resource_group.name,
@@ -891,7 +891,7 @@ async def test_begin_what_if(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_export_template(self, resource_group):
+ async def test_deployments_export_template(self, resource_group):
response = await self.client.deployments.export_template(
resource_group_name=resource_group.name,
deployment_name="str",
@@ -903,7 +903,7 @@ async def test_export_template(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_deployments_list_by_resource_group(self, resource_group):
response = self.client.deployments.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -914,7 +914,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_calculate_template_hash(self, resource_group):
+ async def test_deployments_calculate_template_hash(self, resource_group):
response = await self.client.deployments.calculate_template_hash(
template={},
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations.py
index 52805ab129ea..9d82c4068506 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_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="2022-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations_async.py
index 2ccdbce18f22..6225ff891a3a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_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="2022-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations.py
index dcf0701d1f2f..50c340eed335 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_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_provider_resource_types_list(self, resource_group):
response = self.client.provider_resource_types.list(
resource_provider_namespace="str",
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations_async.py
index 4d9f0ef21c54..46603ab79684 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_provider_resource_types_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_provider_resource_types_list(self, resource_group):
response = await self.client.provider_resource_types.list(
resource_provider_namespace="str",
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations.py
index 98bc6f050bcd..5d6f5504f429 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_unregister(self, resource_group):
+ def test_providers_unregister(self, resource_group):
response = self.client.providers.unregister(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -31,7 +31,7 @@ def test_unregister(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_register_at_management_group_scope(self, resource_group):
+ def test_providers_register_at_management_group_scope(self, resource_group):
response = self.client.providers.register_at_management_group_scope(
resource_provider_namespace="str",
group_id="str",
@@ -43,7 +43,7 @@ def test_register_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_provider_permissions(self, resource_group):
+ def test_providers_provider_permissions(self, resource_group):
response = self.client.providers.provider_permissions(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -54,7 +54,7 @@ def test_provider_permissions(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_register(self, resource_group):
+ def test_providers_register(self, resource_group):
response = self.client.providers.register(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -65,7 +65,7 @@ def test_register(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_providers_list(self, resource_group):
response = self.client.providers.list(
api_version="2022-09-01",
)
@@ -75,7 +75,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_at_tenant_scope(self, resource_group):
+ def test_providers_list_at_tenant_scope(self, resource_group):
response = self.client.providers.list_at_tenant_scope(
api_version="2022-09-01",
)
@@ -85,7 +85,7 @@ def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_providers_get(self, resource_group):
response = self.client.providers.get(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -96,7 +96,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_tenant_scope(self, resource_group):
+ def test_providers_get_at_tenant_scope(self, resource_group):
response = self.client.providers.get_at_tenant_scope(
resource_provider_namespace="str",
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations_async.py
index 80fff2633a18..f893acca8f97 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_providers_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_unregister(self, resource_group):
+ async def test_providers_unregister(self, resource_group):
response = await self.client.providers.unregister(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -32,7 +32,7 @@ async def test_unregister(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_register_at_management_group_scope(self, resource_group):
+ async def test_providers_register_at_management_group_scope(self, resource_group):
response = await self.client.providers.register_at_management_group_scope(
resource_provider_namespace="str",
group_id="str",
@@ -44,7 +44,7 @@ async def test_register_at_management_group_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_provider_permissions(self, resource_group):
+ async def test_providers_provider_permissions(self, resource_group):
response = await self.client.providers.provider_permissions(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -55,7 +55,7 @@ async def test_provider_permissions(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_register(self, resource_group):
+ async def test_providers_register(self, resource_group):
response = await self.client.providers.register(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -66,7 +66,7 @@ async def test_register(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_providers_list(self, resource_group):
response = self.client.providers.list(
api_version="2022-09-01",
)
@@ -76,7 +76,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_at_tenant_scope(self, resource_group):
+ async def test_providers_list_at_tenant_scope(self, resource_group):
response = self.client.providers.list_at_tenant_scope(
api_version="2022-09-01",
)
@@ -86,7 +86,7 @@ async def test_list_at_tenant_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_providers_get(self, resource_group):
response = await self.client.providers.get(
resource_provider_namespace="str",
api_version="2022-09-01",
@@ -97,7 +97,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_tenant_scope(self, resource_group):
+ async def test_providers_get_at_tenant_scope(self, resource_group):
response = await self.client.providers.get_at_tenant_scope(
resource_provider_namespace="str",
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations.py
index c17fc6176799..b0687bad739a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence(self, resource_group):
+ def test_resource_groups_check_existence(self, resource_group):
response = self.client.resource_groups.check_existence(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -31,7 +31,7 @@ def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_resource_groups_create_or_update(self, resource_group):
response = self.client.resource_groups.create_or_update(
resource_group_name=resource_group.name,
parameters={
@@ -51,7 +51,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_resource_groups_begin_delete(self, resource_group):
response = self.client.resource_groups.begin_delete(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -62,7 +62,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_resource_groups_get(self, resource_group):
response = self.client.resource_groups.get(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -73,7 +73,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_resource_groups_update(self, resource_group):
response = self.client.resource_groups.update(
resource_group_name=resource_group.name,
parameters={
@@ -90,7 +90,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_export_template(self, resource_group):
+ def test_resource_groups_begin_export_template(self, resource_group):
response = self.client.resource_groups.begin_export_template(
resource_group_name=resource_group.name,
parameters={"options": "str", "resources": ["str"]},
@@ -102,7 +102,7 @@ def test_begin_export_template(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_resource_groups_list(self, resource_group):
response = self.client.resource_groups.list(
api_version="2022-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations_async.py
index 98e8730f53d2..ce6a18bdf50b 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resource_groups_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence(self, resource_group):
+ async def test_resource_groups_check_existence(self, resource_group):
response = await self.client.resource_groups.check_existence(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -32,7 +32,7 @@ async def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_resource_groups_create_or_update(self, resource_group):
response = await self.client.resource_groups.create_or_update(
resource_group_name=resource_group.name,
parameters={
@@ -52,7 +52,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_resource_groups_begin_delete(self, resource_group):
response = await (
await self.client.resource_groups.begin_delete(
resource_group_name=resource_group.name,
@@ -65,7 +65,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_resource_groups_get(self, resource_group):
response = await self.client.resource_groups.get(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -76,7 +76,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_resource_groups_update(self, resource_group):
response = await self.client.resource_groups.update(
resource_group_name=resource_group.name,
parameters={
@@ -93,7 +93,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_export_template(self, resource_group):
+ async def test_resource_groups_begin_export_template(self, resource_group):
response = await (
await self.client.resource_groups.begin_export_template(
resource_group_name=resource_group.name,
@@ -107,7 +107,7 @@ async def test_begin_export_template(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_resource_groups_list(self, resource_group):
response = self.client.resource_groups.list(
api_version="2022-09-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations.py
index a4bdba1d7859..828c05884e99 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_resources_list_by_resource_group(self, resource_group):
response = self.client.resources.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -31,7 +31,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_move_resources(self, resource_group):
+ def test_resources_begin_move_resources(self, resource_group):
response = self.client.resources.begin_move_resources(
source_resource_group_name="str",
parameters={"resources": ["str"], "targetResourceGroup": "str"},
@@ -43,7 +43,7 @@ def test_begin_move_resources(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_validate_move_resources(self, resource_group):
+ def test_resources_begin_validate_move_resources(self, resource_group):
response = self.client.resources.begin_validate_move_resources(
source_resource_group_name="str",
parameters={"resources": ["str"], "targetResourceGroup": "str"},
@@ -55,7 +55,7 @@ def test_begin_validate_move_resources(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_resources_list(self, resource_group):
response = self.client.resources.list(
api_version="2022-09-01",
)
@@ -65,7 +65,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence(self, resource_group):
+ def test_resources_check_existence(self, resource_group):
response = self.client.resources.check_existence(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -80,7 +80,7 @@ def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete(self, resource_group):
+ def test_resources_begin_delete(self, resource_group):
response = self.client.resources.begin_delete(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -95,7 +95,7 @@ def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update(self, resource_group):
+ def test_resources_begin_create_or_update(self, resource_group):
response = self.client.resources.begin_create_or_update(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -129,7 +129,7 @@ def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_update(self, resource_group):
+ def test_resources_begin_update(self, resource_group):
response = self.client.resources.begin_update(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -163,7 +163,7 @@ def test_begin_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_resources_get(self, resource_group):
response = self.client.resources.get(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -178,7 +178,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_existence_by_id(self, resource_group):
+ def test_resources_check_existence_by_id(self, resource_group):
response = self.client.resources.check_existence_by_id(
resource_id="str",
api_version="str",
@@ -189,7 +189,7 @@ def test_check_existence_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_by_id(self, resource_group):
+ def test_resources_begin_delete_by_id(self, resource_group):
response = self.client.resources.begin_delete_by_id(
resource_id="str",
api_version="str",
@@ -200,7 +200,7 @@ def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_by_id(self, resource_group):
+ def test_resources_begin_create_or_update_by_id(self, resource_group):
response = self.client.resources.begin_create_or_update_by_id(
resource_id="str",
api_version="str",
@@ -230,7 +230,7 @@ def test_begin_create_or_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_update_by_id(self, resource_group):
+ def test_resources_begin_update_by_id(self, resource_group):
response = self.client.resources.begin_update_by_id(
resource_id="str",
api_version="str",
@@ -260,7 +260,7 @@ def test_begin_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_id(self, resource_group):
+ def test_resources_get_by_id(self, resource_group):
response = self.client.resources.get_by_id(
resource_id="str",
api_version="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations_async.py
index 815852975675..ec04070c5bd9 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_resources_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_resource_group(self, resource_group):
+ async def test_resources_list_by_resource_group(self, resource_group):
response = self.client.resources.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-09-01",
@@ -32,7 +32,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_move_resources(self, resource_group):
+ async def test_resources_begin_move_resources(self, resource_group):
response = await (
await self.client.resources.begin_move_resources(
source_resource_group_name="str",
@@ -46,7 +46,7 @@ async def test_begin_move_resources(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_validate_move_resources(self, resource_group):
+ async def test_resources_begin_validate_move_resources(self, resource_group):
response = await (
await self.client.resources.begin_validate_move_resources(
source_resource_group_name="str",
@@ -60,7 +60,7 @@ async def test_begin_validate_move_resources(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_resources_list(self, resource_group):
response = self.client.resources.list(
api_version="2022-09-01",
)
@@ -70,7 +70,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence(self, resource_group):
+ async def test_resources_check_existence(self, resource_group):
response = await self.client.resources.check_existence(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -85,7 +85,7 @@ async def test_check_existence(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete(self, resource_group):
+ async def test_resources_begin_delete(self, resource_group):
response = await (
await self.client.resources.begin_delete(
resource_group_name=resource_group.name,
@@ -102,7 +102,7 @@ async def test_begin_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update(self, resource_group):
+ async def test_resources_begin_create_or_update(self, resource_group):
response = await (
await self.client.resources.begin_create_or_update(
resource_group_name=resource_group.name,
@@ -151,7 +151,7 @@ async def test_begin_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_update(self, resource_group):
+ async def test_resources_begin_update(self, resource_group):
response = await (
await self.client.resources.begin_update(
resource_group_name=resource_group.name,
@@ -200,7 +200,7 @@ async def test_begin_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_resources_get(self, resource_group):
response = await self.client.resources.get(
resource_group_name=resource_group.name,
resource_provider_namespace="str",
@@ -215,7 +215,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_existence_by_id(self, resource_group):
+ async def test_resources_check_existence_by_id(self, resource_group):
response = await self.client.resources.check_existence_by_id(
resource_id="str",
api_version="str",
@@ -226,7 +226,7 @@ async def test_check_existence_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_by_id(self, resource_group):
+ async def test_resources_begin_delete_by_id(self, resource_group):
response = await (
await self.client.resources.begin_delete_by_id(
resource_id="str",
@@ -239,7 +239,7 @@ async def test_begin_delete_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_by_id(self, resource_group):
+ async def test_resources_begin_create_or_update_by_id(self, resource_group):
response = await (
await self.client.resources.begin_create_or_update_by_id(
resource_id="str",
@@ -284,7 +284,7 @@ async def test_begin_create_or_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_update_by_id(self, resource_group):
+ async def test_resources_begin_update_by_id(self, resource_group):
response = await (
await self.client.resources.begin_update_by_id(
resource_id="str",
@@ -329,7 +329,7 @@ async def test_begin_update_by_id(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_id(self, resource_group):
+ async def test_resources_get_by_id(self, resource_group):
response = await self.client.resources.get_by_id(
resource_id="str",
api_version="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations.py
index 9e0375daea7e..39011a1569de 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_value(self, resource_group):
+ def test_tags_delete_value(self, resource_group):
response = self.client.tags.delete_value(
tag_name="str",
tag_value="str",
@@ -32,7 +32,7 @@ def test_delete_value(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update_value(self, resource_group):
+ def test_tags_create_or_update_value(self, resource_group):
response = self.client.tags.create_or_update_value(
tag_name="str",
tag_value="str",
@@ -44,7 +44,7 @@ def test_create_or_update_value(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_tags_create_or_update(self, resource_group):
response = self.client.tags.create_or_update(
tag_name="str",
api_version="2022-09-01",
@@ -55,7 +55,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_tags_delete(self, resource_group):
response = self.client.tags.delete(
tag_name="str",
api_version="2022-09-01",
@@ -66,7 +66,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_tags_list(self, resource_group):
response = self.client.tags.list(
api_version="2022-09-01",
)
@@ -76,7 +76,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_create_or_update_at_scope(self, resource_group):
+ def test_tags_begin_create_or_update_at_scope(self, resource_group):
response = self.client.tags.begin_create_or_update_at_scope(
scope="str",
parameters={"properties": {"tags": {"str": "str"}}, "id": "str", "name": "str", "type": "str"},
@@ -88,7 +88,7 @@ def test_begin_create_or_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_update_at_scope(self, resource_group):
+ def test_tags_begin_update_at_scope(self, resource_group):
response = self.client.tags.begin_update_at_scope(
scope="str",
parameters={"operation": "str", "properties": {"tags": {"str": "str"}}},
@@ -100,7 +100,7 @@ def test_begin_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_at_scope(self, resource_group):
+ def test_tags_get_at_scope(self, resource_group):
response = self.client.tags.get_at_scope(
scope="str",
api_version="2022-09-01",
@@ -111,7 +111,7 @@ def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_begin_delete_at_scope(self, resource_group):
+ def test_tags_begin_delete_at_scope(self, resource_group):
response = self.client.tags.begin_delete_at_scope(
scope="str",
api_version="2022-09-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations_async.py
index 153b9b4d2fe3..1ce770cafd26 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_management_tags_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_value(self, resource_group):
+ async def test_tags_delete_value(self, resource_group):
response = await self.client.tags.delete_value(
tag_name="str",
tag_value="str",
@@ -33,7 +33,7 @@ async def test_delete_value(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update_value(self, resource_group):
+ async def test_tags_create_or_update_value(self, resource_group):
response = await self.client.tags.create_or_update_value(
tag_name="str",
tag_value="str",
@@ -45,7 +45,7 @@ async def test_create_or_update_value(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_tags_create_or_update(self, resource_group):
response = await self.client.tags.create_or_update(
tag_name="str",
api_version="2022-09-01",
@@ -56,7 +56,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_tags_delete(self, resource_group):
response = await self.client.tags.delete(
tag_name="str",
api_version="2022-09-01",
@@ -67,7 +67,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_tags_list(self, resource_group):
response = self.client.tags.list(
api_version="2022-09-01",
)
@@ -77,7 +77,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_create_or_update_at_scope(self, resource_group):
+ async def test_tags_begin_create_or_update_at_scope(self, resource_group):
response = await (
await self.client.tags.begin_create_or_update_at_scope(
scope="str",
@@ -91,7 +91,7 @@ async def test_begin_create_or_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_update_at_scope(self, resource_group):
+ async def test_tags_begin_update_at_scope(self, resource_group):
response = await (
await self.client.tags.begin_update_at_scope(
scope="str",
@@ -105,7 +105,7 @@ async def test_begin_update_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_at_scope(self, resource_group):
+ async def test_tags_get_at_scope(self, resource_group):
response = await self.client.tags.get_at_scope(
scope="str",
api_version="2022-09-01",
@@ -116,7 +116,7 @@ async def test_get_at_scope(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_begin_delete_at_scope(self, resource_group):
+ async def test_tags_begin_delete_at_scope(self, resource_group):
response = await (
await self.client.tags.begin_delete_at_scope(
scope="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations.py
index 826464ac008c..8c6b465b5c7c 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_put(self, resource_group):
+ def test_private_link_association_put(self, resource_group):
response = self.client.private_link_association.put(
group_id="str",
pla_id="str",
@@ -33,7 +33,7 @@ def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_private_link_association_get(self, resource_group):
response = self.client.private_link_association.get(
group_id="str",
pla_id="str",
@@ -45,7 +45,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_private_link_association_delete(self, resource_group):
response = self.client.private_link_association.delete(
group_id="str",
pla_id="str",
@@ -57,7 +57,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_private_link_association_list(self, resource_group):
response = self.client.private_link_association.list(
group_id="str",
api_version="2020-05-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations_async.py
index 6e6f76b1cb4d..184961f78520 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_private_link_association_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_put(self, resource_group):
+ async def test_private_link_association_put(self, resource_group):
response = await self.client.private_link_association.put(
group_id="str",
pla_id="str",
@@ -34,7 +34,7 @@ async def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_private_link_association_get(self, resource_group):
response = await self.client.private_link_association.get(
group_id="str",
pla_id="str",
@@ -46,7 +46,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_private_link_association_delete(self, resource_group):
response = await self.client.private_link_association.delete(
group_id="str",
pla_id="str",
@@ -58,7 +58,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_private_link_association_list(self, resource_group):
response = await self.client.private_link_association.list(
group_id="str",
api_version="2020-05-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations.py
index d9a51ef72d92..b5bfadc9affb 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_put(self, resource_group):
+ def test_resource_management_private_link_put(self, resource_group):
response = self.client.resource_management_private_link.put(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -33,7 +33,7 @@ def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_resource_management_private_link_get(self, resource_group):
response = self.client.resource_management_private_link.get(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -45,7 +45,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_resource_management_private_link_delete(self, resource_group):
response = self.client.resource_management_private_link.delete(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -57,7 +57,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_resource_management_private_link_list(self, resource_group):
response = self.client.resource_management_private_link.list(
api_version="2020-05-01",
)
@@ -67,7 +67,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_resource_management_private_link_list_by_resource_group(self, resource_group):
response = self.client.resource_management_private_link.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2020-05-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations_async.py
index 7bf5f584e0b6..a4e6f421a0fc 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_resource_private_link_resource_management_private_link_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_put(self, resource_group):
+ async def test_resource_management_private_link_put(self, resource_group):
response = await self.client.resource_management_private_link.put(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -34,7 +34,7 @@ async def test_put(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_resource_management_private_link_get(self, resource_group):
response = await self.client.resource_management_private_link.get(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -46,7 +46,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_resource_management_private_link_delete(self, resource_group):
response = await self.client.resource_management_private_link.delete(
resource_group_name=resource_group.name,
rmpl_name="str",
@@ -58,7 +58,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_resource_management_private_link_list(self, resource_group):
response = await self.client.resource_management_private_link.list(
api_version="2020-05-01",
)
@@ -68,7 +68,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_resource_management_private_link_list_by_resource_group(self, resource_group):
response = await self.client.resource_management_private_link.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2020-05-01",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations.py
index 4c6d8600ec2e..906c6ab8564a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_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="2022-12-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations_async.py
index 341d4eba92a0..9f696b3b753b 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_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="2022-12-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations.py
index c2f5a05aff38..a730c440e8c4 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_locations(self, resource_group):
+ def test_subscriptions_list_locations(self, resource_group):
response = self.client.subscriptions.list_locations(
subscription_id="str",
api_version="2022-12-01",
@@ -31,7 +31,7 @@ def test_list_locations(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_subscriptions_get(self, resource_group):
response = self.client.subscriptions.get(
subscription_id="str",
api_version="2022-12-01",
@@ -42,7 +42,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_subscriptions_list(self, resource_group):
response = self.client.subscriptions.list(
api_version="2022-12-01",
)
@@ -52,7 +52,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_check_zone_peers(self, resource_group):
+ def test_subscriptions_check_zone_peers(self, resource_group):
response = self.client.subscriptions.check_zone_peers(
subscription_id="str",
parameters={"location": "str", "subscriptionIds": ["str"]},
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations_async.py
index f7d641cda735..d9a24a1c5f39 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_subscriptions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_locations(self, resource_group):
+ async def test_subscriptions_list_locations(self, resource_group):
response = self.client.subscriptions.list_locations(
subscription_id="str",
api_version="2022-12-01",
@@ -32,7 +32,7 @@ async def test_list_locations(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_subscriptions_get(self, resource_group):
response = await self.client.subscriptions.get(
subscription_id="str",
api_version="2022-12-01",
@@ -43,7 +43,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_subscriptions_list(self, resource_group):
response = self.client.subscriptions.list(
api_version="2022-12-01",
)
@@ -53,7 +53,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_check_zone_peers(self, resource_group):
+ async def test_subscriptions_check_zone_peers(self, resource_group):
response = await self.client.subscriptions.check_zone_peers(
subscription_id="str",
parameters={"location": "str", "subscriptionIds": ["str"]},
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations.py
index 6d6f464d2862..076204ce2bcb 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_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_tenants_list(self, resource_group):
response = self.client.tenants.list(
api_version="2022-12-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations_async.py
index 5c66bc3c1376..fef886206c24 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_subscription_tenants_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_tenants_list(self, resource_group):
response = self.client.tenants.list(
api_version="2022-12-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations.py
index 01ea460e06bd..94b9c4b3a4d4 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_template_spec_versions_create_or_update(self, resource_group):
response = self.client.template_spec_versions.create_or_update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -53,7 +53,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_template_spec_versions_update(self, resource_group):
response = self.client.template_spec_versions.update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -66,7 +66,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_template_spec_versions_get(self, resource_group):
response = self.client.template_spec_versions.get(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -79,7 +79,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_template_spec_versions_delete(self, resource_group):
response = self.client.template_spec_versions.delete(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -92,7 +92,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_template_spec_versions_list(self, resource_group):
response = self.client.template_spec_versions.list(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -104,7 +104,7 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_ins(self, resource_group):
+ def test_template_spec_versions_list_built_ins(self, resource_group):
response = self.client.template_spec_versions.list_built_ins(
template_spec_name="str",
api_version="2022-02-01",
@@ -115,7 +115,7 @@ def test_list_built_ins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_template_spec_versions_get_built_in(self, resource_group):
response = self.client.template_spec_versions.get_built_in(
template_spec_name="str",
template_spec_version="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations_async.py
index 1193aaaee30a..252980a821ec 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_spec_versions_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_template_spec_versions_create_or_update(self, resource_group):
response = await self.client.template_spec_versions.create_or_update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -54,7 +54,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_template_spec_versions_update(self, resource_group):
response = await self.client.template_spec_versions.update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -67,7 +67,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_template_spec_versions_get(self, resource_group):
response = await self.client.template_spec_versions.get(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -80,7 +80,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_template_spec_versions_delete(self, resource_group):
response = await self.client.template_spec_versions.delete(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -93,7 +93,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_template_spec_versions_list(self, resource_group):
response = self.client.template_spec_versions.list(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -105,7 +105,7 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_ins(self, resource_group):
+ async def test_template_spec_versions_list_built_ins(self, resource_group):
response = self.client.template_spec_versions.list_built_ins(
template_spec_name="str",
api_version="2022-02-01",
@@ -116,7 +116,7 @@ async def test_list_built_ins(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_template_spec_versions_get_built_in(self, resource_group):
response = await self.client.template_spec_versions.get_built_in(
template_spec_name="str",
template_spec_version="str",
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations.py
index 55f560ff0768..c9932f847ea6 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations.py
@@ -20,7 +20,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_template_specs_create_or_update(self, resource_group):
response = self.client.template_specs.create_or_update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -57,7 +57,7 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_template_specs_update(self, resource_group):
response = self.client.template_specs.update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -69,7 +69,7 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_template_specs_get(self, resource_group):
response = self.client.template_specs.get(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -81,7 +81,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_template_specs_delete(self, resource_group):
response = self.client.template_specs.delete(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -93,7 +93,7 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_template_specs_list_by_subscription(self, resource_group):
response = self.client.template_specs.list_by_subscription(
api_version="2022-02-01",
)
@@ -103,7 +103,7 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_template_specs_list_by_resource_group(self, resource_group):
response = self.client.template_specs.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-02-01",
@@ -114,7 +114,7 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_built_in(self, resource_group):
+ def test_template_specs_get_built_in(self, resource_group):
response = self.client.template_specs.get_built_in(
template_spec_name="str",
api_version="2022-02-01",
@@ -125,7 +125,7 @@ def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_built_ins(self, resource_group):
+ def test_template_specs_list_built_ins(self, resource_group):
response = self.client.template_specs.list_built_ins(
api_version="2022-02-01",
)
diff --git a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations_async.py b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations_async.py
index d6b16c2014d7..088eca07206a 100644
--- a/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations_async.py
+++ b/sdk/resources/azure-mgmt-resource/generated_tests/test_template_specs_template_specs_operations_async.py
@@ -21,7 +21,7 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_template_specs_create_or_update(self, resource_group):
response = await self.client.template_specs.create_or_update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -58,7 +58,7 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_template_specs_update(self, resource_group):
response = await self.client.template_specs.update(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -70,7 +70,7 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_template_specs_get(self, resource_group):
response = await self.client.template_specs.get(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -82,7 +82,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_template_specs_delete(self, resource_group):
response = await self.client.template_specs.delete(
resource_group_name=resource_group.name,
template_spec_name="str",
@@ -94,7 +94,7 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_template_specs_list_by_subscription(self, resource_group):
response = self.client.template_specs.list_by_subscription(
api_version="2022-02-01",
)
@@ -104,7 +104,7 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_template_specs_list_by_resource_group(self, resource_group):
response = self.client.template_specs.list_by_resource_group(
resource_group_name=resource_group.name,
api_version="2022-02-01",
@@ -115,7 +115,7 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_built_in(self, resource_group):
+ async def test_template_specs_get_built_in(self, resource_group):
response = await self.client.template_specs.get_built_in(
template_spec_name="str",
api_version="2022-02-01",
@@ -126,7 +126,7 @@ async def test_get_built_in(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_built_ins(self, resource_group):
+ async def test_template_specs_list_built_ins(self, resource_group):
response = self.client.template_specs.list_built_ins(
api_version="2022-02-01",
)