diff --git a/sdk/devcenter/azure-mgmt-devcenter/_meta.json b/sdk/devcenter/azure-mgmt-devcenter/_meta.json index c2348743f92a..6577189d9d3a 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/_meta.json +++ b/sdk/devcenter/azure-mgmt-devcenter/_meta.json @@ -1,11 +1,11 @@ { - "commit": "b1780623ffb2d4c719c2a62878930d317522290d", + "commit": "911860854666a1b6b921da666683c7f1ee9ee083", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.4.8", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/devcenter/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/devcenter/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/devcenter/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/__init__.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/__init__.py index 51bb82fc2891..d5344203a45b 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/__init__.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/__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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_configuration.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_configuration.py index 973e6e9b92e7..22f51d35a5c1 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_configuration.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -35,14 +29,14 @@ class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-ma :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-11-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DevCenterMgmtClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-11-11-preview") # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", "2023-04-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-devcenter/{}".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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_mgmt_client.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_mgmt_client.py index d0ba9f033617..33d46ddb6fab 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_mgmt_client.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_dev_center_mgmt_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 DevCenterMgmtClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -92,8 +92,8 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-11-11-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -109,9 +109,9 @@ def __init__( self._config = DevCenterMgmtClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -173,15 +173,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: () -> DevCenterMgmtClient + def __enter__(self) -> "DevCenterMgmtClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_serialization.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_serialization.py index 7c1dedb5133d..842ae727fbbc 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_serialization.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_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 @@ -605,14 +629,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + 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 @@ -1245,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1269,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_vendor.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_vendor.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_version.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_version.py index 8d50297ac8eb..e5754a47ce68 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_version.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b4" +VERSION = "1.0.0b1" diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/__init__.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/__init__.py index b3e56c6d14df..8f652945205e 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/__init__.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_configuration.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_configuration.py index f37f859e2f12..512133dd4369 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_configuration.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -35,14 +29,14 @@ class DevCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-ma :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-11-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(DevCenterMgmtClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-11-11-preview") # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", "2023-04-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_mgmt_client.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_mgmt_client.py index 0aa460d5f19c..775c83454e1d 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_mgmt_client.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/_dev_center_mgmt_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 DevCenterMgmtClientConfiguration from .operations import ( @@ -92,8 +92,8 @@ class DevCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-11-11-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-04-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -109,9 +109,9 @@ def __init__( self._config = DevCenterMgmtClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -180,5 +180,5 @@ async def __aenter__(self) -> "DevCenterMgmtClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/__init__.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/__init__.py index 18acac80c10d..8db3786da467 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/__init__.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/__init__.py @@ -27,7 +27,7 @@ from ._network_connections_operations import NetworkConnectionsOperations 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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_attached_networks_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_attached_networks_operations.py index efcae37954da..64ab46125909 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_attached_networks_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_attached_networks_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +39,6 @@ build_list_by_project_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,10 +86,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,7 +111,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -134,7 +127,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -142,14 +135,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AttachedNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -161,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks" + } @distributed_trace_async async def get_by_project( @@ -192,10 +188,8 @@ async def get_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) request = build_get_by_project_request( resource_group_name=resource_group_name, @@ -208,10 +202,11 @@ async def get_by_project( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -227,7 +222,9 @@ async def get_by_project( return deserialized - get_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + get_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks/{attachedNetworkConnectionName}" + } @distributed_trace def list_by_dev_center( @@ -253,10 +250,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -280,7 +275,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 @@ -296,7 +291,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 @@ -304,14 +299,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AttachedNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -323,7 +319,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks" + } @distributed_trace_async async def get_by_dev_center( @@ -354,10 +352,8 @@ async def get_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) request = build_get_by_dev_center_request( resource_group_name=resource_group_name, @@ -370,10 +366,11 @@ async def get_by_dev_center( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -389,7 +386,9 @@ async def get_by_dev_center( return deserialized - get_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + get_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } async def _create_or_update_initial( self, @@ -410,11 +409,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -438,10 +435,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -457,7 +455,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } @overload async def begin_create_or_update( @@ -557,8 +557,8 @@ async def begin_create_or_update( :type dev_center_name: str :param attached_network_connection_name: The name of the attached NetworkConnection. Required. :type attached_network_connection_name: str - :param body: Represents an attached NetworkConnection. Is either a model type or a IO type. - Required. + :param body: Represents an attached NetworkConnection. Is either a AttachedNetworkConnection + type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.AttachedNetworkConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -580,16 +580,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, attached_network_connection_name=attached_network_connection_name, @@ -610,10 +608,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -625,9 +623,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, attached_network_connection_name: str, **kwargs: Any @@ -643,10 +643,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -659,10 +657,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -674,7 +673,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.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -704,13 +705,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -729,10 +728,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -744,6 +743,8 @@ 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.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_catalogs_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_catalogs_operations.py index 676cd3d686df..f83b9b9e6372 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_catalogs_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_catalogs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,10 +84,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CatalogListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.CatalogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +109,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 @@ -132,7 +125,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 @@ -140,14 +133,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CatalogListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,7 +153,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs" + } @distributed_trace_async async def get( @@ -190,10 +186,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -206,10 +200,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -225,7 +220,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } async def _create_or_update_initial( self, @@ -246,11 +243,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -274,10 +269,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -293,7 +289,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @overload async def begin_create_or_update( @@ -391,7 +389,7 @@ async def begin_create_or_update( :type dev_center_name: str :param catalog_name: The name of the Catalog. Required. :type catalog_name: str - :param body: Represents a catalog. Is either a model type or a IO type. Required. + :param body: Represents a catalog. Is either a Catalog type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Catalog or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -412,16 +410,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, catalog_name=catalog_name, @@ -442,10 +438,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -457,9 +453,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } async def _update_initial( self, @@ -480,11 +478,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Catalog]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Catalog]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -508,10 +504,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -529,7 +526,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @overload async def begin_update( @@ -627,7 +626,8 @@ async def begin_update( :type dev_center_name: str :param catalog_name: The name of the Catalog. Required. :type catalog_name: str - :param body: Updatable catalog properties. Is either a model type or a IO type. Required. + :param body: Updatable catalog properties. Is either a CatalogUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.CatalogUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -648,16 +648,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, catalog_name=catalog_name, @@ -678,10 +676,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -693,9 +691,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, catalog_name: str, **kwargs: Any @@ -711,10 +711,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -727,10 +725,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -742,7 +741,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.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @distributed_trace_async async def begin_delete( @@ -772,13 +773,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -797,10 +796,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -812,9 +811,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.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } async def _sync_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, catalog_name: str, **kwargs: Any @@ -830,10 +831,8 @@ async def _sync_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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_sync_request( resource_group_name=resource_group_name, @@ -846,10 +845,11 @@ async def _sync_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -861,7 +861,9 @@ async def _sync_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _sync_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync"} # type: ignore + _sync_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync" + } @distributed_trace_async async def begin_sync( @@ -891,13 +893,11 @@ async def begin_sync( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._sync_initial( # type: ignore resource_group_name=resource_group_name, @@ -916,10 +916,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -931,6 +931,8 @@ 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_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync"} # type: ignore + begin_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_check_name_availability_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_check_name_availability_operations.py index 3e01e4ea8fb8..e4fe8d62e2ee 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_check_name_availability_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_check_name_availability_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._check_name_availability_operations import build_execute_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +97,7 @@ async def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.devcenter.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -124,11 +119,9 @@ async def execute( _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", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -149,10 +142,11 @@ async def execute( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -169,4 +163,4 @@ async def execute( return deserialized - execute.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/checkNameAvailability"} # type: ignore + execute.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/checkNameAvailability"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_box_definitions_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_box_definitions_operations.py index 96240fe0effa..9032ec8d1bfc 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_box_definitions_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_box_definitions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,10 +40,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,10 +85,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinitionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,7 +110,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 @@ -133,7 +126,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 @@ -141,14 +134,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DevBoxDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -160,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions" + } @distributed_trace_async async def get( @@ -191,10 +187,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -207,10 +201,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -226,7 +221,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } async def _create_or_update_initial( self, @@ -247,11 +244,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -275,10 +270,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -294,11 +290,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("DevBoxDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @overload async def begin_create_or_update( @@ -396,7 +394,8 @@ async def begin_create_or_update( :type dev_center_name: str :param dev_box_definition_name: The name of the Dev Box definition. Required. :type dev_box_definition_name: str - :param body: Represents a Dev Box definition. Is either a model type or a IO type. Required. + :param body: Represents a Dev Box definition. Is either a DevBoxDefinition type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.DevBoxDefinition or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -417,16 +416,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, dev_box_definition_name=dev_box_definition_name, @@ -447,10 +444,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -462,9 +459,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } async def _update_initial( self, @@ -485,11 +484,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DevBoxDefinition]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DevBoxDefinition]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -513,10 +510,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -534,7 +532,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @overload async def begin_update( @@ -632,7 +632,8 @@ async def begin_update( :type dev_center_name: str :param dev_box_definition_name: The name of the Dev Box definition. Required. :type dev_box_definition_name: str - :param body: Represents a Dev Box definition. Is either a model type or a IO type. Required. + :param body: Represents a Dev Box definition. Is either a DevBoxDefinitionUpdate type or a IO + type. Required. :type body: ~azure.mgmt.devcenter.models.DevBoxDefinitionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -653,16 +654,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, dev_box_definition_name=dev_box_definition_name, @@ -683,10 +682,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -698,9 +697,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, dev_box_definition_name: str, **kwargs: Any @@ -716,10 +717,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -732,10 +731,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -747,7 +747,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.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @distributed_trace_async async def begin_delete( @@ -777,13 +779,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -802,10 +802,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -817,9 +817,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.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @distributed_trace def list_by_project( @@ -843,10 +845,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinitionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -870,7 +870,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 @@ -886,7 +886,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 @@ -894,14 +894,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DevBoxDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -913,7 +914,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions" + } @distributed_trace_async async def get_by_project( @@ -944,10 +947,8 @@ async def get_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) request = build_get_by_project_request( resource_group_name=resource_group_name, @@ -960,10 +961,11 @@ async def get_by_project( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -979,4 +981,6 @@ async def get_by_project( return deserialized - get_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + get_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions/{devBoxDefinitionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_centers_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_centers_operations.py index abf22d3eb727..aecfb67cd4d8 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_centers_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_dev_centers_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,10 +77,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Asyn _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenterListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +100,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 @@ -123,7 +116,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 @@ -131,14 +124,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DevCenterListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -150,7 +144,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/devcenters"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/devcenters"} @distributed_trace def list_by_resource_group( @@ -172,10 +166,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenterListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,7 +190,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 @@ -214,7 +206,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 @@ -222,14 +214,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DevCenterListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,7 +234,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.DevCenter/devcenters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters" + } @distributed_trace_async async def get(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> _models.DevCenter: @@ -268,10 +263,8 @@ async def get(self, resource_group_name: str, dev_center_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -283,10 +276,11 @@ async def get(self, resource_group_name: str, dev_center_name: str, **kwargs: An params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,7 +296,9 @@ async def get(self, resource_group_name: str, dev_center_name: str, **kwargs: An return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } async def _create_or_update_initial( self, resource_group_name: str, dev_center_name: str, body: Union[_models.DevCenter, IO], **kwargs: Any @@ -318,11 +314,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -345,10 +339,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -364,11 +359,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("DevCenter", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @overload async def begin_create_or_update( @@ -453,7 +450,7 @@ async def begin_create_or_update( :type resource_group_name: str :param dev_center_name: The name of the devcenter. Required. :type dev_center_name: str - :param body: Represents a devcenter. Is either a model type or a IO type. Required. + :param body: Represents a devcenter. Is either a DevCenter type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.DevCenter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -474,16 +471,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, body=body, @@ -503,10 +498,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -518,9 +513,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } async def _update_initial( self, resource_group_name: str, dev_center_name: str, body: Union[_models.DevCenterUpdate, IO], **kwargs: Any @@ -536,11 +533,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DevCenter]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DevCenter]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -563,10 +558,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +580,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @overload async def begin_update( @@ -669,7 +667,8 @@ async def begin_update( :type resource_group_name: str :param dev_center_name: The name of the devcenter. Required. :type dev_center_name: str - :param body: Updatable devcenter properties. Is either a model type or a IO type. Required. + :param body: Updatable devcenter properties. Is either a DevCenterUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.DevCenterUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -690,16 +689,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, body=body, @@ -719,10 +716,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -734,9 +731,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, **kwargs: Any @@ -752,10 +751,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -767,10 +764,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -782,7 +780,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.DevCenter/devcenters/{devCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -808,13 +808,11 @@ async def begin_delete(self, resource_group_name: str, dev_center_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -832,10 +830,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -847,6 +845,8 @@ 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.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_environment_types_operations.py index 98cbd0320100..3d8dc32f3813 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,10 +36,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,10 +81,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.EnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,7 +106,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 @@ -129,7 +122,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 @@ -137,14 +130,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("EnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -156,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes" + } @distributed_trace_async async def get( @@ -187,10 +183,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -203,10 +197,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,7 +217,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @overload async def create_or_update( @@ -304,7 +301,8 @@ async def create_or_update( :type dev_center_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Represents an Environment Type. Is either a model type or a IO type. Required. + :param body: Represents an Environment Type. Is either a EnvironmentType type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.EnvironmentType or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -325,11 +323,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -353,10 +349,11 @@ async def create_or_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -372,7 +369,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @overload async def update( @@ -454,8 +453,8 @@ async def update( :type dev_center_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Updatable environment type properties. Is either a model type or a IO type. - Required. + :param body: Updatable environment type properties. Is either a EnvironmentTypeUpdate type or a + IO type. Required. :type body: ~azure.mgmt.devcenter.models.EnvironmentTypeUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -476,11 +475,9 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -504,10 +501,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -523,7 +521,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -554,10 +554,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -570,10 +568,11 @@ async def delete( # 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -585,4 +584,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_galleries_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_galleries_operations.py index 8364419ee56c..756d74f0cf65 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_galleries_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_galleries_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -38,10 +37,6 @@ build_list_by_dev_center_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,10 +82,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GalleryListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,7 +107,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 @@ -130,7 +123,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 @@ -138,14 +131,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GalleryListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -157,7 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries" + } @distributed_trace_async async def get( @@ -188,10 +184,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -204,10 +198,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -223,7 +218,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } async def _create_or_update_initial( self, @@ -244,11 +241,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -272,10 +267,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,7 +287,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } @overload async def begin_create_or_update( @@ -389,7 +387,7 @@ async def begin_create_or_update( :type dev_center_name: str :param gallery_name: The name of the gallery. Required. :type gallery_name: str - :param body: Represents a gallery. Is either a model type or a IO type. Required. + :param body: Represents a gallery. Is either a Gallery type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Gallery or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -410,16 +408,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, gallery_name=gallery_name, @@ -440,10 +436,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -455,9 +451,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, gallery_name: str, **kwargs: Any @@ -473,10 +471,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -489,10 +485,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -504,7 +501,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.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } @distributed_trace_async async def begin_delete( @@ -534,13 +533,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -559,10 +556,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -574,6 +571,8 @@ 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.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_image_versions_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_image_versions_operations.py index 4495e2a4d054..707674105e5c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_image_versions_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_image_versions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._image_versions_operations import build_get_request, build_list_by_image_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,10 +76,8 @@ def list_by_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageVersionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,7 +102,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 @@ -125,7 +118,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 @@ -133,14 +126,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ImageVersionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_image.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions"} # type: ignore + list_by_image.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions" + } @distributed_trace_async async def get( @@ -193,10 +189,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageVersion] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -211,10 +205,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,4 +225,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_images_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_images_operations.py index 4fe7422058a6..bdaa53a47e3f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_images_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_images_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -35,10 +34,6 @@ build_list_by_gallery_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,10 +79,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,7 +104,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 @@ -127,7 +120,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 @@ -135,14 +128,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ImageListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -154,7 +148,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images" + } @distributed_trace def list_by_gallery( @@ -185,10 +181,8 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -213,7 +207,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 @@ -229,7 +223,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 @@ -237,14 +231,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ImageListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -256,7 +251,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images"} # type: ignore + list_by_gallery.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images" + } @distributed_trace_async async def get( @@ -289,10 +286,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Image] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,10 +301,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -325,4 +321,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_network_connections_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_network_connections_operations.py index 9028a2dcd0b0..25e068088219 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_network_connections_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_network_connections_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,14 +38,11 @@ build_list_by_resource_group_request, build_list_by_subscription_request, build_list_health_details_request, + build_list_outbound_network_dependencies_endpoints_request, build_run_health_checks_request, build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,10 +83,8 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnectionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,7 +106,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 @@ -128,7 +122,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 @@ -136,14 +130,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("NetworkConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -155,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections" + } @distributed_trace def list_by_resource_group( @@ -177,10 +174,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnectionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -203,7 +198,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 @@ -219,7 +214,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 @@ -227,14 +222,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("NetworkConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -246,7 +242,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.DevCenter/networkConnections"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections" + } @distributed_trace_async async def get( @@ -276,10 +274,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -291,10 +287,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -310,7 +307,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } async def _create_or_update_initial( self, @@ -330,11 +329,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -357,10 +354,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -376,11 +374,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("NetworkConnection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @overload async def begin_create_or_update( @@ -472,7 +472,8 @@ async def begin_create_or_update( :param network_connection_name: Name of the Network Connection that can be applied to a Pool. Required. :type network_connection_name: str - :param body: Represents network connection. Is either a model type or a IO type. Required. + :param body: Represents network connection. Is either a NetworkConnection type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.NetworkConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -493,16 +494,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, network_connection_name=network_connection_name, body=body, @@ -522,10 +521,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -537,9 +536,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } async def _update_initial( self, @@ -559,11 +560,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.NetworkConnection]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -586,10 +585,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -607,7 +607,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @overload async def begin_update( @@ -699,7 +701,8 @@ async def begin_update( :param network_connection_name: Name of the Network Connection that can be applied to a Pool. Required. :type network_connection_name: str - :param body: Represents network connection. Is either a model type or a IO type. Required. + :param body: Represents network connection. Is either a NetworkConnectionUpdate type or a IO + type. Required. :type body: ~azure.mgmt.devcenter.models.NetworkConnectionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -720,16 +723,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, network_connection_name=network_connection_name, body=body, @@ -749,10 +750,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -764,9 +765,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, network_connection_name: str, **kwargs: Any @@ -782,10 +785,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -797,10 +798,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -812,7 +814,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.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -841,13 +845,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -865,10 +867,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -880,9 +882,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.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @distributed_trace def list_health_details( @@ -909,10 +913,8 @@ def list_health_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.HealthCheckStatusDetailsListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.HealthCheckStatusDetailsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -936,7 +938,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 @@ -952,7 +954,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 @@ -960,14 +962,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("HealthCheckStatusDetailsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -979,7 +982,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_health_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks"} # type: ignore + list_health_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks" + } @distributed_trace_async async def get_health_details( @@ -1009,10 +1014,8 @@ async def get_health_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.HealthCheckStatusDetails] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.HealthCheckStatusDetails] = kwargs.pop("cls", None) request = build_get_health_details_request( resource_group_name=resource_group_name, @@ -1024,10 +1027,11 @@ async def get_health_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1043,7 +1047,9 @@ async def get_health_details( return deserialized - get_health_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest"} # type: ignore + get_health_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest" + } async def _run_health_checks_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, network_connection_name: str, **kwargs: Any @@ -1059,10 +1065,8 @@ async def _run_health_checks_initial( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_health_checks_request( resource_group_name=resource_group_name, @@ -1074,10 +1078,11 @@ async def _run_health_checks_initial( # pylint: disable=inconsistent-return-sta params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1089,7 +1094,9 @@ async def _run_health_checks_initial( # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) - _run_health_checks_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks"} # type: ignore + _run_health_checks_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks" + } @distributed_trace_async async def begin_run_health_checks( @@ -1119,13 +1126,11 @@ async def begin_run_health_checks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._run_health_checks_initial( # type: ignore resource_group_name=resource_group_name, @@ -1143,10 +1148,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1158,6 +1163,107 @@ 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_run_health_checks.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks" + } + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, network_connection_name: str, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: + """Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs + should be allowed for outbound access in order for the Dev Box service to function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_connection_name: Name of the Network Connection that can be applied to a Pool. + Required. + :type network_connection_name: str + :param top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.devcenter.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + network_connection_name=network_connection_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "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) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) - begin_run_health_checks.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks"} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/outboundNetworkDependenciesEndpoints" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operation_statuses_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operation_statuses_operations.py index 819301f2933c..3bf1bda37f16 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operation_statuses_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operation_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._operation_statuses_operations import build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,10 +76,8 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -96,10 +89,11 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models. params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -115,8 +109,10 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models. deserialized = self._deserialize("OperationStatus", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operations.py index fff943446067..891c4b1d18ad 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,10 +64,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -92,7 +85,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 @@ -108,7 +101,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 @@ -116,14 +109,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -135,4 +129,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DevCenter/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DevCenter/operations"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_pools_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_pools_operations.py index d345f2c7f4cc..5d05d0e79d8a 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_pools_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_pools_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,13 +35,10 @@ build_delete_request, build_get_request, build_list_by_project_request, + build_run_health_checks_request, build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,10 +84,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PoolListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.PoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +109,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 @@ -131,7 +125,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 @@ -139,14 +133,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("PoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -158,7 +153,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools" + } @distributed_trace_async async def get(self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any) -> _models.Pool: @@ -187,10 +184,8 @@ async def get(self, resource_group_name: str, project_name: str, pool_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -203,10 +198,11 @@ async def get(self, resource_group_name: str, project_name: str, pool_name: str, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,7 +218,9 @@ async def get(self, resource_group_name: str, project_name: str, pool_name: str, return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } async def _create_or_update_initial( self, resource_group_name: str, project_name: str, pool_name: str, body: Union[_models.Pool, IO], **kwargs: Any @@ -238,11 +236,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -266,10 +262,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -285,11 +282,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("Pool", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @overload async def begin_create_or_update( @@ -380,7 +379,7 @@ async def begin_create_or_update( :type project_name: str :param pool_name: Name of the pool. Required. :type pool_name: str - :param body: Represents a machine pool. Is either a model type or a IO type. Required. + :param body: Represents a machine pool. Is either a Pool type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Pool or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -400,16 +399,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -430,10 +427,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -445,9 +442,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } async def _update_initial( self, @@ -468,11 +467,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Pool]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Pool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -496,10 +493,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -517,7 +515,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @overload async def begin_update( @@ -613,7 +613,7 @@ async def begin_update( :type project_name: str :param pool_name: Name of the pool. Required. :type pool_name: str - :param body: Represents a machine pool. Is either a model type or a IO type. Required. + :param body: Represents a machine pool. Is either a PoolUpdate type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.PoolUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -633,16 +633,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -663,10 +661,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -678,9 +676,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any @@ -696,10 +696,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -712,10 +710,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -727,7 +726,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.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @distributed_trace_async async def begin_delete( @@ -757,13 +758,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -782,10 +781,130 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } + + async def _run_health_checks_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_run_health_checks_request( + resource_group_name=resource_group_name, + project_name=project_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._run_health_checks_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _run_health_checks_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/runHealthChecks" + } + + @distributed_trace_async + async def begin_run_health_checks( + self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Triggers a refresh of the pool status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param project_name: The name of the project. Required. + :type project_name: str + :param pool_name: Name of the pool. Required. + :type pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._run_health_checks_initial( # type: ignore + resource_group_name=resource_group_name, + project_name=project_name, + pool_name=pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -797,6 +916,8 @@ 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.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + begin_run_health_checks.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/runHealthChecks" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_allowed_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_allowed_environment_types_operations.py index 6fce45105f94..722f3baccc4f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_allowed_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_allowed_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._project_allowed_environment_types_operations import build_get_request, build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,10 +77,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedEnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AllowedEnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,7 +102,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 @@ -125,7 +118,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 @@ -133,14 +126,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AllowedEnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -152,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes" + } @distributed_trace_async async def get( @@ -183,10 +179,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AllowedEnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,10 +193,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -218,4 +213,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_environment_types_operations.py index 5f08042e7385..6f08654efa29 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_project_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -37,10 +36,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,10 +83,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectEnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +108,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 @@ -131,7 +124,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 @@ -139,14 +132,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ProjectEnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -158,7 +152,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes" + } @distributed_trace_async async def get( @@ -189,10 +185,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -205,10 +199,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,7 +219,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @overload async def create_or_update( @@ -306,8 +303,8 @@ async def create_or_update( :type project_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Represents a Project Environment Type. Is either a model type or a IO type. - Required. + :param body: Represents a Project Environment Type. Is either a ProjectEnvironmentType type or + a IO type. Required. :type body: ~azure.mgmt.devcenter.models.ProjectEnvironmentType or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -328,11 +325,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -356,10 +351,11 @@ async def create_or_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,7 +371,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @overload async def update( @@ -457,8 +455,8 @@ async def update( :type project_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Updatable project environment type properties. Is either a model type or a IO - type. Required. + :param body: Updatable project environment type properties. Is either a + ProjectEnvironmentTypeUpdate type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.ProjectEnvironmentTypeUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -479,11 +477,9 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -507,10 +503,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -526,7 +523,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -557,10 +556,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -573,10 +570,11 @@ async def delete( # 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -588,4 +586,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_projects_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_projects_operations.py index 7d6faeec56a8..29a9ec33c387 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_projects_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_projects_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,10 +77,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Asyn _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +100,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 @@ -123,7 +116,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 @@ -131,14 +124,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ProjectListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -150,7 +144,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/projects"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/projects"} @distributed_trace def list_by_resource_group( @@ -172,10 +166,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,7 +190,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 @@ -214,7 +206,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 @@ -222,14 +214,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ProjectListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -241,7 +234,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.DevCenter/projects"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects" + } @distributed_trace_async async def get(self, resource_group_name: str, project_name: str, **kwargs: Any) -> _models.Project: @@ -268,10 +263,8 @@ async def get(self, resource_group_name: str, project_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -283,10 +276,11 @@ async def get(self, resource_group_name: str, project_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,7 +296,9 @@ async def get(self, resource_group_name: str, project_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } async def _create_or_update_initial( self, resource_group_name: str, project_name: str, body: Union[_models.Project, IO], **kwargs: Any @@ -318,11 +314,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -345,10 +339,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -364,11 +359,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("Project", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @overload async def begin_create_or_update( @@ -453,7 +450,7 @@ async def begin_create_or_update( :type resource_group_name: str :param project_name: The name of the project. Required. :type project_name: str - :param body: Represents a project. Is either a model type or a IO type. Required. + :param body: Represents a project. Is either a Project type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Project or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -474,16 +471,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, body=body, @@ -503,10 +498,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -518,9 +513,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } async def _update_initial( self, resource_group_name: str, project_name: str, body: Union[_models.ProjectUpdate, IO], **kwargs: Any @@ -536,11 +533,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Project]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Project]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -563,10 +558,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -584,7 +580,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @overload async def begin_update( @@ -669,7 +667,8 @@ async def begin_update( :type resource_group_name: str :param project_name: The name of the project. Required. :type project_name: str - :param body: Updatable project properties. Is either a model type or a IO type. Required. + :param body: Updatable project properties. Is either a ProjectUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.ProjectUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -690,16 +689,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, project_name=project_name, body=body, @@ -719,10 +716,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -734,9 +731,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, project_name: str, **kwargs: Any @@ -752,10 +751,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -767,10 +764,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -782,7 +780,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.DevCenter/projects/{projectName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, project_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -808,13 +808,11 @@ async def begin_delete(self, resource_group_name: str, project_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -832,10 +830,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -847,6 +845,8 @@ 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.DevCenter/projects/{projectName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_schedules_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_schedules_operations.py index 29d3b0ee8676..f45093c7b76f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_schedules_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_schedules_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,10 +38,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,10 +85,8 @@ def list_by_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduleListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ScheduleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,7 +111,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -134,7 +127,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -142,14 +135,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ScheduleListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -161,7 +155,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules"} # type: ignore + list_by_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules" + } @distributed_trace_async async def get( @@ -203,10 +199,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -221,10 +215,11 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -240,7 +235,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } async def _create_or_update_initial( self, @@ -263,11 +260,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -293,10 +288,11 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -312,11 +308,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("Schedule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @overload async def begin_create_or_update( @@ -432,7 +430,7 @@ async def begin_create_or_update( :type pool_name: str :param schedule_name: The name of the schedule that uniquely identifies it. Required. :type schedule_name: str - :param body: Represents a scheduled task. Is either a model type or a IO type. Required. + :param body: Represents a scheduled task. Is either a Schedule type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Schedule or IO :param top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -456,16 +454,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -488,10 +484,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -503,9 +499,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } async def _update_initial( self, @@ -528,11 +526,9 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Schedule]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Schedule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -558,10 +554,11 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -579,7 +576,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @overload async def begin_update( @@ -695,7 +694,8 @@ async def begin_update( :type pool_name: str :param schedule_name: The name of the schedule that uniquely identifies it. Required. :type schedule_name: str - :param body: Represents a scheduled task. Is either a model type or a IO type. Required. + :param body: Represents a scheduled task. Is either a ScheduleUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.ScheduleUpdate or IO :param top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -719,16 +719,14 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -751,10 +749,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -766,9 +764,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -790,10 +790,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -808,10 +806,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -823,7 +822,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.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @distributed_trace_async async def begin_delete( @@ -864,13 +865,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -891,10 +890,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -906,6 +905,8 @@ 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.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_skus_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_skus_operations.py index 6cc845ed67e4..308bf23b8687 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_skus_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_skus_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._skus_operations import build_list_by_subscription_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,10 +67,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Asyn _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SkuListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SkuListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -97,7 +90,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 +106,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,14 +114,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SkuListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -140,4 +134,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_usages_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_usages_operations.py index 63f6264e626c..267ebf3b856d 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_usages_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/aio/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._usages_operations import build_list_by_location_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,10 +66,8 @@ def list_by_location(self, location: str, **kwargs: Any) -> AsyncIterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -96,7 +89,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 @@ -112,7 +105,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 @@ -120,14 +113,15 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ListUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -139,4 +133,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/usages" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/__init__.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/__init__.py index 4fb78374cb02..961e3f77f659 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/__init__.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/__init__.py @@ -28,6 +28,8 @@ from ._models_py3 import DevCenterListResult from ._models_py3 import DevCenterSku from ._models_py3 import DevCenterUpdate +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail from ._models_py3 import EnvironmentRole from ._models_py3 import EnvironmentType from ._models_py3 import EnvironmentTypeListResult @@ -41,6 +43,7 @@ from ._models_py3 import HealthCheck from ._models_py3 import HealthCheckStatusDetails from ._models_py3 import HealthCheckStatusDetailsListResult +from ._models_py3 import HealthStatusDetail from ._models_py3 import Image from ._models_py3 import ImageListResult from ._models_py3 import ImageReference @@ -59,6 +62,8 @@ from ._models_py3 import OperationListResult from ._models_py3 import OperationStatus from ._models_py3 import OperationStatusResult +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection from ._models_py3 import Pool from ._models_py3 import PoolListResult from ._models_py3 import PoolProperties @@ -86,6 +91,7 @@ from ._models_py3 import ScheduleUpdateProperties from ._models_py3 import Sku from ._models_py3 import SkuListResult +from ._models_py3 import StopOnDisconnectConfiguration from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import TrackedResourceUpdate @@ -99,8 +105,9 @@ from ._dev_center_mgmt_client_enums import CheckNameAvailabilityReason from ._dev_center_mgmt_client_enums import CreatedByType from ._dev_center_mgmt_client_enums import DomainJoinType -from ._dev_center_mgmt_client_enums import EnableStatus +from ._dev_center_mgmt_client_enums import EnvironmentTypeEnableStatus from ._dev_center_mgmt_client_enums import HealthCheckStatus +from ._dev_center_mgmt_client_enums import HealthStatus from ._dev_center_mgmt_client_enums import HibernateSupport from ._dev_center_mgmt_client_enums import ImageValidationStatus from ._dev_center_mgmt_client_enums import LicenseType @@ -108,12 +115,14 @@ from ._dev_center_mgmt_client_enums import ManagedServiceIdentityType from ._dev_center_mgmt_client_enums import Origin from ._dev_center_mgmt_client_enums import ProvisioningState +from ._dev_center_mgmt_client_enums import ScheduleEnableStatus from ._dev_center_mgmt_client_enums import ScheduledFrequency from ._dev_center_mgmt_client_enums import ScheduledType from ._dev_center_mgmt_client_enums import SkuTier +from ._dev_center_mgmt_client_enums import StopOnDisconnectEnableStatus from ._dev_center_mgmt_client_enums import UsageUnit 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__ = [ @@ -139,6 +148,8 @@ "DevCenterListResult", "DevCenterSku", "DevCenterUpdate", + "EndpointDependency", + "EndpointDetail", "EnvironmentRole", "EnvironmentType", "EnvironmentTypeListResult", @@ -152,6 +163,7 @@ "HealthCheck", "HealthCheckStatusDetails", "HealthCheckStatusDetailsListResult", + "HealthStatusDetail", "Image", "ImageListResult", "ImageReference", @@ -170,6 +182,8 @@ "OperationListResult", "OperationStatus", "OperationStatusResult", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", "Pool", "PoolListResult", "PoolProperties", @@ -197,6 +211,7 @@ "ScheduleUpdateProperties", "Sku", "SkuListResult", + "StopOnDisconnectConfiguration", "SystemData", "TrackedResource", "TrackedResourceUpdate", @@ -209,8 +224,9 @@ "CheckNameAvailabilityReason", "CreatedByType", "DomainJoinType", - "EnableStatus", + "EnvironmentTypeEnableStatus", "HealthCheckStatus", + "HealthStatus", "HibernateSupport", "ImageValidationStatus", "LicenseType", @@ -218,9 +234,11 @@ "ManagedServiceIdentityType", "Origin", "ProvisioningState", + "ScheduleEnableStatus", "ScheduledFrequency", "ScheduledType", "SkuTier", + "StopOnDisconnectEnableStatus", "UsageUnit", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_dev_center_mgmt_client_enums.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_dev_center_mgmt_client_enums.py index c3cab8d5dd73..fd84f75bb9f6 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_dev_center_mgmt_client_enums.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_dev_center_mgmt_client_enums.py @@ -48,10 +48,8 @@ class DomainJoinType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_AD_JOIN = "AzureADJoin" -class EnableStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enable or disable status. Indicates whether the property applied to is either enabled or - disabled. - """ +class EnvironmentTypeEnableStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the environment type is either enabled or disabled.""" ENABLED = "Enabled" DISABLED = "Disabled" @@ -60,12 +58,22 @@ class EnableStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): class HealthCheckStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Health check status values.""" + UNKNOWN = "Unknown" PENDING = "Pending" RUNNING = "Running" PASSED = "Passed" - FAILED = "Failed" WARNING = "Warning" + FAILED = "Failed" + + +class HealthStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Health status indicating whether a pool is available to create Dev Boxes.""" + UNKNOWN = "Unknown" + PENDING = "Pending" + HEALTHY = "Healthy" + WARNING = "Warning" + UNHEALTHY = "Unhealthy" class HibernateSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -152,6 +160,15 @@ class ScheduledType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STOP_DEV_BOX = "StopDevBox" +class ScheduleEnableStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Schedule enable or disable status. Indicates whether the schedule applied to is either enabled + or disabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. @@ -163,6 +180,15 @@ class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): PREMIUM = "Premium" +class StopOnDisconnectEnableStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Stop on disconnect enable or disable status. Indicates whether stop on disconnect to is either + enabled or disabled. + """ + + ENABLED = "Enabled" + DISABLED = "Disabled" + + class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The unit details.""" diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_models_py3.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_models_py3.py index be059fdf8e51..3103da1accb5 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_models_py3.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/models/_models_py3.py @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -49,7 +49,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -97,7 +97,7 @@ class AllowedEnvironmentType(Resource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provisioning_state = None @@ -124,7 +124,7 @@ class AllowedEnvironmentTypeListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -157,8 +157,8 @@ class AttachedNetworkConnection(Resource): :ivar network_connection_location: The geo-location where the NetworkConnection resource specified in 'networkConnectionResourceId' property lives. :vartype network_connection_location: str - :ivar health_check_status: Health check status values. Known values are: "Pending", "Running", - "Passed", "Failed", "Warning", and "Unknown". + :ivar health_check_status: Health check status values. Known values are: "Unknown", "Pending", + "Running", "Passed", "Warning", and "Failed". :vartype health_check_status: str or ~azure.mgmt.devcenter.models.HealthCheckStatus :ivar domain_join_type: AAD Join type of the network. This is populated based on the referenced Network Connection. Known values are: "HybridAzureADJoin" and "AzureADJoin". @@ -188,7 +188,7 @@ class AttachedNetworkConnection(Resource): "domain_join_type": {"key": "properties.domainJoinType", "type": "str"}, } - def __init__(self, *, network_connection_id: Optional[str] = None, **kwargs): + def __init__(self, *, network_connection_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword network_connection_id: The resource ID of the NetworkConnection you want to attach. :paramtype network_connection_id: str @@ -222,7 +222,7 @@ class AttachedNetworkListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -250,7 +250,7 @@ class Capability(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -316,8 +316,8 @@ def __init__( *, git_hub: Optional["_models.GitCatalog"] = None, ado_git: Optional["_models.GitCatalog"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword git_hub: Properties for a GitHub catalog type. :paramtype git_hub: ~azure.mgmt.devcenter.models.GitCatalog @@ -353,7 +353,7 @@ class CatalogListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -379,8 +379,8 @@ def __init__( *, git_hub: Optional["_models.GitCatalog"] = None, ado_git: Optional["_models.GitCatalog"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword git_hub: Properties for a GitHub catalog type. :paramtype git_hub: ~azure.mgmt.devcenter.models.GitCatalog @@ -432,8 +432,8 @@ def __init__( *, git_hub: Optional["_models.GitCatalog"] = None, ado_git: Optional["_models.GitCatalog"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword git_hub: Properties for a GitHub catalog type. :paramtype git_hub: ~azure.mgmt.devcenter.models.GitCatalog @@ -447,7 +447,8 @@ def __init__( class CatalogUpdate(_serialization.Model): - """The catalog's properties for partial update. Properties not provided in the update request will not be changed. + """The catalog's properties for partial update. Properties not provided in the update request will + not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -469,8 +470,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, git_hub: Optional["_models.GitCatalog"] = None, ado_git: Optional["_models.GitCatalog"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -499,7 +500,7 @@ class CheckNameAvailabilityRequest(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of the resource for which availability needs to be checked. :paramtype name: str @@ -535,8 +536,8 @@ def __init__( name_available: Optional[bool] = None, reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None, message: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name_available: Indicates if the resource name is available. :paramtype name_available: bool @@ -589,8 +590,8 @@ def __init__( message: str, target: Optional[str] = None, details: Optional[List["_models.CloudErrorBody"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed programmatically. Required. @@ -612,7 +613,8 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -652,7 +654,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -755,8 +757,8 @@ def __init__( sku: Optional["_models.Sku"] = None, os_storage_type: Optional[str] = None, hibernate_support: Optional[Union[str, "_models.HibernateSupport"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -806,7 +808,7 @@ class DevBoxDefinitionListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -814,7 +816,8 @@ def __init__(self, **kwargs): class DevBoxDefinitionUpdateProperties(_serialization.Model): - """Properties of a Dev Box definition. These properties can be updated after the resource has been created. + """Properties of a Dev Box definition. These properties can be updated after the resource has been + created. :ivar image_reference: Image reference information. :vartype image_reference: ~azure.mgmt.devcenter.models.ImageReference @@ -843,8 +846,8 @@ def __init__( sku: Optional["_models.Sku"] = None, os_storage_type: Optional[str] = None, hibernate_support: Optional[Union[str, "_models.HibernateSupport"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword image_reference: Image reference information. :paramtype image_reference: ~azure.mgmt.devcenter.models.ImageReference @@ -923,8 +926,8 @@ def __init__( sku: Optional["_models.Sku"] = None, os_storage_type: Optional[str] = None, hibernate_support: Optional[Union[str, "_models.HibernateSupport"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword image_reference: Image reference information. :paramtype image_reference: ~azure.mgmt.devcenter.models.ImageReference @@ -965,7 +968,7 @@ class TrackedResourceUpdate(_serialization.Model): "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: Resource tags. :paramtype tags: dict[str, str] @@ -1015,8 +1018,8 @@ def __init__( sku: Optional["_models.Sku"] = None, os_storage_type: Optional[str] = None, hibernate_support: Optional[Union[str, "_models.HibernateSupport"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1070,7 +1073,7 @@ class DevCenter(TrackedResource): "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", "TransientFailure", "RolloutInProgress", and "StorageProvisioningFailed". :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState - :ivar dev_center_uri: The URI of the resource. + :ivar dev_center_uri: The URI of the Dev Center. :vartype dev_center_uri: str """ @@ -1102,8 +1105,8 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1139,7 +1142,7 @@ class DevCenterListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1188,8 +1191,8 @@ def __init__( size: Optional[str] = None, family: Optional[str] = None, capacity: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. :paramtype name: str @@ -1271,8 +1274,8 @@ def __init__( size: Optional[str] = None, family: Optional[str] = None, capacity: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. :paramtype name: str @@ -1297,7 +1300,8 @@ def __init__( class DevCenterUpdate(TrackedResourceUpdate): - """The devcenter resource for partial updates. Properties not provided in the update request will not be changed. + """The devcenter resource for partial updates. Properties not provided in the update request will + not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -1319,8 +1323,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1333,6 +1337,64 @@ def __init__( self.identity = identity +class EndpointDependency(_serialization.Model): + """A domain name and connection details used to access a dependency. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar domain_name: The domain name of the dependency. Domain names may be fully qualified or + may contain a * wildcard. + :vartype domain_name: str + :ivar description: Human-readable supplemental information about the dependency and when it is + applicable. + :vartype description: str + :ivar endpoint_details: The list of connection details for this endpoint. + :vartype endpoint_details: list[~azure.mgmt.devcenter.models.EndpointDetail] + """ + + _validation = { + "domain_name": {"readonly": True}, + "description": {"readonly": True}, + "endpoint_details": {"readonly": True}, + } + + _attribute_map = { + "domain_name": {"key": "domainName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.domain_name = None + self.description = None + self.endpoint_details = None + + +class EndpointDetail(_serialization.Model): + """Details about the connection between the Batch service and the endpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar port: The port an endpoint is connected to. + :vartype port: int + """ + + _validation = { + "port": {"readonly": True}, + } + + _attribute_map = { + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.port = None + + class EnvironmentRole(_serialization.Model): """A role that can be assigned to a user. @@ -1355,7 +1417,7 @@ class EnvironmentRole(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.role_name = None @@ -1404,7 +1466,7 @@ class EnvironmentType(Resource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1435,7 +1497,7 @@ class EnvironmentTypeListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1443,7 +1505,8 @@ def __init__(self, **kwargs): class EnvironmentTypeUpdate(_serialization.Model): - """The environment type for partial update. Properties not provided in the update request will not be changed. + """The environment type for partial update. Properties not provided in the update request will not + be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -1453,7 +1516,7 @@ class EnvironmentTypeUpdate(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1483,7 +1546,7 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None @@ -1523,7 +1586,7 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1534,7 +1597,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.devcenter.models.ErrorDetail @@ -1544,7 +1608,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.devcenter.models.ErrorDetail @@ -1595,7 +1659,7 @@ class Gallery(Resource): "gallery_resource_id": {"key": "properties.galleryResourceId", "type": "str"}, } - def __init__(self, *, gallery_resource_id: Optional[str] = None, **kwargs): + def __init__(self, *, gallery_resource_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword gallery_resource_id: The resource ID of the backing Azure Compute Gallery. :paramtype gallery_resource_id: str @@ -1626,7 +1690,7 @@ class GalleryListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1661,8 +1725,8 @@ def __init__( branch: Optional[str] = None, secret_identifier: Optional[str] = None, path: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword uri: Git URI. :paramtype uri: str @@ -1686,8 +1750,8 @@ class HealthCheck(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: The status of the health check item. Known values are: "Pending", "Running", - "Passed", "Failed", "Warning", and "Unknown". + :ivar status: The status of the health check item. Known values are: "Unknown", "Pending", + "Running", "Passed", "Warning", and "Failed". :vartype status: str or ~azure.mgmt.devcenter.models.HealthCheckStatus :ivar display_name: The display name of this health check item. :vartype display_name: str @@ -1723,7 +1787,7 @@ class HealthCheck(_serialization.Model): "additional_details": {"key": "additionalDetails", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.status = None @@ -1779,7 +1843,7 @@ class HealthCheckStatusDetails(Resource): "health_checks": {"key": "properties.healthChecks", "type": "[HealthCheck]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.start_date_time = None @@ -1808,15 +1872,45 @@ class HealthCheckStatusDetailsListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None self.next_link = None +class HealthStatusDetail(_serialization.Model): + """Pool health status detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: An identifier for the issue. + :vartype code: str + :ivar message: A message describing the issue, intended to be suitable for display in a user + interface. + :vartype message: str + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.code = None + self.message = None + + class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -1847,12 +1941,12 @@ class ProxyResource(Resource): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) -class Image(ProxyResource): +class Image(ProxyResource): # pylint: disable=too-many-instance-attributes """Represents an image. Variables are only populated by the server, and will be ignored when sending a request. @@ -1885,6 +1979,10 @@ class Image(ProxyResource): "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", "TransientFailure", "RolloutInProgress", and "StorageProvisioningFailed". :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState + :ivar hibernate_support: Indicates whether this image has hibernate enabled. Not all images are + capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate. Known + values are: "Disabled" and "Enabled". + :vartype hibernate_support: str or ~azure.mgmt.devcenter.models.HibernateSupport """ _validation = { @@ -1898,6 +1996,7 @@ class Image(ProxyResource): "sku": {"readonly": True}, "recommended_machine_configuration": {"readonly": True}, "provisioning_state": {"readonly": True}, + "hibernate_support": {"readonly": True}, } _attribute_map = { @@ -1914,9 +2013,10 @@ class Image(ProxyResource): "type": "RecommendedMachineConfiguration", }, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "hibernate_support": {"key": "properties.hibernateSupport", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.description = None @@ -1925,6 +2025,7 @@ def __init__(self, **kwargs): self.sku = None self.recommended_machine_configuration = None self.provisioning_state = None + self.hibernate_support = None class ImageListResult(_serialization.Model): @@ -1948,7 +2049,7 @@ class ImageListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1966,12 +2067,6 @@ class ImageReference(_serialization.Model): :ivar exact_version: The actual version of the image after use. When id references a gallery image latest version, this will indicate the actual version in use. :vartype exact_version: str - :ivar publisher: The image publisher. - :vartype publisher: str - :ivar offer: The image offer. - :vartype offer: str - :ivar sku: The image sku. - :vartype sku: str """ _validation = { @@ -1981,37 +2076,17 @@ class ImageReference(_serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, "exact_version": {"key": "exactVersion", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "offer": {"key": "offer", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - publisher: Optional[str] = None, - offer: Optional[str] = None, - sku: Optional[str] = None, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Image ID, or Image version ID. When Image ID is provided, its latest version will be used. :paramtype id: str - :keyword publisher: The image publisher. - :paramtype publisher: str - :keyword offer: The image offer. - :paramtype offer: str - :keyword sku: The image sku. - :paramtype sku: str """ super().__init__(**kwargs) self.id = id self.exact_version = None - self.publisher = publisher - self.offer = offer - self.sku = sku class ImageValidationErrorDetails(_serialization.Model): @@ -2028,7 +2103,7 @@ class ImageValidationErrorDetails(_serialization.Model): "message": {"key": "message", "type": "str"}, } - def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs: Any) -> None: """ :keyword code: An identifier for the error. :paramtype code: str @@ -2096,7 +2171,7 @@ class ImageVersion(ProxyResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name_properties_name = None @@ -2127,7 +2202,7 @@ class ImageVersionListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2155,7 +2230,7 @@ class ListUsagesResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2204,8 +2279,8 @@ def __init__( *, type: Union[str, "_models.ManagedServiceIdentityType"], user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and @@ -2266,7 +2341,7 @@ class NetworkConnection(TrackedResource): # pylint: disable=too-many-instance-a :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState :ivar health_check_status: Overall health status of the network connection. Health checks are run on creation, update, and periodically to validate the network connection. Known values are: - "Pending", "Running", "Passed", "Failed", "Warning", and "Unknown". + "Unknown", "Pending", "Running", "Passed", "Warning", and "Failed". :vartype health_check_status: str or ~azure.mgmt.devcenter.models.HealthCheckStatus :ivar networking_resource_group_name: The name for resource group where NICs will be placed. :vartype networking_resource_group_name: str @@ -2314,8 +2389,8 @@ def __init__( domain_password: Optional[str] = None, networking_resource_group_name: Optional[str] = None, domain_join_type: Optional[Union[str, "_models.DomainJoinType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2372,7 +2447,7 @@ class NetworkConnectionListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2380,7 +2455,8 @@ def __init__(self, **kwargs): class NetworkConnectionUpdate(TrackedResourceUpdate): - """The network connection properties for partial update. Properties not provided in the update request will not be changed. + """The network connection properties for partial update. Properties not provided in the update + request will not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -2420,8 +2496,8 @@ def __init__( organization_unit: Optional[str] = None, domain_username: Optional[str] = None, domain_password: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2449,7 +2525,8 @@ def __init__( class NetworkConnectionUpdateProperties(_serialization.Model): - """Properties of network connection. These properties can be updated after the resource has been created. + """Properties of network connection. These properties can be updated after the resource has been + created. :ivar subnet_id: The subnet to attach Virtual Machines to. :vartype subnet_id: str @@ -2481,8 +2558,8 @@ def __init__( organization_unit: Optional[str] = None, domain_username: Optional[str] = None, domain_password: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword subnet_id: The subnet to attach Virtual Machines to. :paramtype subnet_id: str @@ -2531,7 +2608,7 @@ class NetworkProperties(NetworkConnectionUpdateProperties): :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState :ivar health_check_status: Overall health status of the network connection. Health checks are run on creation, update, and periodically to validate the network connection. Known values are: - "Pending", "Running", "Passed", "Failed", "Warning", and "Unknown". + "Unknown", "Pending", "Running", "Passed", "Warning", and "Failed". :vartype health_check_status: str or ~azure.mgmt.devcenter.models.HealthCheckStatus :ivar networking_resource_group_name: The name for resource group where NICs will be placed. :vartype networking_resource_group_name: str @@ -2568,8 +2645,8 @@ def __init__( domain_username: Optional[str] = None, domain_password: Optional[str] = None, networking_resource_group_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword subnet_id: The subnet to attach Virtual Machines to. :paramtype subnet_id: str @@ -2640,7 +2717,7 @@ class Operation(_serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.devcenter.models.OperationDisplay @@ -2686,7 +2763,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -2696,7 +2773,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -2716,7 +2794,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -2773,8 +2851,8 @@ def __init__( end_time: Optional[datetime.datetime] = None, operations: Optional[List["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -2864,8 +2942,8 @@ def __init__( end_time: Optional[datetime.datetime] = None, operations: Optional[List["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Fully qualified ID for the async operation. :paramtype id: str @@ -2899,6 +2977,66 @@ def __init__( self.properties = None +class OutboundEnvironmentEndpoint(_serialization.Model): + """A collection of related endpoints from the same service for which the agent requires outbound + access. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar category: The type of service that the agent connects to. + :vartype category: str + :ivar endpoints: The endpoints for this service for which the agent requires outbound access. + :vartype endpoints: list[~azure.mgmt.devcenter.models.EndpointDependency] + """ + + _validation = { + "category": {"readonly": True}, + "endpoints": {"readonly": True}, + } + + _attribute_map = { + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.category = None + self.endpoints = None + + +class OutboundEnvironmentEndpointCollection(_serialization.Model): + """Values returned by the List operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The collection of outbound network dependency endpoints returned by the listing + operation. + :vartype value: list[~azure.mgmt.devcenter.models.OutboundEnvironmentEndpoint] + :ivar next_link: The continuation token. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: The continuation token. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = None + self.next_link = next_link + + class Pool(TrackedResource): # pylint: disable=too-many-instance-attributes """A pool of Virtual Machines. @@ -2931,6 +3069,16 @@ class Pool(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :vartype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :ivar stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :vartype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration + :ivar health_status: Overall health status of the Pool. Indicates whether or not the Pool is + available to create Dev Boxes. Known values are: "Unknown", "Pending", "Healthy", "Warning", + and "Unhealthy". + :vartype health_status: str or ~azure.mgmt.devcenter.models.HealthStatus + :ivar health_status_details: Details on the Pool health status to help diagnose issues. This is + only populated when the pool status indicates the pool is in a non-healthy state. + :vartype health_status_details: list[~azure.mgmt.devcenter.models.HealthStatusDetail] :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", @@ -2944,6 +3092,8 @@ class Pool(TrackedResource): # pylint: disable=too-many-instance-attributes "type": {"readonly": True}, "system_data": {"readonly": True}, "location": {"required": True}, + "health_status": {"readonly": True}, + "health_status_details": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -2958,6 +3108,9 @@ class Pool(TrackedResource): # pylint: disable=too-many-instance-attributes "network_connection_name": {"key": "properties.networkConnectionName", "type": "str"}, "license_type": {"key": "properties.licenseType", "type": "str"}, "local_administrator": {"key": "properties.localAdministrator", "type": "str"}, + "stop_on_disconnect": {"key": "properties.stopOnDisconnect", "type": "StopOnDisconnectConfiguration"}, + "health_status": {"key": "properties.healthStatus", "type": "str"}, + "health_status_details": {"key": "properties.healthStatusDetails", "type": "[HealthStatusDetail]"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } @@ -2970,8 +3123,9 @@ def __init__( network_connection_name: Optional[str] = None, license_type: Optional[Union[str, "_models.LicenseType"]] = None, local_administrator: Optional[Union[str, "_models.LocalAdminStatus"]] = None, - **kwargs - ): + stop_on_disconnect: Optional["_models.StopOnDisconnectConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2987,12 +3141,18 @@ def __init__( :keyword local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :paramtype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :keyword stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :paramtype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ super().__init__(tags=tags, location=location, **kwargs) self.dev_box_definition_name = dev_box_definition_name self.network_connection_name = network_connection_name self.license_type = license_type self.local_administrator = local_administrator + self.stop_on_disconnect = stop_on_disconnect + self.health_status = None + self.health_status_details = None self.provisioning_state = None @@ -3017,7 +3177,7 @@ class PoolListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3037,6 +3197,9 @@ class PoolUpdateProperties(_serialization.Model): :ivar local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :vartype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :ivar stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :vartype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ _attribute_map = { @@ -3044,6 +3207,7 @@ class PoolUpdateProperties(_serialization.Model): "network_connection_name": {"key": "networkConnectionName", "type": "str"}, "license_type": {"key": "licenseType", "type": "str"}, "local_administrator": {"key": "localAdministrator", "type": "str"}, + "stop_on_disconnect": {"key": "stopOnDisconnect", "type": "StopOnDisconnectConfiguration"}, } def __init__( @@ -3053,8 +3217,9 @@ def __init__( network_connection_name: Optional[str] = None, license_type: Optional[Union[str, "_models.LicenseType"]] = None, local_administrator: Optional[Union[str, "_models.LocalAdminStatus"]] = None, - **kwargs - ): + stop_on_disconnect: Optional["_models.StopOnDisconnectConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword dev_box_definition_name: Name of a Dev Box definition in parent Project of this Pool. :paramtype dev_box_definition_name: str @@ -3066,12 +3231,16 @@ def __init__( :keyword local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :paramtype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :keyword stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :paramtype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ super().__init__(**kwargs) self.dev_box_definition_name = dev_box_definition_name self.network_connection_name = network_connection_name self.license_type = license_type self.local_administrator = local_administrator + self.stop_on_disconnect = stop_on_disconnect class PoolProperties(PoolUpdateProperties): @@ -3089,6 +3258,16 @@ class PoolProperties(PoolUpdateProperties): :ivar local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :vartype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :ivar stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :vartype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration + :ivar health_status: Overall health status of the Pool. Indicates whether or not the Pool is + available to create Dev Boxes. Known values are: "Unknown", "Pending", "Healthy", "Warning", + and "Unhealthy". + :vartype health_status: str or ~azure.mgmt.devcenter.models.HealthStatus + :ivar health_status_details: Details on the Pool health status to help diagnose issues. This is + only populated when the pool status indicates the pool is in a non-healthy state. + :vartype health_status_details: list[~azure.mgmt.devcenter.models.HealthStatusDetail] :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", @@ -3097,6 +3276,8 @@ class PoolProperties(PoolUpdateProperties): """ _validation = { + "health_status": {"readonly": True}, + "health_status_details": {"readonly": True}, "provisioning_state": {"readonly": True}, } @@ -3105,6 +3286,9 @@ class PoolProperties(PoolUpdateProperties): "network_connection_name": {"key": "networkConnectionName", "type": "str"}, "license_type": {"key": "licenseType", "type": "str"}, "local_administrator": {"key": "localAdministrator", "type": "str"}, + "stop_on_disconnect": {"key": "stopOnDisconnect", "type": "StopOnDisconnectConfiguration"}, + "health_status": {"key": "healthStatus", "type": "str"}, + "health_status_details": {"key": "healthStatusDetails", "type": "[HealthStatusDetail]"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, } @@ -3115,8 +3299,9 @@ def __init__( network_connection_name: Optional[str] = None, license_type: Optional[Union[str, "_models.LicenseType"]] = None, local_administrator: Optional[Union[str, "_models.LocalAdminStatus"]] = None, - **kwargs - ): + stop_on_disconnect: Optional["_models.StopOnDisconnectConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword dev_box_definition_name: Name of a Dev Box definition in parent Project of this Pool. :paramtype dev_box_definition_name: str @@ -3128,19 +3313,26 @@ def __init__( :keyword local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :paramtype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :keyword stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :paramtype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ super().__init__( dev_box_definition_name=dev_box_definition_name, network_connection_name=network_connection_name, license_type=license_type, local_administrator=local_administrator, + stop_on_disconnect=stop_on_disconnect, **kwargs ) + self.health_status = None + self.health_status_details = None self.provisioning_state = None class PoolUpdate(TrackedResourceUpdate): - """The pool properties for partial update. Properties not provided in the update request will not be changed. + """The pool properties for partial update. Properties not provided in the update request will not + be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -3156,6 +3348,9 @@ class PoolUpdate(TrackedResourceUpdate): :ivar local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :vartype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :ivar stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :vartype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ _attribute_map = { @@ -3165,6 +3360,7 @@ class PoolUpdate(TrackedResourceUpdate): "network_connection_name": {"key": "properties.networkConnectionName", "type": "str"}, "license_type": {"key": "properties.licenseType", "type": "str"}, "local_administrator": {"key": "properties.localAdministrator", "type": "str"}, + "stop_on_disconnect": {"key": "properties.stopOnDisconnect", "type": "StopOnDisconnectConfiguration"}, } def __init__( @@ -3176,8 +3372,9 @@ def __init__( network_connection_name: Optional[str] = None, license_type: Optional[Union[str, "_models.LicenseType"]] = None, local_administrator: Optional[Union[str, "_models.LocalAdminStatus"]] = None, - **kwargs - ): + stop_on_disconnect: Optional["_models.StopOnDisconnectConfiguration"] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3193,15 +3390,19 @@ def __init__( :keyword local_administrator: Indicates whether owners of Dev Boxes in this pool are added as local administrators on the Dev Box. Known values are: "Disabled" and "Enabled". :paramtype local_administrator: str or ~azure.mgmt.devcenter.models.LocalAdminStatus + :keyword stop_on_disconnect: Stop on disconnect configuration settings for Dev Boxes created in + this pool. + :paramtype stop_on_disconnect: ~azure.mgmt.devcenter.models.StopOnDisconnectConfiguration """ super().__init__(tags=tags, location=location, **kwargs) self.dev_box_definition_name = dev_box_definition_name self.network_connection_name = network_connection_name self.license_type = license_type self.local_administrator = local_administrator + self.stop_on_disconnect = stop_on_disconnect -class Project(TrackedResource): +class Project(TrackedResource): # pylint: disable=too-many-instance-attributes """Represents a project resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -3227,12 +3428,16 @@ class Project(TrackedResource): :vartype dev_center_id: str :ivar description: Description of the project. :vartype description: str + :ivar max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a single + user can create across all pools in the project. This will have no effect on existing Dev Boxes + when reduced. + :vartype max_dev_boxes_per_user: int :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", "TransientFailure", "RolloutInProgress", and "StorageProvisioningFailed". :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState - :ivar dev_center_uri: The URI of the resource. + :ivar dev_center_uri: The URI of the Dev Center resource this project is associated with. :vartype dev_center_uri: str """ @@ -3242,6 +3447,7 @@ class Project(TrackedResource): "type": {"readonly": True}, "system_data": {"readonly": True}, "location": {"required": True}, + "max_dev_boxes_per_user": {"minimum": 0}, "provisioning_state": {"readonly": True}, "dev_center_uri": {"readonly": True}, } @@ -3255,6 +3461,7 @@ class Project(TrackedResource): "location": {"key": "location", "type": "str"}, "dev_center_id": {"key": "properties.devCenterId", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, + "max_dev_boxes_per_user": {"key": "properties.maxDevBoxesPerUser", "type": "int"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "dev_center_uri": {"key": "properties.devCenterUri", "type": "str"}, } @@ -3266,8 +3473,9 @@ def __init__( tags: Optional[Dict[str, str]] = None, dev_center_id: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + max_dev_boxes_per_user: Optional[int] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3277,10 +3485,15 @@ def __init__( :paramtype dev_center_id: str :keyword description: Description of the project. :paramtype description: str + :keyword max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a + single user can create across all pools in the project. This will have no effect on existing + Dev Boxes when reduced. + :paramtype max_dev_boxes_per_user: int """ super().__init__(tags=tags, location=location, **kwargs) self.dev_center_id = dev_center_id self.description = description + self.max_dev_boxes_per_user = max_dev_boxes_per_user self.provisioning_state = None self.dev_center_uri = None @@ -3312,7 +3525,7 @@ class ProjectEnvironmentType(Resource): # pylint: disable=too-many-instance-att :vartype deployment_target_id: str :ivar status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :ivar creator_role_assignment: The role definition assigned to the environment creator on backing resources. :vartype creator_role_assignment: @@ -3360,11 +3573,11 @@ def __init__( identity: Optional["_models.ManagedServiceIdentity"] = None, location: Optional[str] = None, deployment_target_id: Optional[str] = None, - status: Optional[Union[str, "_models.EnableStatus"]] = None, + status: Optional[Union[str, "_models.EnvironmentTypeEnableStatus"]] = None, creator_role_assignment: Optional["_models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment"] = None, user_role_assignments: Optional[Dict[str, "_models.UserRoleAssignmentValue"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3377,7 +3590,7 @@ def __init__( :paramtype deployment_target_id: str :keyword status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :paramtype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :keyword creator_role_assignment: The role definition assigned to the environment creator on backing resources. :paramtype creator_role_assignment: @@ -3419,7 +3632,7 @@ class ProjectEnvironmentTypeListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3427,14 +3640,15 @@ def __init__(self, **kwargs): class ProjectEnvironmentTypeUpdateProperties(_serialization.Model): - """Properties of a project environment type. These properties can be updated after the resource has been created. + """Properties of a project environment type. These properties can be updated after the resource + has been created. :ivar deployment_target_id: Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. :vartype deployment_target_id: str :ivar status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :ivar creator_role_assignment: The role definition assigned to the environment creator on backing resources. :vartype creator_role_assignment: @@ -3458,18 +3672,18 @@ def __init__( self, *, deployment_target_id: Optional[str] = None, - status: Optional[Union[str, "_models.EnableStatus"]] = None, + status: Optional[Union[str, "_models.EnvironmentTypeEnableStatus"]] = None, creator_role_assignment: Optional["_models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment"] = None, user_role_assignments: Optional[Dict[str, "_models.UserRoleAssignmentValue"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword deployment_target_id: Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. :paramtype deployment_target_id: str :keyword status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :paramtype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :keyword creator_role_assignment: The role definition assigned to the environment creator on backing resources. :paramtype creator_role_assignment: @@ -3496,7 +3710,7 @@ class ProjectEnvironmentTypeProperties(ProjectEnvironmentTypeUpdateProperties): :vartype deployment_target_id: str :ivar status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :ivar creator_role_assignment: The role definition assigned to the environment creator on backing resources. :vartype creator_role_assignment: @@ -3530,18 +3744,18 @@ def __init__( self, *, deployment_target_id: Optional[str] = None, - status: Optional[Union[str, "_models.EnableStatus"]] = None, + status: Optional[Union[str, "_models.EnvironmentTypeEnableStatus"]] = None, creator_role_assignment: Optional["_models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment"] = None, user_role_assignments: Optional[Dict[str, "_models.UserRoleAssignmentValue"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword deployment_target_id: Id of a subscription that the environment type will be mapped to. The environment's resources will be deployed into this subscription. :paramtype deployment_target_id: str :keyword status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :paramtype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :keyword creator_role_assignment: The role definition assigned to the environment creator on backing resources. :paramtype creator_role_assignment: @@ -3562,7 +3776,8 @@ def __init__( class ProjectEnvironmentTypeUpdate(_serialization.Model): - """The project environment type for partial update. Properties not provided in the update request will not be changed. + """The project environment type for partial update. Properties not provided in the update request + will not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -3573,7 +3788,7 @@ class ProjectEnvironmentTypeUpdate(_serialization.Model): :vartype deployment_target_id: str :ivar status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :vartype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :ivar creator_role_assignment: The role definition assigned to the environment creator on backing resources. :vartype creator_role_assignment: @@ -3601,11 +3816,11 @@ def __init__( tags: Optional[Dict[str, str]] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, deployment_target_id: Optional[str] = None, - status: Optional[Union[str, "_models.EnableStatus"]] = None, + status: Optional[Union[str, "_models.EnvironmentTypeEnableStatus"]] = None, creator_role_assignment: Optional["_models.ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment"] = None, user_role_assignments: Optional[Dict[str, "_models.UserRoleAssignmentValue"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3616,7 +3831,7 @@ def __init__( :paramtype deployment_target_id: str :keyword status: Defines whether this Environment Type can be used in this Project. Known values are: "Enabled" and "Disabled". - :paramtype status: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype status: str or ~azure.mgmt.devcenter.models.EnvironmentTypeEnableStatus :keyword creator_role_assignment: The role definition assigned to the environment creator on backing resources. :paramtype creator_role_assignment: @@ -3646,7 +3861,7 @@ class ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment(_serialization "roles": {"key": "roles", "type": "{EnvironmentRole}"}, } - def __init__(self, *, roles: Optional[Dict[str, "_models.EnvironmentRole"]] = None, **kwargs): + def __init__(self, *, roles: Optional[Dict[str, "_models.EnvironmentRole"]] = None, **kwargs: Any) -> None: """ :keyword roles: A map of roles to assign to the environment creator. :paramtype roles: dict[str, ~azure.mgmt.devcenter.models.EnvironmentRole] @@ -3676,7 +3891,7 @@ class ProjectListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3690,23 +3905,44 @@ class ProjectUpdateProperties(_serialization.Model): :vartype dev_center_id: str :ivar description: Description of the project. :vartype description: str + :ivar max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a single + user can create across all pools in the project. This will have no effect on existing Dev Boxes + when reduced. + :vartype max_dev_boxes_per_user: int """ + _validation = { + "max_dev_boxes_per_user": {"minimum": 0}, + } + _attribute_map = { "dev_center_id": {"key": "devCenterId", "type": "str"}, "description": {"key": "description", "type": "str"}, + "max_dev_boxes_per_user": {"key": "maxDevBoxesPerUser", "type": "int"}, } - def __init__(self, *, dev_center_id: Optional[str] = None, description: Optional[str] = None, **kwargs): + def __init__( + self, + *, + dev_center_id: Optional[str] = None, + description: Optional[str] = None, + max_dev_boxes_per_user: Optional[int] = None, + **kwargs: Any + ) -> None: """ :keyword dev_center_id: Resource Id of an associated DevCenter. :paramtype dev_center_id: str :keyword description: Description of the project. :paramtype description: str + :keyword max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a + single user can create across all pools in the project. This will have no effect on existing + Dev Boxes when reduced. + :paramtype max_dev_boxes_per_user: int """ super().__init__(**kwargs) self.dev_center_id = dev_center_id self.description = description + self.max_dev_boxes_per_user = max_dev_boxes_per_user class ProjectProperties(ProjectUpdateProperties): @@ -3718,16 +3954,21 @@ class ProjectProperties(ProjectUpdateProperties): :vartype dev_center_id: str :ivar description: Description of the project. :vartype description: str + :ivar max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a single + user can create across all pools in the project. This will have no effect on existing Dev Boxes + when reduced. + :vartype max_dev_boxes_per_user: int :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", "TransientFailure", "RolloutInProgress", and "StorageProvisioningFailed". :vartype provisioning_state: str or ~azure.mgmt.devcenter.models.ProvisioningState - :ivar dev_center_uri: The URI of the resource. + :ivar dev_center_uri: The URI of the Dev Center resource this project is associated with. :vartype dev_center_uri: str """ _validation = { + "max_dev_boxes_per_user": {"minimum": 0}, "provisioning_state": {"readonly": True}, "dev_center_uri": {"readonly": True}, } @@ -3735,24 +3976,42 @@ class ProjectProperties(ProjectUpdateProperties): _attribute_map = { "dev_center_id": {"key": "devCenterId", "type": "str"}, "description": {"key": "description", "type": "str"}, + "max_dev_boxes_per_user": {"key": "maxDevBoxesPerUser", "type": "int"}, "provisioning_state": {"key": "provisioningState", "type": "str"}, "dev_center_uri": {"key": "devCenterUri", "type": "str"}, } - def __init__(self, *, dev_center_id: Optional[str] = None, description: Optional[str] = None, **kwargs): + def __init__( + self, + *, + dev_center_id: Optional[str] = None, + description: Optional[str] = None, + max_dev_boxes_per_user: Optional[int] = None, + **kwargs: Any + ) -> None: """ :keyword dev_center_id: Resource Id of an associated DevCenter. :paramtype dev_center_id: str :keyword description: Description of the project. :paramtype description: str + :keyword max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a + single user can create across all pools in the project. This will have no effect on existing + Dev Boxes when reduced. + :paramtype max_dev_boxes_per_user: int """ - super().__init__(dev_center_id=dev_center_id, description=description, **kwargs) + super().__init__( + dev_center_id=dev_center_id, + description=description, + max_dev_boxes_per_user=max_dev_boxes_per_user, + **kwargs + ) self.provisioning_state = None self.dev_center_uri = None class ProjectUpdate(TrackedResourceUpdate): - """The project properties for partial update. Properties not provided in the update request will not be changed. + """The project properties for partial update. Properties not provided in the update request will + not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -3762,13 +4021,22 @@ class ProjectUpdate(TrackedResourceUpdate): :vartype dev_center_id: str :ivar description: Description of the project. :vartype description: str + :ivar max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a single + user can create across all pools in the project. This will have no effect on existing Dev Boxes + when reduced. + :vartype max_dev_boxes_per_user: int """ + _validation = { + "max_dev_boxes_per_user": {"minimum": 0}, + } + _attribute_map = { "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, "dev_center_id": {"key": "properties.devCenterId", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, + "max_dev_boxes_per_user": {"key": "properties.maxDevBoxesPerUser", "type": "int"}, } def __init__( @@ -3778,8 +4046,9 @@ def __init__( location: Optional[str] = None, dev_center_id: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + max_dev_boxes_per_user: Optional[int] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -3789,10 +4058,15 @@ def __init__( :paramtype dev_center_id: str :keyword description: Description of the project. :paramtype description: str + :keyword max_dev_boxes_per_user: When specified, limits the maximum number of Dev Boxes a + single user can create across all pools in the project. This will have no effect on existing + Dev Boxes when reduced. + :paramtype max_dev_boxes_per_user: int """ super().__init__(tags=tags, location=location, **kwargs) self.dev_center_id = dev_center_id self.description = description + self.max_dev_boxes_per_user = max_dev_boxes_per_user class RecommendedMachineConfiguration(_serialization.Model): @@ -3816,7 +4090,7 @@ class RecommendedMachineConfiguration(_serialization.Model): "v_cp_us": {"key": "vCPUs", "type": "ResourceRange"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.memory = None @@ -3844,7 +4118,7 @@ class ResourceRange(_serialization.Model): "max": {"key": "max", "type": "int"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.min = None @@ -3877,7 +4151,7 @@ class Schedule(Resource): :vartype time_zone: str :ivar state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", @@ -3913,9 +4187,9 @@ def __init__( frequency: Optional[Union[str, "_models.ScheduledFrequency"]] = None, time: Optional[str] = None, time_zone: Optional[str] = None, - state: Optional[Union[str, "_models.EnableStatus"]] = None, - **kwargs - ): + state: Optional[Union[str, "_models.ScheduleEnableStatus"]] = None, + **kwargs: Any + ) -> None: """ :keyword type_properties_type: Supported type this scheduled task represents. "StopDevBox" :paramtype type_properties_type: str or ~azure.mgmt.devcenter.models.ScheduledType @@ -3927,7 +4201,7 @@ def __init__( :paramtype time_zone: str :keyword state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ super().__init__(**kwargs) self.type_properties_type = type_properties_type @@ -3959,7 +4233,7 @@ class ScheduleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -3979,7 +4253,7 @@ class ScheduleUpdateProperties(_serialization.Model): :vartype time_zone: str :ivar state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ _attribute_map = { @@ -3997,9 +4271,9 @@ def __init__( frequency: Optional[Union[str, "_models.ScheduledFrequency"]] = None, time: Optional[str] = None, time_zone: Optional[str] = None, - state: Optional[Union[str, "_models.EnableStatus"]] = None, - **kwargs - ): + state: Optional[Union[str, "_models.ScheduleEnableStatus"]] = None, + **kwargs: Any + ) -> None: """ :keyword type: Supported type this scheduled task represents. "StopDevBox" :paramtype type: str or ~azure.mgmt.devcenter.models.ScheduledType @@ -4011,7 +4285,7 @@ def __init__( :paramtype time_zone: str :keyword state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ super().__init__(**kwargs) self.type = type @@ -4036,7 +4310,7 @@ class ScheduleProperties(ScheduleUpdateProperties): :vartype time_zone: str :ivar state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus :ivar provisioning_state: The provisioning state of the resource. Known values are: "NotSpecified", "Accepted", "Running", "Creating", "Created", "Updating", "Updated", "Deleting", "Deleted", "Succeeded", "Failed", "Canceled", "MovingResources", @@ -4064,9 +4338,9 @@ def __init__( frequency: Optional[Union[str, "_models.ScheduledFrequency"]] = None, time: Optional[str] = None, time_zone: Optional[str] = None, - state: Optional[Union[str, "_models.EnableStatus"]] = None, - **kwargs - ): + state: Optional[Union[str, "_models.ScheduleEnableStatus"]] = None, + **kwargs: Any + ) -> None: """ :keyword type: Supported type this scheduled task represents. "StopDevBox" :paramtype type: str or ~azure.mgmt.devcenter.models.ScheduledType @@ -4078,14 +4352,15 @@ def __init__( :paramtype time_zone: str :keyword state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ super().__init__(type=type, frequency=frequency, time=time, time_zone=time_zone, state=state, **kwargs) self.provisioning_state = None class ScheduleUpdate(TrackedResourceUpdate): - """The schedule properties for partial update. Properties not provided in the update request will not be changed. + """The schedule properties for partial update. Properties not provided in the update request will + not be changed. :ivar tags: Resource tags. :vartype tags: dict[str, str] @@ -4101,7 +4376,7 @@ class ScheduleUpdate(TrackedResourceUpdate): :vartype time_zone: str :ivar state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :vartype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ _attribute_map = { @@ -4123,9 +4398,9 @@ def __init__( frequency: Optional[Union[str, "_models.ScheduledFrequency"]] = None, time: Optional[str] = None, time_zone: Optional[str] = None, - state: Optional[Union[str, "_models.EnableStatus"]] = None, - **kwargs - ): + state: Optional[Union[str, "_models.ScheduleEnableStatus"]] = None, + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -4141,7 +4416,7 @@ def __init__( :paramtype time_zone: str :keyword state: Indicates whether or not this scheduled task is enabled. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.devcenter.models.EnableStatus + :paramtype state: str or ~azure.mgmt.devcenter.models.ScheduleEnableStatus """ super().__init__(tags=tags, location=location, **kwargs) self.type = type @@ -4172,13 +4447,49 @@ class SkuListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None self.next_link = None +class StopOnDisconnectConfiguration(_serialization.Model): + """Stop on disconnect configuration settings for Dev Boxes created in this pool. + + :ivar status: Whether the feature to stop the Dev Box on disconnect once the grace period has + lapsed is enabled. Known values are: "Enabled" and "Disabled". + :vartype status: str or ~azure.mgmt.devcenter.models.StopOnDisconnectEnableStatus + :ivar grace_period_minutes: The specified time in minutes to wait before stopping a Dev Box + once disconnect is detected. + :vartype grace_period_minutes: int + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "grace_period_minutes": {"key": "gracePeriodMinutes", "type": "int"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.StopOnDisconnectEnableStatus"]] = None, + grace_period_minutes: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: Whether the feature to stop the Dev Box on disconnect once the grace period + has lapsed is enabled. Known values are: "Enabled" and "Disabled". + :paramtype status: str or ~azure.mgmt.devcenter.models.StopOnDisconnectEnableStatus + :keyword grace_period_minutes: The specified time in minutes to wait before stopping a Dev Box + once disconnect is detected. + :paramtype grace_period_minutes: int + """ + super().__init__(**kwargs) + self.status = status + self.grace_period_minutes = grace_period_minutes + + class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -4216,8 +4527,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -4270,8 +4581,8 @@ def __init__( limit: Optional[int] = None, unit: Optional[Union[str, "_models.UsageUnit"]] = None, name: Optional["_models.UsageName"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword current_value: The current usage. :paramtype current_value: int @@ -4303,7 +4614,7 @@ class UsageName(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, localized_value: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__(self, *, localized_value: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword localized_value: The localized name of the resource. :paramtype localized_value: str @@ -4336,7 +4647,7 @@ class UserAssignedIdentity(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None @@ -4354,7 +4665,7 @@ class UserRoleAssignmentValue(_serialization.Model): "roles": {"key": "roles", "type": "{EnvironmentRole}"}, } - def __init__(self, *, roles: Optional[Dict[str, "_models.EnvironmentRole"]] = None, **kwargs): + def __init__(self, *, roles: Optional[Dict[str, "_models.EnvironmentRole"]] = None, **kwargs: Any) -> None: """ :keyword roles: A map of roles to assign to the parent user. :paramtype roles: dict[str, ~azure.mgmt.devcenter.models.EnvironmentRole] diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/__init__.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/__init__.py index 18acac80c10d..8db3786da467 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/__init__.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/__init__.py @@ -27,7 +27,7 @@ from ._network_connections_operations import NetworkConnectionsOperations 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/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_attached_networks_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_attached_networks_operations.py index 12236affda6a..94ac0ee96cd0 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_attached_networks_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_attached_networks_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +60,7 @@ def build_list_by_project_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -90,9 +83,7 @@ def build_get_by_project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +102,7 @@ def build_get_by_project_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") @@ -128,9 +119,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +135,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -169,9 +158,7 @@ def build_get_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +177,7 @@ def build_get_by_dev_center_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") @@ -211,10 +198,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -233,7 +218,7 @@ def build_create_or_update_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") @@ -256,9 +241,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +260,7 @@ def build_delete_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") @@ -330,10 +313,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -357,7 +338,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 @@ -373,7 +354,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 @@ -381,14 +362,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AttachedNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -400,7 +382,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks" + } @distributed_trace def get_by_project( @@ -431,10 +415,8 @@ def get_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) request = build_get_by_project_request( resource_group_name=resource_group_name, @@ -447,10 +429,11 @@ def get_by_project( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -466,7 +449,9 @@ def get_by_project( return deserialized - get_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + get_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/attachednetworks/{attachedNetworkConnectionName}" + } @distributed_trace def list_by_dev_center( @@ -491,10 +476,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -518,7 +501,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 @@ -534,7 +517,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 @@ -542,14 +525,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AttachedNetworkListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -561,7 +545,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks" + } @distributed_trace def get_by_dev_center( @@ -592,10 +578,8 @@ def get_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) request = build_get_by_dev_center_request( resource_group_name=resource_group_name, @@ -608,10 +592,11 @@ def get_by_dev_center( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -627,7 +612,9 @@ def get_by_dev_center( return deserialized - get_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + get_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } def _create_or_update_initial( self, @@ -648,11 +635,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -676,10 +661,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -695,7 +681,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } @overload def begin_create_or_update( @@ -793,8 +781,8 @@ def begin_create_or_update( :type dev_center_name: str :param attached_network_connection_name: The name of the attached NetworkConnection. Required. :type attached_network_connection_name: str - :param body: Represents an attached NetworkConnection. Is either a model type or a IO type. - Required. + :param body: Represents an attached NetworkConnection. Is either a AttachedNetworkConnection + type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.AttachedNetworkConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -815,16 +803,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AttachedNetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AttachedNetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, attached_network_connection_name=attached_network_connection_name, @@ -845,9 +831,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -859,9 +845,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, attached_network_connection_name: str, **kwargs: Any @@ -877,10 +865,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -893,10 +879,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,7 +895,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.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } @distributed_trace def begin_delete( @@ -938,13 +927,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -963,9 +950,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -977,6 +964,8 @@ 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.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/attachednetworks/{attachedNetworkConnectionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_catalogs_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_catalogs_operations.py index def579386cc4..28681e7ec39c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_catalogs_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_catalogs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +60,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -86,9 +79,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +96,7 @@ def build_get_request( "catalogName": _SERIALIZER.url("catalog_name", catalog_name, "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") @@ -122,10 +113,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +131,7 @@ def build_create_or_update_request( "catalogName": _SERIALIZER.url("catalog_name", catalog_name, "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") @@ -161,10 +150,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +168,7 @@ def build_update_request( "catalogName": _SERIALIZER.url("catalog_name", catalog_name, "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") @@ -200,9 +187,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +204,7 @@ def build_delete_request( "catalogName": _SERIALIZER.url("catalog_name", catalog_name, "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") @@ -236,9 +221,7 @@ def build_sync_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,7 +238,7 @@ def build_sync_request( "catalogName": _SERIALIZER.url("catalog_name", catalog_name, "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") @@ -307,10 +290,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CatalogListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.CatalogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -334,7 +315,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 @@ -350,7 +331,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 @@ -358,14 +339,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CatalogListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,7 +359,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs" + } @distributed_trace def get(self, resource_group_name: str, dev_center_name: str, catalog_name: str, **kwargs: Any) -> _models.Catalog: @@ -406,10 +390,8 @@ def get(self, resource_group_name: str, dev_center_name: str, catalog_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -422,10 +404,11 @@ def get(self, resource_group_name: str, dev_center_name: str, catalog_name: str, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -441,7 +424,9 @@ def get(self, resource_group_name: str, dev_center_name: str, catalog_name: str, return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } def _create_or_update_initial( self, @@ -462,11 +447,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -490,10 +473,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -509,7 +493,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @overload def begin_create_or_update( @@ -605,7 +591,7 @@ def begin_create_or_update( :type dev_center_name: str :param catalog_name: The name of the Catalog. Required. :type catalog_name: str - :param body: Represents a catalog. Is either a model type or a IO type. Required. + :param body: Represents a catalog. Is either a Catalog type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Catalog or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -625,16 +611,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, catalog_name=catalog_name, @@ -655,9 +639,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -669,9 +653,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } def _update_initial( self, @@ -692,11 +678,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Catalog]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Catalog]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -720,10 +704,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -741,7 +726,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @overload def begin_update( @@ -837,7 +824,8 @@ def begin_update( :type dev_center_name: str :param catalog_name: The name of the Catalog. Required. :type catalog_name: str - :param body: Updatable catalog properties. Is either a model type or a IO type. Required. + :param body: Updatable catalog properties. Is either a CatalogUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.CatalogUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -857,16 +845,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Catalog] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Catalog] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, catalog_name=catalog_name, @@ -887,9 +873,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -901,9 +887,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, catalog_name: str, **kwargs: Any @@ -919,10 +907,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -935,10 +921,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -950,7 +937,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.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } @distributed_trace def begin_delete( @@ -980,13 +969,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1005,9 +992,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1019,9 +1006,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.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}" + } def _sync_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, catalog_name: str, **kwargs: Any @@ -1037,10 +1026,8 @@ def _sync_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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_sync_request( resource_group_name=resource_group_name, @@ -1053,10 +1040,11 @@ def _sync_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1068,7 +1056,9 @@ def _sync_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _sync_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync"} # type: ignore + _sync_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync" + } @distributed_trace def begin_sync( @@ -1098,13 +1088,11 @@ def begin_sync( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._sync_initial( # type: ignore resource_group_name=resource_group_name, @@ -1123,9 +1111,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1137,6 +1125,8 @@ 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_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync"} # type: ignore + begin_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/catalogs/{catalogName}/sync" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_check_name_availability_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_check_name_availability_operations.py index c72bc31ff8a3..f3eb11a9579c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_check_name_availability_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_check_name_availability_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,10 +38,8 @@ def build_execute_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +50,7 @@ def build_execute_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _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") @@ -136,7 +129,7 @@ def execute( """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is - available. Is either a model type or a IO type. Required. + available. Is either a CheckNameAvailabilityRequest type or a IO type. Required. :type name_availability_request: ~azure.mgmt.devcenter.models.CheckNameAvailabilityRequest or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -158,11 +151,9 @@ def execute( _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", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -183,10 +174,11 @@ def execute( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -203,4 +195,4 @@ def execute( return deserialized - execute.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/checkNameAvailability"} # type: ignore + execute.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/checkNameAvailability"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_box_definitions_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_box_definitions_operations.py index a1e41a94e754..c6325ad592a3 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_box_definitions_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_box_definitions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +60,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -86,9 +79,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +96,7 @@ def build_get_request( "devBoxDefinitionName": _SERIALIZER.url("dev_box_definition_name", dev_box_definition_name, "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") @@ -122,10 +113,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +131,7 @@ def build_create_or_update_request( "devBoxDefinitionName": _SERIALIZER.url("dev_box_definition_name", dev_box_definition_name, "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") @@ -161,10 +150,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +168,7 @@ def build_update_request( "devBoxDefinitionName": _SERIALIZER.url("dev_box_definition_name", dev_box_definition_name, "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") @@ -200,9 +187,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +204,7 @@ def build_delete_request( "devBoxDefinitionName": _SERIALIZER.url("dev_box_definition_name", dev_box_definition_name, "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") @@ -236,9 +221,7 @@ def build_list_by_project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +237,7 @@ def build_list_by_project_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -273,9 +256,7 @@ def build_get_by_project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +273,7 @@ def build_get_by_project_request( "devBoxDefinitionName": _SERIALIZER.url("dev_box_definition_name", dev_box_definition_name, "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") @@ -344,10 +325,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinitionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -371,7 +350,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 @@ -387,7 +366,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 @@ -395,14 +374,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DevBoxDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,7 +394,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions" + } @distributed_trace def get( @@ -445,10 +427,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -461,10 +441,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -480,7 +461,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } def _create_or_update_initial( self, @@ -501,11 +484,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -529,10 +510,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -548,11 +530,13 @@ def _create_or_update_initial( deserialized = self._deserialize("DevBoxDefinition", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @overload def begin_create_or_update( @@ -650,7 +634,8 @@ def begin_create_or_update( :type dev_center_name: str :param dev_box_definition_name: The name of the Dev Box definition. Required. :type dev_box_definition_name: str - :param body: Represents a Dev Box definition. Is either a model type or a IO type. Required. + :param body: Represents a Dev Box definition. Is either a DevBoxDefinition type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.DevBoxDefinition or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -671,16 +656,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, dev_box_definition_name=dev_box_definition_name, @@ -701,9 +684,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -715,9 +698,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } def _update_initial( self, @@ -738,11 +723,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DevBoxDefinition]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DevBoxDefinition]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -766,10 +749,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -787,7 +771,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @overload def begin_update( @@ -885,7 +871,8 @@ def begin_update( :type dev_center_name: str :param dev_box_definition_name: The name of the Dev Box definition. Required. :type dev_box_definition_name: str - :param body: Represents a Dev Box definition. Is either a model type or a IO type. Required. + :param body: Represents a Dev Box definition. Is either a DevBoxDefinitionUpdate type or a IO + type. Required. :type body: ~azure.mgmt.devcenter.models.DevBoxDefinitionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -906,16 +893,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, dev_box_definition_name=dev_box_definition_name, @@ -936,9 +921,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -950,9 +935,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, dev_box_definition_name: str, **kwargs: Any @@ -968,10 +955,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -984,10 +969,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -999,7 +985,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.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @distributed_trace def begin_delete( @@ -1029,13 +1017,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1054,9 +1040,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1068,9 +1054,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.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/devboxdefinitions/{devBoxDefinitionName}" + } @distributed_trace def list_by_project( @@ -1094,10 +1082,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinitionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1121,7 +1107,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 @@ -1137,7 +1123,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 @@ -1145,14 +1131,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DevBoxDefinitionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1164,7 +1151,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions" + } @distributed_trace def get_by_project( @@ -1195,10 +1184,8 @@ def get_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevBoxDefinition] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevBoxDefinition] = kwargs.pop("cls", None) request = build_get_by_project_request( resource_group_name=resource_group_name, @@ -1211,10 +1198,11 @@ def get_by_project( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1230,4 +1218,6 @@ def get_by_project( return deserialized - get_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions/{devBoxDefinitionName}"} # type: ignore + get_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/devboxdefinitions/{devBoxDefinitionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_centers_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_centers_operations.py index c872fe2acca3..1bd6894b984b 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_centers_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_dev_centers_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_subscription_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +53,7 @@ def build_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +72,7 @@ def build_list_by_resource_group_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +87,7 @@ def build_list_by_resource_group_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") @@ -115,9 +106,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +122,7 @@ def build_get_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -150,10 +139,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +156,7 @@ def build_create_or_update_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -188,10 +175,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +192,7 @@ def build_update_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -226,9 +211,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,7 +227,7 @@ def build_delete_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -289,10 +272,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Iter _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenterListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +295,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 @@ -330,7 +311,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 @@ -338,14 +319,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DevCenterListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -357,7 +339,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/devcenters"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/devcenters"} @distributed_trace def list_by_resource_group( @@ -379,10 +361,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenterListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -405,7 +385,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 @@ -421,7 +401,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 @@ -429,14 +409,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DevCenterListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -448,7 +429,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.DevCenter/devcenters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters" + } @distributed_trace def get(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> _models.DevCenter: @@ -475,10 +458,8 @@ def get(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -490,10 +471,11 @@ def get(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -509,7 +491,9 @@ def get(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } def _create_or_update_initial( self, resource_group_name: str, dev_center_name: str, body: Union[_models.DevCenter, IO], **kwargs: Any @@ -525,11 +509,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -552,10 +534,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -571,11 +554,13 @@ def _create_or_update_initial( deserialized = self._deserialize("DevCenter", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @overload def begin_create_or_update( @@ -658,7 +643,7 @@ def begin_create_or_update( :type resource_group_name: str :param dev_center_name: The name of the devcenter. Required. :type dev_center_name: str - :param body: Represents a devcenter. Is either a model type or a IO type. Required. + :param body: Represents a devcenter. Is either a DevCenter type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.DevCenter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -678,16 +663,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, body=body, @@ -707,9 +690,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -721,9 +704,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } def _update_initial( self, resource_group_name: str, dev_center_name: str, body: Union[_models.DevCenterUpdate, IO], **kwargs: Any @@ -739,11 +724,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DevCenter]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DevCenter]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -766,10 +749,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -787,7 +771,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @overload def begin_update( @@ -870,7 +856,8 @@ def begin_update( :type resource_group_name: str :param dev_center_name: The name of the devcenter. Required. :type dev_center_name: str - :param body: Updatable devcenter properties. Is either a model type or a IO type. Required. + :param body: Updatable devcenter properties. Is either a DevCenterUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.DevCenterUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -890,16 +877,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DevCenter] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DevCenter] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, body=body, @@ -919,9 +904,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -933,9 +918,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, **kwargs: Any @@ -951,10 +938,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -966,10 +951,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -981,7 +967,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.DevCenter/devcenters/{devCenterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, dev_center_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1007,13 +995,11 @@ def begin_delete(self, resource_group_name: str, dev_center_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1031,9 +1017,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1045,6 +1031,8 @@ 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.DevCenter/devcenters/{devCenterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_environment_types_operations.py index e2bf5b2e9d3b..6e66421de0bf 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +42,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +58,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -84,9 +77,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +94,7 @@ def build_get_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -120,10 +111,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +129,7 @@ def build_create_or_update_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -159,10 +148,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +166,7 @@ def build_update_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -198,9 +185,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +202,7 @@ def build_delete_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -269,10 +254,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.EnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -296,7 +279,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 @@ -312,7 +295,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 @@ -320,14 +303,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("EnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -339,7 +323,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes" + } @distributed_trace def get( @@ -370,10 +356,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -386,10 +370,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,7 +390,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @overload def create_or_update( @@ -487,7 +474,8 @@ def create_or_update( :type dev_center_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Represents an Environment Type. Is either a model type or a IO type. Required. + :param body: Represents an Environment Type. Is either a EnvironmentType type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.EnvironmentType or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -508,11 +496,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -536,10 +522,11 @@ def create_or_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -555,7 +542,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @overload def update( @@ -637,8 +626,8 @@ def update( :type dev_center_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Updatable environment type properties. Is either a model type or a IO type. - Required. + :param body: Updatable environment type properties. Is either a EnvironmentTypeUpdate type or a + IO type. Required. :type body: ~azure.mgmt.devcenter.models.EnvironmentTypeUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -659,11 +648,9 @@ def update( _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", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -687,10 +674,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -706,7 +694,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -737,10 +727,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -753,10 +741,11 @@ def delete( # 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -768,4 +757,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/environmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_galleries_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_galleries_operations.py index f931ff942045..713f83613df8 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_galleries_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_galleries_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +60,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -86,9 +79,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +96,7 @@ def build_get_request( "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "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") @@ -122,10 +113,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +131,7 @@ def build_create_or_update_request( "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "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") @@ -161,9 +150,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +167,7 @@ def build_delete_request( "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "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") @@ -232,10 +219,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GalleryListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GalleryListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -259,7 +244,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 @@ -275,7 +260,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 @@ -283,14 +268,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GalleryListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,7 +288,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries" + } @distributed_trace def get(self, resource_group_name: str, dev_center_name: str, gallery_name: str, **kwargs: Any) -> _models.Gallery: @@ -331,10 +319,8 @@ def get(self, resource_group_name: str, dev_center_name: str, gallery_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -347,10 +333,11 @@ def get(self, resource_group_name: str, dev_center_name: str, gallery_name: str, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -366,7 +353,9 @@ def get(self, resource_group_name: str, dev_center_name: str, gallery_name: str, return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } def _create_or_update_initial( self, @@ -387,11 +376,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -415,10 +402,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -434,7 +422,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } @overload def begin_create_or_update( @@ -530,7 +520,7 @@ def begin_create_or_update( :type dev_center_name: str :param gallery_name: The name of the gallery. Required. :type gallery_name: str - :param body: Represents a gallery. Is either a model type or a IO type. Required. + :param body: Represents a gallery. Is either a Gallery type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Gallery or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -550,16 +540,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Gallery] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Gallery] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, dev_center_name=dev_center_name, gallery_name=gallery_name, @@ -580,9 +568,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -594,9 +582,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, dev_center_name: str, gallery_name: str, **kwargs: Any @@ -612,10 +602,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -628,10 +616,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -643,7 +632,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.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } @distributed_trace def begin_delete( @@ -673,13 +664,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -698,9 +687,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -712,6 +701,8 @@ 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.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_image_versions_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_image_versions_operations.py index 4a85ad5ff8c0..de97619a52da 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_image_versions_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_image_versions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +47,7 @@ def build_list_by_image_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +65,7 @@ def build_list_by_image_request( "imageName": _SERIALIZER.url("image_name", image_name, "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") @@ -95,9 +88,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +107,7 @@ def build_get_request( "versionName": _SERIALIZER.url("version_name", version_name, "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") @@ -169,10 +160,8 @@ def list_by_image( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageVersionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -197,7 +186,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 @@ -213,7 +202,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 @@ -221,14 +210,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ImageVersionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -240,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_image.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions"} # type: ignore + list_by_image.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions" + } @distributed_trace def get( @@ -281,10 +273,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageVersion] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -299,10 +289,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -318,4 +309,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}/versions/{versionName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_images_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_images_operations.py index 3e9c46c6abd8..dc274133c2ef 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_images_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_images_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +42,7 @@ def build_list_by_dev_center_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +58,7 @@ def build_list_by_dev_center_request( "devCenterName": _SERIALIZER.url("dev_center_name", dev_center_name, "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") @@ -90,9 +83,7 @@ def build_list_by_gallery_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +100,7 @@ def build_list_by_gallery_request( "galleryName": _SERIALIZER.url("gallery_name", gallery_name, "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") @@ -133,9 +124,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +142,7 @@ def build_get_request( "imageName": _SERIALIZER.url("image_name", image_name, "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") @@ -205,10 +194,8 @@ def list_by_dev_center( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -232,7 +219,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 @@ -248,7 +235,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 @@ -256,14 +243,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ImageListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -275,7 +263,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_dev_center.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images"} # type: ignore + list_by_dev_center.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images" + } @distributed_trace def list_by_gallery( @@ -306,10 +296,8 @@ def list_by_gallery( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImageListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ImageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -334,7 +322,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 @@ -350,7 +338,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 @@ -358,14 +346,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ImageListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -377,7 +366,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_gallery.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images"} # type: ignore + list_by_gallery.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images" + } @distributed_trace def get( @@ -410,10 +401,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Image] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Image] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -427,10 +416,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -446,4 +436,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/galleries/{galleryName}/images/{imageName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_network_connections_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_network_connections_operations.py index bcedde3f569e..38b3cec717cb 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_network_connections_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_network_connections_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_subscription_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +55,7 @@ def build_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _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") @@ -81,9 +74,7 @@ def build_list_by_resource_group_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +89,7 @@ def build_list_by_resource_group_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") @@ -117,9 +108,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +124,7 @@ def build_get_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -152,10 +141,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +158,7 @@ def build_create_or_update_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -190,10 +177,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -209,7 +194,7 @@ def build_update_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -228,9 +213,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +229,7 @@ def build_delete_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -268,9 +251,7 @@ def build_list_health_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +267,7 @@ def build_list_health_details_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -305,9 +286,7 @@ def build_get_health_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +302,7 @@ def build_get_health_details_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -340,9 +319,7 @@ def build_run_health_checks_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -358,7 +335,7 @@ def build_run_health_checks_request( "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "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") @@ -369,6 +346,46 @@ def build_run_health_checks_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long + resource_group_name: str, + network_connection_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/outboundNetworkDependenciesEndpoints", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkConnectionName": _SERIALIZER.url("network_connection_name", network_connection_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + class NetworkConnectionsOperations: """ .. warning:: @@ -403,10 +420,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Iter _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnectionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -428,7 +443,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 @@ -444,7 +459,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 @@ -452,14 +467,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("NetworkConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -471,7 +487,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/networkConnections" + } @distributed_trace def list_by_resource_group( @@ -493,10 +511,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnectionListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -519,7 +535,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 @@ -535,7 +551,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 @@ -543,14 +559,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("NetworkConnectionListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -562,7 +579,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.DevCenter/networkConnections"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections" + } @distributed_trace def get(self, resource_group_name: str, network_connection_name: str, **kwargs: Any) -> _models.NetworkConnection: @@ -590,10 +609,8 @@ def get(self, resource_group_name: str, network_connection_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -605,10 +622,11 @@ def get(self, resource_group_name: str, network_connection_name: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -624,7 +642,9 @@ def get(self, resource_group_name: str, network_connection_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } def _create_or_update_initial( self, @@ -644,11 +664,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -671,10 +689,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,11 +709,13 @@ def _create_or_update_initial( deserialized = self._deserialize("NetworkConnection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @overload def begin_create_or_update( @@ -786,7 +807,8 @@ def begin_create_or_update( :param network_connection_name: Name of the Network Connection that can be applied to a Pool. Required. :type network_connection_name: str - :param body: Represents network connection. Is either a model type or a IO type. Required. + :param body: Represents network connection. Is either a NetworkConnection type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.NetworkConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -807,16 +829,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, network_connection_name=network_connection_name, body=body, @@ -836,9 +856,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -850,9 +870,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } def _update_initial( self, @@ -872,11 +894,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.NetworkConnection]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -899,10 +919,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -920,7 +941,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @overload def begin_update( @@ -1012,7 +1035,8 @@ def begin_update( :param network_connection_name: Name of the Network Connection that can be applied to a Pool. Required. :type network_connection_name: str - :param body: Represents network connection. Is either a model type or a IO type. Required. + :param body: Represents network connection. Is either a NetworkConnectionUpdate type or a IO + type. Required. :type body: ~azure.mgmt.devcenter.models.NetworkConnectionUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1033,16 +1057,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.NetworkConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkConnection] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, network_connection_name=network_connection_name, body=body, @@ -1062,9 +1084,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1076,9 +1098,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, network_connection_name: str, **kwargs: Any @@ -1094,10 +1118,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1109,10 +1131,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1124,7 +1147,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.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, network_connection_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1151,13 +1176,11 @@ def begin_delete(self, resource_group_name: str, network_connection_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1175,9 +1198,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1189,9 +1212,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.DevCenter/networkConnections/{networkConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}" + } @distributed_trace def list_health_details( @@ -1217,10 +1242,8 @@ def list_health_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.HealthCheckStatusDetailsListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.HealthCheckStatusDetailsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1244,7 +1267,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 @@ -1260,7 +1283,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 @@ -1268,14 +1291,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("HealthCheckStatusDetailsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1287,7 +1311,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_health_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks"} # type: ignore + list_health_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks" + } @distributed_trace def get_health_details( @@ -1317,10 +1343,8 @@ def get_health_details( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.HealthCheckStatusDetails] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.HealthCheckStatusDetails] = kwargs.pop("cls", None) request = build_get_health_details_request( resource_group_name=resource_group_name, @@ -1332,10 +1356,11 @@ def get_health_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1351,7 +1376,9 @@ def get_health_details( return deserialized - get_health_details.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest"} # type: ignore + get_health_details.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/healthChecks/latest" + } def _run_health_checks_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, network_connection_name: str, **kwargs: Any @@ -1367,10 +1394,8 @@ def _run_health_checks_initial( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_run_health_checks_request( resource_group_name=resource_group_name, @@ -1382,10 +1407,11 @@ def _run_health_checks_initial( # pylint: disable=inconsistent-return-statement params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1397,7 +1423,9 @@ def _run_health_checks_initial( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - _run_health_checks_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks"} # type: ignore + _run_health_checks_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks" + } @distributed_trace def begin_run_health_checks( @@ -1427,13 +1455,11 @@ def begin_run_health_checks( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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._run_health_checks_initial( # type: ignore resource_group_name=resource_group_name, @@ -1451,9 +1477,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1465,6 +1491,106 @@ 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_run_health_checks.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks" + } + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, network_connection_name: str, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpoint"]: + """Lists the endpoints that agents may call as part of Dev Box service administration. These FQDNs + should be allowed for outbound access in order for the Dev Box service to function. - begin_run_health_checks.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/runHealthChecks"} # type: ignore + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_connection_name: Name of the Network Connection that can be applied to a Pool. + Required. + :type network_connection_name: str + :param top: The maximum number of resources to return from the operation. Example: '$top=10'. + Default value is None. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.devcenter.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + network_connection_name=network_connection_name, + subscription_id=self._config.subscription_id, + top=top, + api_version=api_version, + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "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) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_outbound_network_dependencies_endpoints.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/networkConnections/{networkConnectionName}/outboundNetworkDependenciesEndpoints" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operation_statuses_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operation_statuses_operations.py index b1c3daefd8d0..174ba8647af8 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operation_statuses_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operation_statuses_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,9 +38,7 @@ def build_get_request(location: str, operation_id: 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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +52,7 @@ def build_get_request(location: str, operation_id: str, subscription_id: str, ** "operationId": _SERIALIZER.url("operation_id", operation_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") @@ -115,10 +108,8 @@ def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.Operat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationStatus] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -130,10 +121,11 @@ def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.Operat params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -149,8 +141,10 @@ def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.Operat deserialized = self._deserialize("OperationStatus", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/operationStatuses/{operationId}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operations.py index 0702969eca88..76bece119279 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +40,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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,10 +86,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +107,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 @@ -132,7 +123,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 @@ -140,14 +131,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -159,4 +151,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.DevCenter/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.DevCenter/operations"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_pools_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_pools_operations.py index 4256b385c808..c564ff131c4b 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_pools_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_pools_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +60,7 @@ def build_list_by_project_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -86,9 +79,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +96,7 @@ def build_get_request( "poolName": _SERIALIZER.url("pool_name", pool_name, "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") @@ -122,10 +113,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +131,7 @@ def build_create_or_update_request( "poolName": _SERIALIZER.url("pool_name", pool_name, "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") @@ -161,10 +150,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +168,7 @@ def build_update_request( "poolName": _SERIALIZER.url("pool_name", pool_name, "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") @@ -200,9 +187,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +204,7 @@ def build_delete_request( "poolName": _SERIALIZER.url("pool_name", pool_name, "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") @@ -230,6 +215,40 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) +def build_run_health_checks_request( + resource_group_name: str, project_name: str, pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/runHealthChecks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "projectName": _SERIALIZER.url("project_name", project_name, "str"), + "poolName": _SERIALIZER.url("pool_name", pool_name, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class PoolsOperations: """ .. warning:: @@ -271,10 +290,8 @@ def list_by_project( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PoolListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.PoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -298,7 +315,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 @@ -314,7 +331,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 @@ -322,14 +339,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("PoolListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -341,7 +359,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_project.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools"} # type: ignore + list_by_project.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools" + } @distributed_trace def get(self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any) -> _models.Pool: @@ -370,10 +390,8 @@ def get(self, resource_group_name: str, project_name: str, pool_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -386,10 +404,11 @@ def get(self, resource_group_name: str, project_name: str, pool_name: str, **kwa params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -405,7 +424,9 @@ def get(self, resource_group_name: str, project_name: str, pool_name: str, **kwa return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } def _create_or_update_initial( self, resource_group_name: str, project_name: str, pool_name: str, body: Union[_models.Pool, IO], **kwargs: Any @@ -421,11 +442,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -449,10 +468,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -468,11 +488,13 @@ def _create_or_update_initial( deserialized = self._deserialize("Pool", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @overload def begin_create_or_update( @@ -563,7 +585,7 @@ def begin_create_or_update( :type project_name: str :param pool_name: Name of the pool. Required. :type pool_name: str - :param body: Represents a machine pool. Is either a model type or a IO type. Required. + :param body: Represents a machine pool. Is either a Pool type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Pool or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -583,16 +605,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -613,9 +633,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -627,9 +647,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } def _update_initial( self, @@ -650,11 +672,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Pool]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Pool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -678,10 +698,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -699,7 +720,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @overload def begin_update( @@ -795,7 +818,7 @@ def begin_update( :type project_name: str :param pool_name: Name of the pool. Required. :type pool_name: str - :param body: Represents a machine pool. Is either a model type or a IO type. Required. + :param body: Represents a machine pool. Is either a PoolUpdate type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.PoolUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -815,16 +838,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -845,9 +866,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -859,9 +880,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any @@ -877,10 +900,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -893,10 +914,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -908,7 +930,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.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}" + } @distributed_trace def begin_delete( @@ -938,13 +962,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -963,9 +985,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -977,6 +999,127 @@ 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.DevCenter/projects/{projectName}/pools/{poolName}" + } + + def _run_health_checks_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}"} # type: ignore + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_run_health_checks_request( + resource_group_name=resource_group_name, + project_name=project_name, + pool_name=pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._run_health_checks_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _run_health_checks_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/runHealthChecks" + } + + @distributed_trace + def begin_run_health_checks( + self, resource_group_name: str, project_name: str, pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Triggers a refresh of the pool status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param project_name: The name of the project. Required. + :type project_name: str + :param pool_name: Name of the pool. Required. + :type pool_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._run_health_checks_initial( # type: ignore + resource_group_name=resource_group_name, + project_name=project_name, + pool_name=pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_run_health_checks.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/runHealthChecks" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_allowed_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_allowed_environment_types_operations.py index 7c2654f6178c..165948852975 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_allowed_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_allowed_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +58,7 @@ def build_list_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -84,9 +77,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +94,7 @@ def build_get_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -156,10 +147,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedEnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AllowedEnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -183,7 +172,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 @@ -199,7 +188,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 @@ -207,14 +196,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AllowedEnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -226,7 +216,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes" + } @distributed_trace def get( @@ -257,10 +249,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.AllowedEnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -273,10 +263,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -292,4 +283,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/allowedEnvironmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_environment_types_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_environment_types_operations.py index abde2bba52cb..72e762aacb37 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_environment_types_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_project_environment_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +58,7 @@ def build_list_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -84,9 +77,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +94,7 @@ def build_get_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -120,10 +111,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +129,7 @@ def build_create_or_update_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -159,10 +148,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +166,7 @@ def build_update_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -198,9 +185,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +202,7 @@ def build_delete_request( "environmentTypeName": _SERIALIZER.url("environment_type_name", environment_type_name, "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") @@ -270,10 +255,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentTypeListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectEnvironmentTypeListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -297,7 +280,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 @@ -313,7 +296,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 @@ -321,14 +304,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ProjectEnvironmentTypeListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -340,7 +324,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes" + } @distributed_trace def get( @@ -371,10 +357,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -387,10 +371,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -406,7 +391,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @overload def create_or_update( @@ -488,8 +475,8 @@ def create_or_update( :type project_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Represents a Project Environment Type. Is either a model type or a IO type. - Required. + :param body: Represents a Project Environment Type. Is either a ProjectEnvironmentType type or + a IO type. Required. :type body: ~azure.mgmt.devcenter.models.ProjectEnvironmentType or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -510,11 +497,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -538,10 +523,11 @@ def create_or_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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -557,7 +543,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @overload def update( @@ -639,8 +627,8 @@ def update( :type project_name: str :param environment_type_name: The name of the environment type. Required. :type environment_type_name: str - :param body: Updatable project environment type properties. Is either a model type or a IO - type. Required. + :param body: Updatable project environment type properties. Is either a + ProjectEnvironmentTypeUpdate type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.ProjectEnvironmentTypeUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -661,11 +649,9 @@ def update( _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", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectEnvironmentType] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProjectEnvironmentType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -689,10 +675,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -708,7 +695,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -739,10 +728,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -755,10 +742,11 @@ def delete( # 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -770,4 +758,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/environmentTypes/{environmentTypeName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_projects_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_projects_operations.py index a46bb7295352..210ca5690540 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_projects_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_projects_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_subscription_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +53,7 @@ def build_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +72,7 @@ def build_list_by_resource_group_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +87,7 @@ def build_list_by_resource_group_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") @@ -113,9 +104,7 @@ def build_get_request(resource_group_name: str, project_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +120,7 @@ def build_get_request(resource_group_name: str, project_name: str, subscription_ "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -148,10 +137,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +154,7 @@ def build_create_or_update_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -186,10 +173,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +190,7 @@ def build_update_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -224,9 +209,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +225,7 @@ def build_delete_request( "projectName": _SERIALIZER.url("project_name", project_name, "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") @@ -287,10 +270,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Iter _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -312,7 +293,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 @@ -328,7 +309,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 @@ -336,14 +317,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ProjectListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -355,7 +337,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/projects"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/projects"} @distributed_trace def list_by_resource_group( @@ -377,10 +359,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ProjectListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ProjectListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -403,7 +383,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 @@ -419,7 +399,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 @@ -427,14 +407,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ProjectListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -446,7 +427,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.DevCenter/projects"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects" + } @distributed_trace def get(self, resource_group_name: str, project_name: str, **kwargs: Any) -> _models.Project: @@ -473,10 +456,8 @@ def get(self, resource_group_name: str, project_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -488,10 +469,11 @@ def get(self, resource_group_name: str, project_name: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,7 +489,9 @@ def get(self, resource_group_name: str, project_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } def _create_or_update_initial( self, resource_group_name: str, project_name: str, body: Union[_models.Project, IO], **kwargs: Any @@ -523,11 +507,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -550,10 +532,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -569,11 +552,13 @@ def _create_or_update_initial( deserialized = self._deserialize("Project", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @overload def begin_create_or_update( @@ -656,7 +641,7 @@ def begin_create_or_update( :type resource_group_name: str :param project_name: The name of the project. Required. :type project_name: str - :param body: Represents a project. Is either a model type or a IO type. Required. + :param body: Represents a project. Is either a Project type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Project or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -676,16 +661,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, body=body, @@ -705,9 +688,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -719,9 +702,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } def _update_initial( self, resource_group_name: str, project_name: str, body: Union[_models.ProjectUpdate, IO], **kwargs: Any @@ -737,11 +722,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Project]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Project]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -764,10 +747,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -785,7 +769,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @overload def begin_update( @@ -868,7 +854,8 @@ def begin_update( :type resource_group_name: str :param project_name: The name of the project. Required. :type project_name: str - :param body: Updatable project properties. Is either a model type or a IO type. Required. + :param body: Updatable project properties. Is either a ProjectUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.ProjectUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -888,16 +875,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Project] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Project] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, project_name=project_name, body=body, @@ -917,9 +902,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -931,9 +916,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, project_name: str, **kwargs: Any @@ -949,10 +936,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -964,10 +949,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -979,7 +965,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.DevCenter/projects/{projectName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, project_name: str, **kwargs: Any) -> LROPoller[None]: @@ -1005,13 +993,11 @@ def begin_delete(self, resource_group_name: str, project_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1029,9 +1015,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1043,6 +1029,8 @@ 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.DevCenter/projects/{projectName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_schedules_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_schedules_operations.py index 3d8e859bf912..d794c2e05540 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_schedules_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_schedules_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,9 +50,7 @@ def build_list_by_pool_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +67,7 @@ def build_list_by_pool_request( "poolName": _SERIALIZER.url("pool_name", pool_name, "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") @@ -100,9 +93,7 @@ def build_get_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +113,7 @@ def build_get_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") @@ -148,10 +139,8 @@ def build_create_or_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +160,7 @@ def build_create_or_update_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") @@ -199,10 +188,8 @@ def build_update_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +209,7 @@ def build_update_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") @@ -250,9 +237,7 @@ def build_delete_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -272,7 +257,7 @@ def build_delete_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") @@ -328,10 +313,8 @@ def list_by_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScheduleListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ScheduleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -356,7 +339,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 @@ -372,7 +355,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 @@ -380,14 +363,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ScheduleListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -399,7 +383,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules"} # type: ignore + list_by_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules" + } @distributed_trace def get( @@ -441,10 +427,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -459,10 +443,11 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -478,7 +463,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } def _create_or_update_initial( self, @@ -501,11 +488,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -531,10 +516,11 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -550,11 +536,13 @@ def _create_or_update_initial( deserialized = self._deserialize("Schedule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @overload def begin_create_or_update( @@ -668,7 +656,7 @@ def begin_create_or_update( :type pool_name: str :param schedule_name: The name of the schedule that uniquely identifies it. Required. :type schedule_name: str - :param body: Represents a scheduled task. Is either a model type or a IO type. Required. + :param body: Represents a scheduled task. Is either a Schedule type or a IO type. Required. :type body: ~azure.mgmt.devcenter.models.Schedule or IO :param top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -691,16 +679,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -723,9 +709,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -737,9 +723,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_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } def _update_initial( self, @@ -762,11 +750,9 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Schedule]] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Schedule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -792,10 +778,11 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -813,7 +800,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @overload def begin_update( @@ -927,7 +916,8 @@ def begin_update( :type pool_name: str :param schedule_name: The name of the schedule that uniquely identifies it. Required. :type schedule_name: str - :param body: Represents a scheduled task. Is either a model type or a IO type. Required. + :param body: Represents a scheduled task. Is either a ScheduleUpdate type or a IO type. + Required. :type body: ~azure.mgmt.devcenter.models.ScheduleUpdate or IO :param top: The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. @@ -950,16 +940,14 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Schedule] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, project_name=project_name, pool_name=pool_name, @@ -982,9 +970,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -996,9 +984,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_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -1020,10 +1010,8 @@ 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", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1038,10 +1026,11 @@ 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 - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1053,7 +1042,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.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } @distributed_trace def begin_delete( @@ -1094,13 +1085,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = 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, @@ -1121,9 +1110,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1135,6 +1124,8 @@ 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.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_skus_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_skus_operations.py index 8e28c249035f..1975468a80e4 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_skus_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_skus_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +42,7 @@ def build_list_by_subscription_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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +51,7 @@ def build_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _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") @@ -105,10 +98,8 @@ def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Iter _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SkuListResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SkuListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -130,7 +121,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 @@ -146,7 +137,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 @@ -154,14 +145,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SkuListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -173,4 +165,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/skus"} diff --git a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_usages_operations.py b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_usages_operations.py index e8c1d161238f..8b508e04490f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_usages_operations.py +++ b/sdk/devcenter/azure-mgmt-devcenter/azure/mgmt/devcenter/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +40,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _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", "2022-11-11-preview") - ) # type: Literal["2022-11-11-preview"] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +52,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs "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") @@ -103,10 +96,8 @@ def list_by_location(self, location: str, **kwargs: Any) -> Iterable["_models.Us _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2022-11-11-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ListUsagesResult] + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,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 @@ -144,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 @@ -152,14 +143,15 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ListUsagesResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -171,4 +163,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/locations/{location}/usages" + } diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_create.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_create.py index 1477418ac96a..d322ee7d30ac 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_create.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_create.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_Create.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_Create.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_delete.py index b613b5a2d46e..6abd1aca8cd4 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_dev_center.py index 0e1480eeb44d..3ebeeb934290 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_dev_center.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_GetByDevCenter.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_GetByDevCenter.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_project.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_project.py index af22067bfdc4..294bf6c743d7 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_project.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_get_by_project.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_GetByProject.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_GetByProject.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_dev_center.py index bb4011713309..eafbc8416b58 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_dev_center.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_ListByDevCenter.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_ListByDevCenter.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_project.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_project.py index 9e9126382aa7..a1d5114e2353 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_project.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/attached_networks_list_by_project.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/AttachedNetworks_ListByProject.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/AttachedNetworks_ListByProject.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_ado.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_ado.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_ado.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_ado.py index 7e986b827196..f7eaa28411d4 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_ado.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_ado.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python catalogs_create_or_update_ado.py + python catalogs_create_ado.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, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_CreateAdo.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_CreateAdo.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_git_hub.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_git_hub.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_git_hub.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_git_hub.py index 10019b0c2988..9fcc2ff95ee5 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_or_update_git_hub.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_create_git_hub.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python catalogs_create_or_update_git_hub.py + python catalogs_create_git_hub.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, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_CreateGitHub.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_CreateGitHub.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_delete.py index 5388f58d2cc8..823edb0cc672 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_get.py index 56c04464baf7..cd43d393b6e5 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list_by_dev_center.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list.py index 00a37c27d5c7..54f867a2f464 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python catalogs_list_by_dev_center.py + python catalogs_list.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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_patch.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_patch.py index 29566eaee20a..e8f05dd1dd51 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python catalogs_update.py + python catalogs_patch.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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_sync.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_sync.py index 415f15f33dab..014555f6f05d 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_sync.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/catalogs_sync.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Catalogs_Sync.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Catalogs_Sync.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/name_availability.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/check_name_availability.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/name_availability.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/check_name_availability.py index d8625844192f..0aba3c853249 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/name_availability.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/check_name_availability.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python name_availability.py + python check_name_availability.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/CheckNameAvailability.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_create.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_create.py index 38caea20cf2e..4078bc89e8a3 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_create.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_create.py @@ -40,7 +40,6 @@ def main(): "imageReference": { "id": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/Example/providers/Microsoft.DevCenter/devcenters/Contoso/galleries/contosogallery/images/exampleImage/version/1.0.0" }, - "osStorageType": "SSD_1024", "sku": {"name": "Preview"}, }, }, @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_Create.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_Create.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_delete.py index 9171a37687fc..dc34a1974112 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get.py index 47b230b2642e..6da9dc542e17 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get_by_project.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get_by_project.py index 7aae5f30f370..86d76fd5913c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get_by_project.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_get_by_project.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_GetByProject.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_GetByProject.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_dev_center.py index d6dfacd6373f..0245328bee81 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_dev_center.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_ListByDevCenter.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_ListByDevCenter.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_project.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_project.py index b61a04f24dc2..359bd6866362 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_project.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_list_by_project.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_ListByProject.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_ListByProject.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_patch.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_patch.py index b090dfbe8fa2..2ab783ff7343 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_patch.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_box_definitions_patch.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevBoxDefinitions_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevBoxDefinitions_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create.py index 5c6b50c00c68..166630e0552f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_Create.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_Create.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create_with_user_identity.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create_with_user_identity.py index 15549c55f114..cfa2b4ed1bef 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create_with_user_identity.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_create_with_user_identity.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_CreateWithUserIdentity.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_CreateWithUserIdentity.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_delete.py index c83c6b43fba8..041ee32d2f5b 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_get.py index ed9d59dc8232..46c6ed93d458 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_resource_group.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_resource_group.py index 7ad1e0c6bd30..c8dafb383249 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_resource_group.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_ListByResourceGroup.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_subscription.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_subscription.py index 9043c4c878c6..9b96c32b0d70 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_subscription.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_ListBySubscription.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_patch.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_patch.py index d024b4d3312a..677290b26242 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/dev_centers_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python dev_centers_update.py + python dev_centers_patch.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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/DevCenters_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/DevCenters_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_delete.py index 3d682939f214..538b298c44eb 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/EnvironmentTypes_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/EnvironmentTypes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_get.py index cd5582a6c267..a0581c5b7bda 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/EnvironmentTypes_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/EnvironmentTypes_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list.py similarity index 91% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list_by_dev_center.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list.py index 0b66d02d4710..5b8ec59550bc 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python environment_types_list_by_dev_center.py + python environment_types_list.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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/EnvironmentTypes_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/EnvironmentTypes_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_patch.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_patch.py index 76afdc583c07..a80da0c3e010 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python environment_types_update.py + python environment_types_patch.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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/EnvironmentTypes_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/EnvironmentTypes_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_put.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_put.py index c25f15c1afb2..a1c98b16f1f8 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/environment_types_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python environment_types_create_or_update.py + python environment_types_put.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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/EnvironmentTypes_Put.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/EnvironmentTypes_Put.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create.py index 5c357607b63c..9bc725007801 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python galleries_create_or_update.py + python galleries_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Galleries_Create.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Galleries_Create.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_delete.py index 5242a184976b..0a8df9fa89a4 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Galleries_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Galleries_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_get.py index d93baf8de95f..0014eadd4ddd 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Galleries_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Galleries_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list_by_dev_center.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list.py index 6a17be65482a..9b595f0590bd 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/galleries_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python galleries_list_by_dev_center.py + python galleries_list.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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Galleries_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Galleries_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/versions_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_get.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/versions_get.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_get.py index 926b6a6c6999..56ed91c80b8c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/versions_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python versions_get.py + python image_versions_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ImageVersions_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ImageVersions_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list_by_image.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list_by_image.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list.py index 5f963df2598b..c998f1c8ba1f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list_by_image.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/image_versions_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python image_versions_list_by_image.py + python image_versions_list.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, @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ImageVersions_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ImageVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_get.py index c2bfb4f2e3a0..7486c4dd8326 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Images_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Images_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_dev_center.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_dev_center.py index 1c8aa71c6756..022399fd85c4 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_dev_center.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_dev_center.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Images_ListByDevCenter.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Images_ListByDevCenter.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_gallery.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_gallery.py index 30857c4bc4b1..498a47343ae1 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_gallery.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/images_list_by_gallery.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Images_ListByGallery.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Images_ListByGallery.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_delete.py index 7abbc3a84c74..ada92e384907 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get.py index f711d73f0eff..879ab968fd3b 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get_health_details.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get_health_details.py index 09aebf58d399..b5cd92f89ca3 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get_health_details.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_get_health_details.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_GetHealthDetails.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_GetHealthDetails.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_resource_group.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_resource_group.py index eb63c1abb1a9..d26dfd06ffa6 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_resource_group.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_ListByResourceGroup.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_subscription.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_subscription.py index eff35609c8f5..56561032d58e 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_subscription.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_ListBySubscription.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_health_details.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_health_details.py index fafda38a389a..be5eca6494d0 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_health_details.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_health_details.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_ListHealthDetails.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_ListHealthDetails.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_outbound_network_dependencies_endpoints.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_outbound_network_dependencies_endpoints.py new file mode 100644 index 000000000000..36cb64a69341 --- /dev/null +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_list_outbound_network_dependencies_endpoints.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.devcenter import DevCenterMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-devcenter +# USAGE + python network_connections_list_outbound_network_dependencies_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DevCenterMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="0ac520ee-14c0-480f-b6c9-0a90c58ffff", + ) + + response = client.network_connections.list_outbound_network_dependencies_endpoints( + resource_group_name="rg1", + network_connection_name="uswest3network", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_ListOutboundNetworkDependenciesEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_patch.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_patch.py index 888750f876b2..334c3cb315fc 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python network_connections_update.py + python network_connections_patch.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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_put.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_put.py index c667f9357383..deed9b71af1f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python network_connections_create_or_update.py + python network_connections_put.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, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_Put.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_Put.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_run_health_checks.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_run_health_checks.py index 59df5ba874dc..8c9b9e235369 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_run_health_checks.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/network_connections_run_health_checks.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/NetworkConnections_RunHealthChecks.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/NetworkConnections_RunHealthChecks.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/get_operation_status.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operation_status_get.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/get_operation_status.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/operation_status_get.py index 19dc15295b92..e33d37e2826c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/get_operation_status.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operation_status_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python get_operation_status.py + python operation_status_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/OperationStatus_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/OperationStatus_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operations_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operations_get.py index c655e7a6838d..d885c7c12e16 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operations_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/operations_get.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Operations_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Operations_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_delete.py index 1cc65196cecf..43b3ba3ae385 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Pools_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get.py index a8bb7ce352f7..e495c9c28a67 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Pools_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get_unhealthy_status.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get_unhealthy_status.py new file mode 100644 index 000000000000..90eca2be528e --- /dev/null +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_get_unhealthy_status.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.devcenter import DevCenterMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-devcenter +# USAGE + python pools_get_unhealthy_status.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DevCenterMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="0ac520ee-14c0-480f-b6c9-0a90c58ffff", + ) + + response = client.pools.get( + resource_group_name="rg1", + project_name="DevProject", + pool_name="DevPool", + ) + print(response) + + +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_GetUnhealthyStatus.json +if __name__ == "__main__": + main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list_by_project.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list_by_project.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list.py index 18b4f3ad9a3a..d0d0ce1cb973 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list_by_project.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python pools_list_by_project.py + python pools_list.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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Pools_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_patch.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_patch.py index caa83ddac175..69d39a457dee 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python pools_update.py + python pools_patch.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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Pools_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_put.py similarity index 91% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_put.py index 5eff962ae58b..df227ff15f7c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python pools_create_or_update.py + python pools_put.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, @@ -40,12 +40,13 @@ def main(): "licenseType": "Windows_Client", "localAdministrator": "Enabled", "networkConnectionName": "Network1-westus2", + "stopOnDisconnect": {"gracePeriodMinutes": 60, "status": "Enabled"}, }, }, ).result() print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Pools_Put.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_Put.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_run_health_checks.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_run_health_checks.py new file mode 100644 index 000000000000..3d306fb27a12 --- /dev/null +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/pools_run_health_checks.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.devcenter import DevCenterMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-devcenter +# USAGE + python pools_run_health_checks.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DevCenterMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="0ac520ee-14c0-480f-b6c9-0a90c58ffff", + ) + + response = client.pools.begin_run_health_checks( + resource_group_name="rg1", + project_name="DevProject", + pool_name="DevPool", + ).result() + print(response) + + +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_RunHealthChecks.json +if __name__ == "__main__": + main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_get.py index 061197485b2e..c0e347a022d2 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectAllowedEnvironmentTypes_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectAllowedEnvironmentTypes_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_list.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_list.py index f6c90f489402..4bb4239dbaa5 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_list.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_allowed_environment_types_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectAllowedEnvironmentTypes_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectAllowedEnvironmentTypes_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_delete.py index 62e64c1bf1c8..7faa191113d9 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_delete.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectEnvironmentTypes_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectEnvironmentTypes_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_get.py index c65e8f616819..9701b9e5067c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectEnvironmentTypes_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectEnvironmentTypes_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_list.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_list.py index 2f5abff12342..0f53c430d880 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_list.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectEnvironmentTypes_List.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectEnvironmentTypes_List.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_patch.py similarity index 94% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_patch.py index dca5ab7d08fe..d91f3d1a51ee 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python project_environment_types_update.py + python project_environment_types_patch.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, @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectEnvironmentTypes_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectEnvironmentTypes_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_put.py similarity index 94% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_put.py index 49a8257f6961..bf56472d8f9d 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/project_environment_types_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python project_environment_types_create_or_update.py + python project_environment_types_put.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, @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/ProjectEnvironmentTypes_Put.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/ProjectEnvironmentTypes_Put.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_delete.py index a41267ffe7c4..3f98831cd9e7 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_delete.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_get.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_get.py index 393e3401fff0..1e08ba2fe8aa 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_get.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_resource_group.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_resource_group.py index 508cebf70f0e..74547888fb7c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_resource_group.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_ListByResourceGroup.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_subscription.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_subscription.py index 06a7753b36f2..60d3443e7fe5 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_subscription.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_ListBySubscription.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_patch.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_patch.py index b43b60f90e7e..532ceea39d9d 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python projects_update.py + python projects_patch.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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_create_or_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put.py similarity index 94% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_create_or_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put.py index 3da7a3fe104b..5725412d1eae 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_create_or_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python projects_create_or_update.py + python projects_put.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, @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Projects_Put.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_Put.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put_with_max_dev_box_per_user.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put_with_max_dev_box_per_user.py new file mode 100644 index 000000000000..44f910eea7f6 --- /dev/null +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/projects_put_with_max_dev_box_per_user.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.devcenter import DevCenterMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-devcenter +# USAGE + python projects_put_with_max_dev_box_per_user.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DevCenterMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="0ac520ee-14c0-480f-b6c9-0a90c58ffff", + ) + + response = client.projects.begin_create_or_update( + resource_group_name="rg1", + project_name="DevProject", + body={ + "location": "centralus", + "properties": { + "description": "This is my first project.", + "devCenterId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/rg1/providers/Microsoft.DevCenter/devcenters/Contoso", + "maxDevBoxesPerUser": 3, + }, + "tags": {"CostCenter": "R&D"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Projects_PutWithMaxDevBoxPerUser.json +if __name__ == "__main__": + main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_create_daily_shutdown_pool_schedule.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_create_daily_shutdown_pool_schedule.py index 49adc19b62bf..fa2c3dc09848 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_create_daily_shutdown_pool_schedule.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_create_daily_shutdown_pool_schedule.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Schedules_CreateDailyShutdownPoolSchedule.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Schedules_CreateDailyShutdownPoolSchedule.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_delete.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_delete.py index e28d8d576ee6..b5ef4bc7fedf 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_delete.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Schedules_Delete.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Schedules_Delete.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get_by_pool.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get_by_pool.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get.py index b15211ea1777..ce47cbec6f25 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get_by_pool.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python schedules_get_by_pool.py + python schedules_get.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Schedules_Get.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Schedules_Get.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_list_by_pool.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_list_by_pool.py index 5928b0b58dc9..b919d10b6c1f 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_list_by_pool.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_list_by_pool.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Schedules_ListByPool.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Schedules_ListByPool.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_update.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_patch.py similarity index 93% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_update.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_patch.py index 2f680ae620c1..9dc519148799 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_update.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/schedules_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python schedules_update.py + python schedules_patch.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, @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Schedules_Patch.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Schedules_Patch.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/skus_list_by_subscription.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/skus_list_by_subscription.py index 07dae1eba543..35055c9a3b91 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/skus_list_by_subscription.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/skus_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Skus_ListBySubscription.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Skus_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/list_usages.py b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/usages_list_by_location.py similarity index 92% rename from sdk/devcenter/azure-mgmt-devcenter/generated_samples/list_usages.py rename to sdk/devcenter/azure-mgmt-devcenter/generated_samples/usages_list_by_location.py index bf60f206c42e..360b956f678c 100644 --- a/sdk/devcenter/azure-mgmt-devcenter/generated_samples/list_usages.py +++ b/sdk/devcenter/azure-mgmt-devcenter/generated_samples/usages_list_by_location.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-devcenter # USAGE - python list_usages.py + python usages_list_by_location.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, @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/preview/2022-11-11-preview/examples/Usages_ListByLocation.json +# x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Usages_ListByLocation.json if __name__ == "__main__": main()