diff --git a/sdk/aks/azure-mgmt-devspaces/_meta.json b/sdk/aks/azure-mgmt-devspaces/_meta.json index 7e9f441d44b2..a5f7517f714b 100644 --- a/sdk/aks/azure-mgmt-devspaces/_meta.json +++ b/sdk/aks/azure-mgmt-devspaces/_meta.json @@ -1,11 +1,11 @@ { - "commit": "0c21115ccacbbad11c4aa13a711e4990ebf07752", + "commit": "5f678283f97887e5321bf46f8d43358fa3f0dc56", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.16", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/devspaces/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/devspaces/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.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/devspaces/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py index e65efe83f7e2..871df8946f3a 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/__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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_configuration.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_configuration.py index 3712b4353d28..5ca24232fa27 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_configuration.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_configuration.py @@ -42,7 +42,7 @@ class DevSpacesManagementClientConfiguration(Configuration): # pylint: disable= def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DevSpacesManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", "2019-04-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-devspaces/{}".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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_dev_spaces_management_client.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_dev_spaces_management_client.py index f054800f7f20..537c9e9bb553 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_dev_spaces_management_client.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_dev_spaces_management_client.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 DevSpacesManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ContainerHostMappingsOperations, ControllersOperations, Operations @@ -57,7 +57,7 @@ def __init__( ) self._client = 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 @@ -89,15 +89,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: () -> DevSpacesManagementClient + def __enter__(self) -> "DevSpacesManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_serialization.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_serialization.py index 7c1dedb5133d..f17c068e833e 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_serialization.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_vendor.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_vendor.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_version.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_version.py index dfa6ee022f15..e5754a47ce68 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_version.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/__init__.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/__init__.py index 094e72ffc49a..3f895c143d0d 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/__init__.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_configuration.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_configuration.py index 8b962874dc20..9722d4a0eba1 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_configuration.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_configuration.py @@ -42,7 +42,7 @@ class DevSpacesManagementClientConfiguration(Configuration): # pylint: disable= def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DevSpacesManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-04-01") # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", "2019-04-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_dev_spaces_management_client.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_dev_spaces_management_client.py index cb2f6b7e2428..1c30924c3b1e 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_dev_spaces_management_client.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/_dev_spaces_management_client.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 DevSpacesManagementClientConfiguration from .operations import ContainerHostMappingsOperations, ControllersOperations, Operations @@ -57,7 +57,7 @@ def __init__( ) self._client = 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 diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/__init__.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/__init__.py index f9273d5536d1..81dce0eeff8a 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/__init__.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/__init__.py @@ -11,7 +11,7 @@ from ._controllers_operations import ControllersOperations 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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_container_host_mappings_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_container_host_mappings_operations.py index e020b7d7c9a9..b19d2d8318bb 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_container_host_mappings_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_container_host_mappings_operations.py @@ -156,11 +156,11 @@ async def get_container_host_mapping( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ContainerHostMapping]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ContainerHostMapping]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -183,9 +183,9 @@ async def get_container_host_mapping( 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,4 +205,6 @@ async def get_container_host_mapping( return deserialized - get_container_host_mapping.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping"} # type: ignore + get_container_host_mapping.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping" + } diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_controllers_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_controllers_operations.py index 8b6fb8934b8c..cd4fd95324fa 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_controllers_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_controllers_operations.py @@ -94,10 +94,10 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -129,7 +129,9 @@ async def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _mode return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } async def _create_initial( self, resource_group_name: str, name: str, controller: Union[_models.Controller, IO], **kwargs: Any @@ -145,11 +147,11 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -172,9 +174,9 @@ async def _create_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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,11 +194,13 @@ async def _create_initial( deserialized = self._deserialize("Controller", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @overload async def begin_create( @@ -305,16 +309,16 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] - 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.Controller] = 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_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, name=name, controller=controller, @@ -334,7 +338,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -346,9 +350,11 @@ 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.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, name: str, **kwargs: Any @@ -364,10 +370,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -379,9 +385,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -395,7 +401,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -422,13 +430,13 @@ async def begin_delete(self, resource_group_name: str, name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -446,7 +454,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -458,9 +466,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- 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_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @overload async def update( @@ -564,11 +574,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -591,9 +601,9 @@ async def update( 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -611,11 +621,13 @@ async def update( deserialized = self._deserialize("Controller", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Controller"]: @@ -634,10 +646,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerList] + ) + cls: ClsType[_models.ControllerList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -659,7 +671,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 @@ -675,7 +687,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 @@ -683,13 +695,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ControllerList", 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -703,7 +715,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Controller"]: @@ -719,10 +733,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Controller"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerList] + ) + cls: ClsType[_models.ControllerList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -743,7 +757,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 @@ -759,7 +773,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 @@ -767,13 +781,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ControllerList", 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -787,7 +801,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers"} @overload async def list_connection_details( @@ -892,11 +906,11 @@ async def list_connection_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerConnectionDetailsList] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ControllerConnectionDetailsList] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -919,9 +933,9 @@ async def list_connection_details( 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -939,4 +953,6 @@ async def list_connection_details( return deserialized - list_connection_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails"} # type: ignore + list_connection_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails" + } diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_operations.py index 90b6fe2bd836..af23d71b8c10 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/aio/operations/_operations.py @@ -74,10 +74,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceProviderOperatio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + ) + cls: ClsType[_models.ResourceProviderOperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -97,7 +97,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 @@ -113,7 +113,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 @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,4 +140,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DevSpaces/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DevSpaces/operations"} diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py index 9e69731c4ff9..0253be0eab88 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py @@ -28,7 +28,7 @@ from ._dev_spaces_management_client_enums import SkuName from ._dev_spaces_management_client_enums import SkuTier 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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models_py3.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models_py3.py index 7fe7f0383503..c20512f46cee 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models_py3.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models_py3.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -17,7 +17,8 @@ class ContainerHostMapping(_serialization.Model): - """Container host mapping object specifying the Container host resource ID and its associated Controller resource. + """Container host mapping object specifying the Container host resource ID and its associated + Controller resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -36,7 +37,7 @@ class ContainerHostMapping(_serialization.Model): "mapped_controller_resource_id": {"key": "mappedControllerResourceId", "type": "str"}, } - def __init__(self, *, container_host_resource_id: Optional[str] = None, **kwargs): + def __init__(self, *, container_host_resource_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword container_host_resource_id: ARM ID of the Container Host resource. :paramtype container_host_resource_id: str @@ -71,7 +72,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -110,7 +111,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword tags: Tags for the Azure resource. :paramtype tags: dict[str, str] @@ -196,8 +197,8 @@ def __init__( target_container_host_credentials_base64: str, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Tags for the Azure resource. :paramtype tags: dict[str, str] @@ -241,8 +242,8 @@ def __init__( self, *, orchestrator_specific_connection_details: Optional["_models.OrchestratorSpecificConnectionDetails"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword orchestrator_specific_connection_details: Base class for types that supply values used to connect to container orchestrators. @@ -266,8 +267,8 @@ class ControllerConnectionDetailsList(_serialization.Model): } def __init__( - self, *, connection_details_list: Optional[List["_models.ControllerConnectionDetails"]] = None, **kwargs - ): + self, *, connection_details_list: Optional[List["_models.ControllerConnectionDetails"]] = None, **kwargs: Any + ) -> None: """ :keyword connection_details_list: List of Azure Dev Spaces Controller connection details. :paramtype connection_details_list: @@ -298,7 +299,7 @@ class ControllerList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Controller"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Controller"]] = None, **kwargs: Any) -> None: """ :keyword value: List of Azure Dev Spaces Controllers. :paramtype value: list[~azure.mgmt.devspaces.models.Controller] @@ -331,8 +332,8 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, target_container_host_credentials_base64: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Tags for the Azure Dev Spaces Controller. :paramtype tags: dict[str, str] @@ -346,7 +347,8 @@ def __init__( class DevSpacesErrorResponse(_serialization.Model): - """Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. + """Error response indicates that the service is not able to process the incoming request. The + reason is provided in the error message. :ivar error: The details of the error. :vartype error: ~azure.mgmt.devspaces.models.ErrorDetails @@ -356,7 +358,7 @@ class DevSpacesErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetails"}, } - def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetails"] = None, **kwargs: Any) -> None: """ :keyword error: The details of the error. :paramtype error: ~azure.mgmt.devspaces.models.ErrorDetails @@ -390,7 +392,7 @@ class ErrorDetails(_serialization.Model): "target": {"key": "target", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -422,10 +424,10 @@ class OrchestratorSpecificConnectionDetails(_serialization.Model): _subtype_map = {"instance_type": {"Kubernetes": "KubernetesConnectionDetails"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.instance_type = None # type: Optional[str] + self.instance_type: Optional[str] = None class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): @@ -450,13 +452,13 @@ class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): "kube_config": {"key": "kubeConfig", "type": "str"}, } - def __init__(self, *, kube_config: Optional[str] = None, **kwargs): + def __init__(self, *, kube_config: Optional[str] = None, **kwargs: Any) -> None: """ :keyword kube_config: Gets the kubeconfig for the cluster. :paramtype kube_config: str """ super().__init__(**kwargs) - self.instance_type = "Kubernetes" # type: str + self.instance_type: str = "Kubernetes" self.kube_config = kube_config @@ -478,7 +480,7 @@ class ListConnectionDetailsParameters(_serialization.Model): "target_container_host_resource_id": {"key": "targetContainerHostResourceId", "type": "str"}, } - def __init__(self, *, target_container_host_resource_id: str, **kwargs): + def __init__(self, *, target_container_host_resource_id: str, **kwargs: Any) -> None: """ :keyword target_container_host_resource_id: Resource ID of the target container host mapped to the Azure Dev Spaces Controller. Required. @@ -507,8 +509,8 @@ def __init__( *, name: Optional[str] = None, display: Optional["_models.ResourceProviderOperationDisplay"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Resource provider operation name. :paramtype name: str @@ -547,8 +549,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: Name of the resource provider. :paramtype provider: str @@ -587,7 +589,9 @@ class ResourceProviderOperationList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ResourceProviderOperationDefinition"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.ResourceProviderOperationDefinition"]] = None, **kwargs: Any + ) -> None: """ :keyword value: Resource provider operations list. :paramtype value: list[~azure.mgmt.devspaces.models.ResourceProviderOperationDefinition] @@ -618,8 +622,12 @@ class Sku(_serialization.Model): } def __init__( - self, *, name: Union[str, "_models.SkuName"], tier: Optional[Union[str, "_models.SkuTier"]] = None, **kwargs - ): + self, + *, + name: Union[str, "_models.SkuName"], + tier: Optional[Union[str, "_models.SkuTier"]] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the SKU for Azure Dev Spaces Controller. Required. "S1" :paramtype name: str or ~azure.mgmt.devspaces.models.SkuName diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py index f9273d5536d1..81dce0eeff8a 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py @@ -11,7 +11,7 @@ from ._controllers_operations import ControllersOperations 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/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_container_host_mappings_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_container_host_mappings_operations.py index 079873f49795..0937bc6778c6 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_container_host_mappings_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_container_host_mappings_operations.py @@ -45,8 +45,8 @@ def build_get_container_host_mapping_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", "2019-04-01")) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_get_container_host_mapping_request( "location": _SERIALIZER.url("location", location, "str"), } - _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") @@ -195,11 +195,11 @@ def get_container_host_mapping( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ContainerHostMapping]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ContainerHostMapping]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -222,9 +222,9 @@ def get_container_host_mapping( 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -244,4 +244,6 @@ def get_container_host_mapping( return deserialized - get_container_host_mapping.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping"} # type: ignore + get_container_host_mapping.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/locations/{location}/checkContainerHostMapping" + } diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_controllers_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_controllers_operations.py index c9abf8ca87a4..3b62a2bdcb03 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_controllers_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_controllers_operations.py @@ -47,7 +47,7 @@ def build_get_request(resource_group_name: str, name: str, subscription_id: str, _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", "2019-04-01")) # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request(resource_group_name: str, name: str, subscription_id: str, ), } - _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") @@ -80,8 +80,8 @@ def build_create_request(resource_group_name: str, name: str, subscription_id: s _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", "2019-04-01")) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_create_request(resource_group_name: str, name: str, subscription_id: s ), } - _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") @@ -116,7 +116,7 @@ def build_delete_request(resource_group_name: str, name: str, subscription_id: s _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", "2019-04-01")) # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_delete_request(resource_group_name: str, name: str, subscription_id: s ), } - _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") @@ -149,8 +149,8 @@ def build_update_request(resource_group_name: str, name: str, subscription_id: s _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", "2019-04-01")) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +168,7 @@ def build_update_request(resource_group_name: str, name: str, subscription_id: s ), } - _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") @@ -185,7 +185,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2019-04-01")) # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _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") @@ -215,7 +215,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +224,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _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") @@ -241,8 +241,8 @@ def build_list_connection_details_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", "2019-04-01")) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -260,7 +260,7 @@ def build_list_connection_details_request( ), } - _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") @@ -318,10 +318,10 @@ def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _models.Con _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -333,9 +333,9 @@ def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _models.Con 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -353,7 +353,9 @@ def get(self, resource_group_name: str, name: str, **kwargs: Any) -> _models.Con return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } def _create_initial( self, resource_group_name: str, name: str, controller: Union[_models.Controller, IO], **kwargs: Any @@ -369,11 +371,11 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -396,9 +398,9 @@ def _create_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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -416,11 +418,13 @@ def _create_initial( deserialized = self._deserialize("Controller", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @overload def begin_create( @@ -526,16 +530,16 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] - 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.Controller] = 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_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, name=name, controller=controller, @@ -555,7 +559,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -567,9 +571,11 @@ 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.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, name: str, **kwargs: Any @@ -585,10 +591,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -600,9 +606,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -616,7 +622,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @distributed_trace def begin_delete(self, resource_group_name: str, name: str, **kwargs: Any) -> LROPoller[None]: @@ -643,13 +651,13 @@ def begin_delete(self, resource_group_name: str, name: str, **kwargs: Any) -> LR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -667,7 +675,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -679,9 +687,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- 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_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @overload def update( @@ -785,11 +795,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Controller] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Controller] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -812,9 +822,9 @@ def update( 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -832,11 +842,13 @@ def update( deserialized = self._deserialize("Controller", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Controller"]: @@ -855,10 +867,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerList] + ) + cls: ClsType[_models.ControllerList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -880,7 +892,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 @@ -896,7 +908,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 @@ -904,13 +916,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ControllerList", 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -924,7 +936,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Controller"]: @@ -940,10 +954,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Controller"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerList] + ) + cls: ClsType[_models.ControllerList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -964,7 +978,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 @@ -980,7 +994,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 @@ -988,13 +1002,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ControllerList", 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1008,7 +1022,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers"} @overload def list_connection_details( @@ -1113,11 +1127,11 @@ def list_connection_details( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ControllerConnectionDetailsList] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ControllerConnectionDetailsList] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1140,9 +1154,9 @@ def list_connection_details( 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1160,4 +1174,6 @@ def list_connection_details( return deserialized - list_connection_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails"} # type: ignore + list_connection_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails" + } diff --git a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_operations.py b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_operations.py index 8543e5cc2663..36cc8244c203 100644 --- a/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_operations.py +++ b/sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/_operations.py @@ -45,7 +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", "2019-04-01")) # type: Literal["2019-04-01"] + api_version: Literal["2019-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,10 +96,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceProviderOperationDefi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-04-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2019-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ResourceProviderOperationList] + ) + cls: ClsType[_models.ResourceProviderOperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -119,7 +119,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 @@ -135,7 +135,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 @@ -143,13 +143,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ResourceProviderOperationList", 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -162,4 +162,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DevSpaces/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DevSpaces/operations"} diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping_example.py similarity index 96% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping_example.py index 353084cd0dc6..925b8e28b0f2 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/container_host_mappings_get_container_host_mapping_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python container_host_mappings_get_container_host_mapping.py + python container_host_mappings_get_container_host_mapping_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create_example.py similarity index 98% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create_example.py index 5bec968d70d7..4baa66606a1b 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_create_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_create.py + python controllers_create_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete_example.py similarity index 97% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete_example.py index a3b347c7ec3b..0cbe9418b2d6 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_delete_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_delete.py + python controllers_delete_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get_example.py similarity index 97% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get_example.py index 560d4d01d91a..0e4416f188e8 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_get_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_get.py + python controllers_get_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group_example.py similarity index 96% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group_example.py index a9d3d1e96a6e..db34abd0c650 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_by_resource_group_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_list_by_resource_group.py + python controllers_list_by_resource_group_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details_example.py similarity index 96% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details_example.py index 7de52472e84e..78e4f3df6408 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_connection_details_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_list_connection_details.py + python controllers_list_connection_details_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_example.py similarity index 97% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_example.py index d9bde7e62994..47bb540ea43a 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_list_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_list.py + python controllers_list_example.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, diff --git a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update.py b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update_example.py similarity index 97% rename from sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update.py rename to sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update_example.py index 23b738c0efed..a1df720da05c 100644 --- a/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update.py +++ b/sdk/aks/azure-mgmt-devspaces/generated_samples/controllers_update_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devspaces # USAGE - python controllers_update.py + python controllers_update_example.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,