diff --git a/sdk/quota/azure-mgmt-quota/_meta.json b/sdk/quota/azure-mgmt-quota/_meta.json index e16a6c28fe3b..e2a5e910dcac 100644 --- a/sdk/quota/azure-mgmt-quota/_meta.json +++ b/sdk/quota/azure-mgmt-quota/_meta.json @@ -1,11 +1,11 @@ { - "commit": "7d6c14d986a67dca3451d7d92d8f6b9416d61fbf", + "commit": "806d1616c2ce4c0a93fda266bd020903733ac326", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.4.3", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/quota/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/quota/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.3 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/quota/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py index 03e1dea4ca79..5ff036f67948 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py index 1cfc25e58638..13b543815076 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_azure_quota_extension_api.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import AzureQuotaExtensionAPIConfiguration from ._serialization import Deserializer, Serializer from .operations import QuotaOperationOperations, QuotaOperations, QuotaRequestStatusOperations, UsagesOperations @@ -37,8 +37,8 @@ class AzureQuotaExtensionAPI: # pylint: disable=client-accepts-api-version-keyw :type credential: ~azure.core.credentials.TokenCredential :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2021-03-15-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-02-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -48,9 +48,9 @@ def __init__( self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = AzureQuotaExtensionAPIConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + 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 @@ -83,15 +83,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> AzureQuotaExtensionAPI + def __enter__(self) -> "AzureQuotaExtensionAPI": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py index 04908678826b..60e5caf3cd93 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_configuration.py @@ -33,14 +33,14 @@ class AzureQuotaExtensionAPIConfiguration(Configuration): # pylint: disable=too :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2021-03-15-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-02-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(AzureQuotaExtensionAPIConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-15-preview") # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", "2023-02-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,10 +51,7 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: kwargs.setdefault("sdk_moniker", "mgmt-quota/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + 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) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py index 7c1dedb5133d..f17c068e833e 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,23 +38,38 @@ import re import sys import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate - -from typing import Dict, Any, cast, TYPE_CHECKING +import isodate # type: ignore from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] class RawDeserializer: @@ -65,8 +81,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +147,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +174,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +202,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +233,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,12 +290,12 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: 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__) @@ -290,27 +304,27 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,13 +333,13 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -339,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -387,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -399,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -412,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -453,7 +477,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -521,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -537,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -606,13 +630,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + 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 "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +645,22 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): - unflattened = {k: new_attr} - new_attr = unflattened + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -659,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -675,7 +698,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -780,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -843,7 +868,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +1026,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + 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}" @@ -1164,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1335,7 +1361,7 @@ class Deserializer(object): 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}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1355,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1416,7 +1442,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1470,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1474,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1489,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1499,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: @@ -1543,7 +1569,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1591,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1773,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1824,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1836,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1852,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1867,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1897,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1912,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1927,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1950,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1986,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_vendor.py @@ -5,6 +5,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from typing import List, cast + from azure.core.pipeline.transport import HttpRequest @@ -22,6 +24,7 @@ def _format_url_section(template, **kwargs): try: return template.format(**kwargs) except KeyError as key: - formatted_components = template.split("/") + # Need the cast, as for some reasons "split" is typed as list[str | Any] + formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py index 73aef742777f..e5754a47ce68 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py index dfaee1cb6273..a20a5269a7c0 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py index ea229c00f891..b5d39e5806a2 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_azure_quota_extension_api.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import AzureQuotaExtensionAPIConfiguration from .operations import QuotaOperationOperations, QuotaOperations, QuotaRequestStatusOperations, UsagesOperations @@ -37,8 +37,8 @@ class AzureQuotaExtensionAPI: # pylint: disable=client-accepts-api-version-keyw :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2021-03-15-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-02-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -48,9 +48,9 @@ def __init__( self, credential: "AsyncTokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = AzureQuotaExtensionAPIConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + 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 @@ -90,5 +90,5 @@ async def __aenter__(self) -> "AzureQuotaExtensionAPI": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py index 564479f230a7..1f535b62aaec 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/_configuration.py @@ -33,14 +33,14 @@ class AzureQuotaExtensionAPIConfiguration(Configuration): # pylint: disable=too :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2021-03-15-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-02-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(AzureQuotaExtensionAPIConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-03-15-preview") # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", "2023-02-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py index 48ffda73d989..ccd735ce4eef 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/__init__.py @@ -12,7 +12,7 @@ from ._quota_operation_operations import QuotaOperationOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py index e25b44b38f4a..b9fb51524edc 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operation_operations.py @@ -71,10 +71,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationResponse"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + ) + cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,14 +118,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,4 +139,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Quota/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Quota/operations"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py index 45995aafc4ee..e478668f1281 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_operations.py @@ -99,10 +99,10 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] + ) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) request = build_get_request( resource_name=resource_name, @@ -113,10 +113,11 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -136,7 +137,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} async def _create_or_update_initial( self, @@ -156,11 +157,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CurrentQuotaLimitBase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,10 +183,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,7 +206,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + _create_or_update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @overload async def begin_create_or_update( @@ -344,8 +346,8 @@ async def begin_create_or_update( added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the specific resource. Required. :type scope: str - :param create_quota_request: Quota request payload. Is either a model type or a IO type. - Required. + :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a + IO type. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -366,16 +368,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, @@ -395,10 +397,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -410,9 +412,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} async def _update_initial( self, @@ -432,11 +434,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CurrentQuotaLimitBase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -458,10 +460,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -480,7 +483,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + _update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @overload async def begin_update( @@ -617,8 +620,8 @@ async def begin_update( added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the specific resource. Required. :type scope: str - :param create_quota_request: Quota requests payload. Is either a model type or a IO type. - Required. + :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or + a IO type. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -639,16 +642,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, @@ -668,10 +671,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -683,9 +686,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + begin_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @distributed_trace def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentQuotaLimitBase"]: @@ -707,10 +710,10 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentQuota _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaLimits] + ) + cls: ClsType[_models.QuotaLimits] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -731,7 +734,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -747,7 +750,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -755,14 +758,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("QuotaLimits", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -775,4 +779,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py index b2146d4054ba..656376b50067 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_quota_request_status_operations.py @@ -88,10 +88,10 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaRequestDetails] + ) + cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) request = build_get_request( id=id, @@ -102,10 +102,11 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -122,7 +123,7 @@ async def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestD return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests/{id}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests/{id}"} @distributed_trace def list( @@ -169,10 +170,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaRequestDetailsList] + ) + cls: ClsType[_models.QuotaRequestDetailsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +197,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +213,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,14 +221,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("QuotaRequestDetailsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -240,4 +242,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py index edb66b76b408..fd7360477b35 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/aio/operations/_usages_operations.py @@ -91,10 +91,10 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentUsagesBase] + ) + cls: ClsType[_models.CurrentUsagesBase] = kwargs.pop("cls", None) request = build_get_request( resource_name=resource_name, @@ -105,10 +105,11 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -128,7 +129,7 @@ async def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.Cu return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages/{resourceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages/{resourceName}"} @distributed_trace def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentUsagesBase"]: @@ -148,10 +149,10 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.CurrentUsage _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesLimits] + ) + cls: ClsType[_models.UsagesLimits] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,7 +173,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -188,7 +189,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,14 +197,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("UsagesLimits", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,4 +218,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py index 80b801b2685e..c36b47b361be 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/__init__.py @@ -38,7 +38,7 @@ from ._azure_quota_extension_api_enums import QuotaRequestState from ._azure_quota_extension_api_enums import UsagesTypes from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py index 597b490e04b3..c150bc71565a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/models/_models_py3.py @@ -48,7 +48,7 @@ class CommonResourceProperties(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -67,7 +67,7 @@ class CreateGenericQuotaRequestParameters(_serialization.Model): "value": {"key": "value", "type": "[CurrentQuotaLimitBase]"}, } - def __init__(self, *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, **kwargs: Any) -> None: """ :keyword value: Quota change requests. :paramtype value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] @@ -105,7 +105,7 @@ class CurrentQuotaLimitBase(_serialization.Model): "properties": {"key": "properties", "type": "QuotaProperties"}, } - def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Quota properties for the specified resource, based on the API called, Quotas or Usages. @@ -146,7 +146,7 @@ class CurrentUsagesBase(_serialization.Model): "properties": {"key": "properties", "type": "UsagesProperties"}, } - def __init__(self, *, properties: Optional["_models.UsagesProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.UsagesProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Usage properties for the specified resource. :paramtype properties: ~azure.mgmt.quota.models.UsagesProperties @@ -169,7 +169,7 @@ class ExceptionResponse(_serialization.Model): "error": {"key": "error", "type": "ServiceError"}, } - def __init__(self, *, error: Optional["_models.ServiceError"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ServiceError"] = None, **kwargs: Any) -> None: """ :keyword error: API error details. :paramtype error: ~azure.mgmt.quota.models.ServiceError @@ -200,10 +200,10 @@ class LimitJsonObject(_serialization.Model): _subtype_map = {"limit_object_type": {"LimitValue": "LimitObject"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.limit_object_type = None # type: Optional[str] + self.limit_object_type: Optional[str] = None class LimitObject(LimitJsonObject): @@ -231,7 +231,9 @@ class LimitObject(LimitJsonObject): "limit_type": {"key": "limitType", "type": "str"}, } - def __init__(self, *, value: int, limit_type: Optional[Union[str, "_models.QuotaLimitTypes"]] = None, **kwargs): + def __init__( + self, *, value: int, limit_type: Optional[Union[str, "_models.QuotaLimitTypes"]] = None, **kwargs: Any + ) -> None: """ :keyword value: The quota/limit value. Required. :paramtype value: int @@ -240,7 +242,7 @@ def __init__(self, *, value: int, limit_type: Optional[Union[str, "_models.Quota :paramtype limit_type: str or ~azure.mgmt.quota.models.QuotaLimitTypes """ super().__init__(**kwargs) - self.limit_object_type = "LimitValue" # type: str + self.limit_object_type: str = "LimitValue" self.value = value self.limit_type = limit_type @@ -272,8 +274,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: Provider name. :paramtype provider: str @@ -306,8 +308,12 @@ class OperationList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.OperationResponse"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.OperationResponse"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.quota.models.OperationResponse] @@ -342,8 +348,8 @@ def __init__( name: Optional[str] = None, display: Optional["_models.OperationDisplay"] = None, origin: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: :paramtype name: str @@ -378,8 +384,8 @@ def __init__( *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: List of quota limits. :paramtype value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] @@ -412,8 +418,8 @@ def __init__( *, value: Optional[List["_models.CurrentQuotaLimitBase"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: List of quota limits with the quota request status. :paramtype value: list[~azure.mgmt.quota.models.CurrentQuotaLimitBase] @@ -439,7 +445,7 @@ class QuotaProperties(_serialization.Model): :ivar name: Resource name provided by the resource provider. Use this property name when requesting quota. :vartype name: ~azure.mgmt.quota.models.ResourceName - :ivar resource_type: Resource type name. + :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: @@ -476,15 +482,15 @@ def __init__( name: Optional["_models.ResourceName"] = None, resource_type: Optional[str] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword limit: Resource quota limit properties. :paramtype limit: ~azure.mgmt.quota.models.LimitJsonObject :keyword name: Resource name provided by the resource provider. Use this property name when requesting quota. :paramtype name: ~azure.mgmt.quota.models.ResourceName - :keyword resource_type: Resource type name. + :keyword resource_type: The name of the resource type. Optional field. :paramtype resource_type: str :keyword properties: Additional properties for the specific resource provider. :paramtype properties: JSON @@ -549,8 +555,8 @@ def __init__( *, error: Optional["_models.ServiceErrorDetail"] = None, value: Optional[List["_models.SubRequest"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword error: Error details of the quota request. :paramtype error: ~azure.mgmt.quota.models.ServiceErrorDetail @@ -584,8 +590,12 @@ class QuotaRequestDetailsList(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.QuotaRequestDetails"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.QuotaRequestDetails"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Quota request details. :paramtype value: list[~azure.mgmt.quota.models.QuotaRequestDetails] @@ -627,7 +637,7 @@ class QuotaRequestOneResourceSubmitResponse(_serialization.Model): # pylint: di :ivar name_properties_name: Resource name provided by the resource provider. Use this property name when requesting quota. :vartype name_properties_name: ~azure.mgmt.quota.models.ResourceName - :ivar resource_type: Resource type name. + :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: @@ -682,8 +692,8 @@ def __init__( resource_type: Optional[str] = None, error: Optional["_models.ServiceErrorDetail"] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword limit: Resource quota limit properties. :paramtype limit: ~azure.mgmt.quota.models.LimitObject @@ -693,7 +703,7 @@ def __init__( :keyword name_properties_name: Resource name provided by the resource provider. Use this property name when requesting quota. :paramtype name_properties_name: ~azure.mgmt.quota.models.ResourceName - :keyword resource_type: Resource type name. + :keyword resource_type: The name of the resource type. Optional field. :paramtype resource_type: str :keyword error: Error details of the quota request. :paramtype error: ~azure.mgmt.quota.models.ServiceErrorDetail @@ -756,8 +766,8 @@ def __init__( *, error: Optional["_models.ServiceErrorDetail"] = None, value: Optional[List["_models.SubRequest"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword error: Error details of the quota request. :paramtype error: ~azure.mgmt.quota.models.ServiceErrorDetail @@ -800,7 +810,7 @@ class QuotaRequestSubmitResponse(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.QuotaRequestProperties"] = None, **kwargs): + def __init__(self, *, properties: Optional["_models.QuotaRequestProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Quota request details. :paramtype properties: ~azure.mgmt.quota.models.QuotaRequestProperties @@ -839,7 +849,7 @@ class QuotaRequestSubmitResponse202(_serialization.Model): # pylint: disable=to :ivar name_properties_name: Resource name provided by the resource provider. Use this property name when requesting quota. :vartype name_properties_name: ~azure.mgmt.quota.models.ResourceName - :ivar resource_type: Resource type name. + :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period over which the quota usage values are summarized. For example: @@ -882,8 +892,8 @@ def __init__( name_properties_name: Optional["_models.ResourceName"] = None, resource_type: Optional[str] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword limit: Resource quota limit properties. :paramtype limit: ~azure.mgmt.quota.models.LimitObject @@ -893,7 +903,7 @@ def __init__( :keyword name_properties_name: Resource name provided by the resource provider. Use this property name when requesting quota. :paramtype name_properties_name: ~azure.mgmt.quota.models.ResourceName - :keyword resource_type: Resource type name. + :keyword resource_type: The name of the resource type. Optional field. :paramtype resource_type: str :keyword properties: Additional properties for the specific resource provider. :paramtype properties: JSON @@ -913,7 +923,8 @@ def __init__( class ResourceName(_serialization.Model): - """Name of the resource provided by the resource Provider. When requesting quota, use this property name. + """Name of the resource provided by the resource Provider. When requesting quota, use this + property name. Variables are only populated by the server, and will be ignored when sending a request. @@ -932,7 +943,7 @@ class ResourceName(_serialization.Model): "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Resource name. :paramtype value: str @@ -965,7 +976,7 @@ class ServiceError(_serialization.Model): "details": {"key": "details", "type": "[ServiceErrorDetail]"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: Error code. :paramtype code: str @@ -999,7 +1010,7 @@ class ServiceErrorDetail(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1052,8 +1063,8 @@ def __init__( name: Optional["_models.ResourceName"] = None, unit: Optional[str] = None, limit: Optional["_models.LimitJsonObject"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Resource name. :paramtype name: ~azure.mgmt.quota.models.ResourceName @@ -1089,8 +1100,12 @@ class UsagesLimits(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.CurrentUsagesBase"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.CurrentUsagesBase"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: List of quota limits. :paramtype value: list[~azure.mgmt.quota.models.CurrentUsagesBase] @@ -1124,7 +1139,9 @@ class UsagesObject(_serialization.Model): "usages_type": {"key": "usagesType", "type": "str"}, } - def __init__(self, *, value: int, usages_type: Optional[Union[str, "_models.UsagesTypes"]] = None, **kwargs): + def __init__( + self, *, value: int, usages_type: Optional[Union[str, "_models.UsagesTypes"]] = None, **kwargs: Any + ) -> None: """ :keyword value: The usages value. Required. :paramtype value: int @@ -1150,7 +1167,7 @@ class UsagesProperties(_serialization.Model): :ivar name: Resource name provided by the resource provider. Use this property name when requesting quota. :vartype name: ~azure.mgmt.quota.models.ResourceName - :ivar resource_type: The name of the resource type. + :ivar resource_type: The name of the resource type. Optional field. :vartype resource_type: str :ivar quota_period: The time period for the summary of the quota usage values. For example: *P1D (per one day)*\ PT1M (per one minute) @@ -1186,15 +1203,15 @@ def __init__( name: Optional["_models.ResourceName"] = None, resource_type: Optional[str] = None, properties: Optional[JSON] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword usages: The quota limit properties for this resource. :paramtype usages: ~azure.mgmt.quota.models.UsagesObject :keyword name: Resource name provided by the resource provider. Use this property name when requesting quota. :paramtype name: ~azure.mgmt.quota.models.ResourceName - :keyword resource_type: The name of the resource type. + :keyword resource_type: The name of the resource type. Optional field. :paramtype resource_type: str :keyword properties: Additional properties for the specific resource provider. :paramtype properties: JSON diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py index 48ffda73d989..ccd735ce4eef 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/__init__.py @@ -12,7 +12,7 @@ from ._quota_operation_operations import QuotaOperationOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py index c17db92cdafc..9721cd3a0f7d 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operation_operations.py @@ -45,9 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,10 +93,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationResponse"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + ) + cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,7 +116,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -134,7 +132,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -142,14 +140,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -162,4 +161,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Quota/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Quota/operations"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py index 2e2f57db66fb..b2349818895d 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_operations.py @@ -47,9 +47,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +57,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,10 +72,8 @@ def build_create_or_update_request(resource_name: str, scope: str, **kwargs: Any _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +83,7 @@ def build_create_or_update_request(resource_name: str, scope: str, **kwargs: Any "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,10 +100,8 @@ def build_update_request(resource_name: str, scope: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +111,7 @@ def build_update_request(resource_name: str, scope: str, **kwargs: Any) -> HttpR "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,9 +128,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +137,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,10 +201,10 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] + ) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) request = build_get_request( resource_name=resource_name, @@ -223,10 +215,11 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,7 +239,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentQ return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} def _create_or_update_initial( self, @@ -266,11 +259,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CurrentQuotaLimitBase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -292,10 +285,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -314,7 +308,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + _create_or_update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @overload def begin_create_or_update( @@ -454,8 +448,8 @@ def begin_create_or_update( added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the specific resource. Required. :type scope: str - :param create_quota_request: Quota request payload. Is either a model type or a IO type. - Required. + :param create_quota_request: Quota request payload. Is either a CurrentQuotaLimitBase type or a + IO type. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -476,16 +470,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, @@ -505,9 +499,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -519,9 +513,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} def _update_initial( self, @@ -541,11 +535,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.CurrentQuotaLimitBase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.CurrentQuotaLimitBase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -567,10 +561,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -589,7 +584,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + _update_initial.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @overload def begin_update( @@ -726,8 +721,8 @@ def begin_update( added after ``/quotas``\ , then it's the target Azure resource URI in the GET operation for the specific resource. Required. :type scope: str - :param create_quota_request: Quota requests payload. Is either a model type or a IO type. - Required. + :param create_quota_request: Quota requests payload. Is either a CurrentQuotaLimitBase type or + a IO type. Required. :type create_quota_request: ~azure.mgmt.quota.models.CurrentQuotaLimitBase or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -748,16 +743,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentQuotaLimitBase] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CurrentQuotaLimitBase] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_name=resource_name, scope=scope, create_quota_request=create_quota_request, @@ -777,9 +772,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -791,9 +786,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} # type: ignore + begin_update.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}"} @distributed_trace def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentQuotaLimitBase"]: @@ -815,10 +810,10 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentQuotaLimit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaLimits] + ) + cls: ClsType[_models.QuotaLimits] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -839,7 +834,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -855,7 +850,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -863,14 +858,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("QuotaLimits", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -883,4 +879,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotas"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py index 5ab2e79dae33..7bbaa4a8cb43 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_quota_request_status_operations.py @@ -45,9 +45,7 @@ def build_get_request(id: str, scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +55,7 @@ def build_get_request(id: str, scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +77,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +86,7 @@ def build_list_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -156,10 +152,10 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaRequestDetails] + ) + cls: ClsType[_models.QuotaRequestDetails] = kwargs.pop("cls", None) request = build_get_request( id=id, @@ -170,10 +166,11 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -190,7 +187,7 @@ def get(self, id: str, scope: str, **kwargs: Any) -> _models.QuotaRequestDetails return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests/{id}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests/{id}"} @distributed_trace def list( @@ -237,10 +234,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.QuotaRequestDetailsList] + ) + cls: ClsType[_models.QuotaRequestDetailsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -264,7 +261,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -280,7 +277,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -288,14 +285,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("QuotaRequestDetailsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -308,4 +306,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/quotaRequests"} diff --git a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py index a248b748b93c..fd08cf88fd4a 100644 --- a/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py +++ b/sdk/quota/azure-mgmt-quota/azure/mgmt/quota/operations/_usages_operations.py @@ -45,9 +45,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +55,7 @@ def build_get_request(resource_name: str, scope: str, **kwargs: Any) -> HttpRequ "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -72,9 +70,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2021-03-15-preview") - ) # type: Literal["2021-03-15-preview"] + api_version: Literal["2023-02-01"] = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +79,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +142,10 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CurrentUsagesBase] + ) + cls: ClsType[_models.CurrentUsagesBase] = kwargs.pop("cls", None) request = build_get_request( resource_name=resource_name, @@ -160,10 +156,11 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -183,7 +180,7 @@ def get(self, resource_name: str, scope: str, **kwargs: Any) -> _models.CurrentU return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages/{resourceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages/{resourceName}"} @distributed_trace def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentUsagesBase"]: @@ -203,10 +200,10 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.CurrentUsagesBase _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2023-02-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-03-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsagesLimits] + ) + cls: ClsType[_models.UsagesLimits] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -227,7 +224,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -243,7 +240,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -251,14 +248,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("UsagesLimits", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -271,4 +269,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Quota/usages"} diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_get_request_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_get_request_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py index 02d54d61e68b..4fde7d0afcf3 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_get_request_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_quota_limit.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_get_request_for_compute.py + python get_compute_one_sku_quota_limit.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuQuotaLimit.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py index bdf70dfab3bd..64f746472f1a 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_one_sku_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_usages_request_for_compute.py + python get_compute_one_sku_usages.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py similarity index 91% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py index 7d290a4f6568..d284c3e2b0d8 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_quota_limits.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_quota_limits_for_compute.py + python get_compute_quota_limits.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py index 0552d6f5c267..815041de4851 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_compute_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_usages_for_compute.py + python get_compute_usages.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_machine_learning_services.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py similarity index 90% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_machine_learning_services.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py index 57ce4c832376..a8f91d7cd129 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_machine_learning_services.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_quota_limits.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_quota_limits_machine_learning_services.py + python get_machine_learning_services_quota_limits.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_machine_learning_services.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py similarity index 90% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_machine_learning_services.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py index 86502ed40643..ce746ce70395 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_machine_learning_services.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_machine_learning_services_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_usages_machine_learning_services.py + python get_machine_learning_services_usages.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py new file mode 100644 index 000000000000..1fc02156d0cc --- /dev/null +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_quota_limit.py @@ -0,0 +1,40 @@ +# 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.quota import AzureQuotaExtensionAPI + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-quota +# USAGE + python get_network_one_sku_quota_limit.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 = AzureQuotaExtensionAPI( + credential=DefaultAzureCredential(), + ) + + response = client.quota.get( + resource_name="MinPublicIpInterNetworkPrefixLength", + scope="subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", + ) + print(response) + + +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json +if __name__ == "__main__": + main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_network.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_network.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py index 19de1a992299..75495c5cf149 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_usages_request_for_network.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_one_sku_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_usages_request_for_network.py + python get_network_one_sku_usages.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_network.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py similarity index 91% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_network.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py index db9fbfdc8215..c7261c380a00 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_quota_limits_for_network.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_quota_limits.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_quota_limits_for_network.py + python get_network_quota_limits.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkQuotaLimits.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkQuotaLimits.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_network.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_network.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py index 0716a9b087c1..a2ece77e5cd5 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_list_usages_for_network.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_network_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_list_usages_for_network.py + python get_network_usages.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkUsages.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkUsages.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py index 2927575fdab7..7a7451f5ae5e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_operations.py @@ -33,6 +33,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/GetOperations.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/GetOperations.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_status.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quota_request_status.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py index a22cf38c5b67..590f98379f3e 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_status.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_by_id.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quota_request_status.py + python get_quota_request_status_by_id.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusById.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusById.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_failed.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quota_request_failed.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py index 339a8e5f1cb5..8ae083c621f9 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_failed.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_failed.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quota_request_failed.py + python get_quota_request_status_failed.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusFailed.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusFailed.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_in_progress.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quota_request_in_progress.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py index 2bbaf8e2eef8..6846e1cae5b5 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_in_progress.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_request_status_in_progress.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quota_request_in_progress.py + python get_quota_request_status_in_progress.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, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusInProgress.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusInProgress.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_history.py b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py similarity index 92% rename from sdk/quota/azure-mgmt-quota/generated_samples/quota_request_history.py rename to sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py index 06e32ab0be02..7db51443a149 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quota_request_history.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/get_quota_requests_history.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quota_request_history.py + python get_quota_requests_history.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, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestsHistory.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestsHistory.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py similarity index 93% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py index f229db1138a9..118953a29e7f 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_compute_quota_request.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_request_patch_for_compute.py + python patch_compute_quota_request.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, @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchComputeQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchComputeQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_network.py b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py similarity index 93% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_network.py rename to sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py index 8f2c52a5a702..02c4db7372e0 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_patch_for_network.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/patch_network_one_sku_quota_request.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_request_patch_for_network.py + python patch_network_one_sku_quota_request.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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchNetworkOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_compute.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py similarity index 93% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_compute.py rename to sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py index 0ef2f5eb2be1..95c48b5b9ca0 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_compute.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_compute_one_sku_quota_request.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_put_request_for_compute.py + python put_compute_one_sku_quota_request.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, @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putComputeOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putComputeOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_for_machine_learning_services_low_priority_resource.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py similarity index 90% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_for_machine_learning_services_low_priority_resource.py rename to sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py index d0f725e0da96..63c658eab89f 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_request_for_machine_learning_services_low_priority_resource.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_machine_learning_services_quota_request_low_priority.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_request_for_machine_learning_services_low_priority_resource.py + python put_machine_learning_services_quota_request_low_priority.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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putMachineLearningServicesQuotaRequestLowPriority.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putMachineLearningServicesQuotaRequestLowPriority.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py similarity index 93% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network.py rename to sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py index 11ba83fc5a83..0bda73eadb06 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_put_request_for_network.py + python put_network_one_sku_quota_request.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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequest.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequest.json if __name__ == "__main__": main() diff --git a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network_standard_sku_public_ip_addresses_resource.py b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py similarity index 90% rename from sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network_standard_sku_public_ip_addresses_resource.py rename to sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py index 914eebb39965..eb7c1a2d85ad 100644 --- a/sdk/quota/azure-mgmt-quota/generated_samples/quotas_put_request_for_network_standard_sku_public_ip_addresses_resource.py +++ b/sdk/quota/azure-mgmt-quota/generated_samples/put_network_one_sku_quota_request_standard_sku_public_ip_addresses.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-quota # USAGE - python quotas_put_request_for_network_standard_sku_public_ip_addresses_resource.py + python put_network_one_sku_quota_request_standard_sku_public_ip_addresses.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, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json +# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json if __name__ == "__main__": main()