diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json b/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json index 1045106544a3..1d95b7dbc5ba 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json +++ b/sdk/servicefabric/azure-mgmt-servicefabric/_meta.json @@ -1,11 +1,11 @@ { - "commit": "51db80e40c32f4bf4c57169476d81d36fb8c81d8", + "commit": "b97312721d6eca422a87c1b55468d2180edae1ab", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.4.0", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/servicefabric/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/servicefabric/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.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/servicefabric/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/__init__.py index b4beea682843..a1e1b6c82e5b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/__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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py index f9505f58e07e..9dc4afe809c2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_configuration.py @@ -42,7 +42,7 @@ class ServiceFabricManagementClientConfiguration(Configuration): # pylint: disa def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ServiceFabricManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-06-01") # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", "2021-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-servicefabric/{}".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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_serialization.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_serialization.py index 7c1dedb5133d..f17c068e833e 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_serialization.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,23 +38,38 @@ import re import sys import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate - -from typing import Dict, Any, cast, TYPE_CHECKING +import isodate # type: ignore from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] class RawDeserializer: @@ -65,8 +81,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +147,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +174,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +202,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +233,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,12 +290,12 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -290,27 +304,27 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,13 +333,13 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -339,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -387,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -399,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -412,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -453,7 +477,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -521,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -537,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -606,13 +630,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +645,22 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): - unflattened = {k: new_attr} - new_attr = unflattened + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -659,8 +682,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -675,7 +698,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -780,6 +803,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -843,7 +868,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +1026,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1164,7 +1189,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1335,7 +1361,7 @@ class Deserializer(object): valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1355,7 +1381,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1416,7 +1442,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1470,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1474,7 +1500,7 @@ def _classify_target(self, target, data): Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1489,7 +1515,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1499,7 +1525,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): a deserialization error. :param str target_obj: The target object type to deserialize to. - :param str/dict data: The response data to deseralize. + :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: @@ -1543,7 +1569,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1591,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1773,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1824,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1836,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1852,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1867,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1897,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1912,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1927,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1950,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1986,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py index 7b2941cf9f5d..41e22a080cf4 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_service_fabric_management_client.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import ServiceFabricManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -73,7 +73,7 @@ def __init__( ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -113,15 +113,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: () -> ServiceFabricManagementClient + def __enter__(self) -> "ServiceFabricManagementClient": 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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_vendor.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_vendor.py index 9aad73fc743e..bd0df84f5319 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_vendor.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py index b82e03a368ff..e5754a47ce68 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/__init__.py index 9d60dc161aef..82043be1c40a 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py index c92d2ed703e6..442d2d507742 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_configuration.py @@ -42,7 +42,7 @@ class ServiceFabricManagementClientConfiguration(Configuration): # pylint: disa def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ServiceFabricManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-06-01") # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", "2021-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py index 2a5d718c5ab9..1b0821ac6472 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/_service_fabric_management_client.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import ServiceFabricManagementClientConfiguration from .operations import ( @@ -73,7 +73,7 @@ def __init__( ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -120,5 +120,5 @@ async def __aenter__(self) -> "ServiceFabricManagementClient": 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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py index 69103382d011..aa1919dd5f64 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/__init__.py @@ -15,7 +15,7 @@ from ._services_operations import ServicesOperations 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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py index 07815c452976..0e2f4baef5c8 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_type_versions_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] + ) + cls: ClsType[_models.ApplicationTypeVersionResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -132,7 +132,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } async def _create_or_update_initial( self, @@ -154,11 +156,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeVersionResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -183,9 +185,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +205,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @overload async def begin_create_or_update( @@ -315,8 +319,8 @@ async def begin_create_or_update( :type application_type_name: str :param version: The application type version. Required. :type version: str - :param parameters: The application type version resource. Is either a model type or a IO type. - Required. + :param parameters: The application type version resource. Is either a + ApplicationTypeVersionResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationTypeVersionResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -338,16 +342,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeVersionResource] = 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, cluster_name=cluster_name, application_type_name=application_type_name, @@ -369,7 +373,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -381,9 +385,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_type_name: str, version: str, **kwargs: Any @@ -399,10 +405,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -416,9 +422,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -432,7 +438,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @distributed_trace_async async def begin_delete( @@ -465,13 +473,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -491,7 +499,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -503,9 +511,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @distributed_trace_async async def list( @@ -539,10 +549,10 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResourceList] + ) + cls: ClsType[_models.ApplicationTypeVersionResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -555,9 +565,9 @@ async def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -575,4 +585,6 @@ async def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py index a11ceec2680f..b8fb5a022618 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_application_types_operations.py @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResource] + ) + cls: ClsType[_models.ApplicationTypeResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @overload async def create_or_update( @@ -214,8 +216,8 @@ async def create_or_update( :type cluster_name: str :param application_type_name: The name of the application type name resource. Required. :type application_type_name: str - :param parameters: The application type name resource. Is either a model type or a IO type. - Required. + :param parameters: The application type name resource. Is either a ApplicationTypeResource type + or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationTypeResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -236,11 +238,11 @@ 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: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -264,9 +266,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +286,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_type_name: str, **kwargs: Any @@ -300,10 +304,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -316,9 +320,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -332,7 +336,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @distributed_trace_async async def begin_delete( @@ -363,13 +369,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -388,7 +394,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -400,9 +406,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @distributed_trace_async async def list( @@ -434,10 +442,10 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResourceList] + ) + cls: ClsType[_models.ApplicationTypeResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -449,9 +457,9 @@ async def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -469,4 +477,6 @@ async def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py index 17a29a414e21..818ff157f333 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_applications_operations.py @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -130,7 +130,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } async def _create_or_update_initial( self, @@ -151,11 +153,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -179,9 +181,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -199,7 +201,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @overload async def begin_create_or_update( @@ -302,7 +306,8 @@ async def begin_create_or_update( :type cluster_name: str :param application_name: The name of the application resource. Required. :type application_name: str - :param parameters: The application resource. Is either a model type or a IO type. Required. + :param parameters: The application resource. Is either a ApplicationResource type or a IO type. + Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -324,16 +329,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -354,7 +359,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -366,9 +371,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } async def _update_initial( self, @@ -389,11 +396,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -417,9 +424,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -437,7 +444,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @overload async def begin_update( @@ -540,8 +549,8 @@ async def begin_update( :type cluster_name: str :param application_name: The name of the application resource. Required. :type application_name: str - :param parameters: The application resource for patch operations. Is either a model type or a - IO type. Required. + :param parameters: The application resource for patch operations. Is either a + ApplicationResourceUpdate type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -563,16 +572,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -593,7 +602,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -605,9 +614,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any @@ -623,10 +634,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -639,9 +650,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -655,7 +666,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @distributed_trace_async async def begin_delete( @@ -686,13 +699,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -711,7 +724,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -723,9 +736,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @distributed_trace_async async def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ApplicationResourceList: @@ -755,10 +770,10 @@ async def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResourceList] + ) + cls: ClsType[_models.ApplicationResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -770,9 +785,9 @@ async def list(self, resource_group_name: str, cluster_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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -790,4 +805,6 @@ async def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py index 16ec5331b2bc..97f052963b81 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_cluster_versions_operations.py @@ -88,10 +88,10 @@ async def get(self, location: str, cluster_version: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -103,9 +103,9 @@ async def get(self, location: str, cluster_version: str, **kwargs: Any) -> _mode params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -123,7 +123,9 @@ async def get(self, location: str, cluster_version: str, **kwargs: Any) -> _mode return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}" + } @distributed_trace_async async def get_by_environment( @@ -162,10 +164,10 @@ async def get_by_environment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_get_by_environment_request( location=location, @@ -178,9 +180,9 @@ async def get_by_environment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +200,9 @@ async def get_by_environment( return deserialized - get_by_environment.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}"} # type: ignore + get_by_environment.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}" + } @distributed_trace_async async def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersionsListResult: @@ -225,10 +229,10 @@ async def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersion _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_list_request( location=location, @@ -239,9 +243,9 @@ async def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersion params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -259,7 +263,9 @@ async def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersion return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions" + } @distributed_trace_async async def list_by_environment( @@ -291,10 +297,10 @@ async def list_by_environment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_list_by_environment_request( location=location, @@ -306,9 +312,9 @@ async def list_by_environment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -326,4 +332,6 @@ async def list_by_environment( return deserialized - list_by_environment.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions"} # type: ignore + list_by_environment.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py index 88c399eb4e1a..80f59d16093b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_clusters_operations.py @@ -92,10 +92,10 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -107,9 +107,9 @@ async def get(self, resource_group_name: str, cluster_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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -127,7 +127,9 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } async def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, parameters: Union[_models.Cluster, IO], **kwargs: Any @@ -143,11 +145,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -170,9 +172,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -190,11 +192,13 @@ async def _create_or_update_initial( deserialized = self._deserialize("Cluster", 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.ServiceFabric/clusters/{clusterName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @overload async def begin_create_or_update( @@ -282,7 +286,7 @@ async def begin_create_or_update( :type resource_group_name: str :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str - :param parameters: The cluster resource. Is either a model type or a IO type. Required. + :param parameters: The cluster resource. Is either a Cluster type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -303,16 +307,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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, cluster_name=cluster_name, parameters=parameters, @@ -332,7 +336,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -344,9 +348,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.ServiceFabric/clusters/{clusterName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } async def _update_initial( self, @@ -366,11 +372,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -393,9 +399,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -413,11 +419,13 @@ async def _update_initial( deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @overload async def begin_update( @@ -512,7 +520,8 @@ async def begin_update( :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str :param parameters: The parameters which contains the property value and property name which - used to update the cluster configuration. Is either a model type or a IO type. Required. + used to update the cluster configuration. Is either a ClusterUpdateParameters type or a IO + type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ClusterUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -533,16 +542,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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, cluster_name=cluster_name, parameters=parameters, @@ -562,7 +571,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -574,9 +583,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.ServiceFabric/clusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -606,10 +617,10 @@ 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: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -621,9 +632,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -637,7 +648,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @distributed_trace_async async def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.ClusterListResult: @@ -664,10 +677,10 @@ async def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterListResult] + ) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) request = build_list_by_resource_group_request( resource_group_name=resource_group_name, @@ -678,9 +691,9 @@ async def list_by_resource_group(self, resource_group_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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -698,7 +711,9 @@ async def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) return deserialized - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters" + } @distributed_trace_async async def list(self, **kwargs: Any) -> _models.ClusterListResult: @@ -723,10 +738,10 @@ async def list(self, **kwargs: Any) -> _models.ClusterListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterListResult] + ) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -736,9 +751,9 @@ async def list(self, **kwargs: Any) -> _models.ClusterListResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -756,7 +771,7 @@ async def list(self, **kwargs: Any) -> _models.ClusterListResult: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters"} @overload async def list_upgradable_versions( @@ -844,7 +859,7 @@ async def list_upgradable_versions( :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str :param versions_description: The upgrade path description with target version. Is either a - model type or a IO type. Default value is None. + UpgradableVersionsDescription type or a IO type. Default value is None. :type versions_description: ~azure.mgmt.servicefabric.models.UpgradableVersionsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -866,11 +881,11 @@ async def list_upgradable_versions( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpgradableVersionPathResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpgradableVersionPathResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -896,9 +911,9 @@ async def list_upgradable_versions( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -916,4 +931,6 @@ async def list_upgradable_versions( return deserialized - list_upgradable_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions"} # type: ignore + list_upgradable_versions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py index ee2de086d6d1..9fc2737d7b50 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_operations.py @@ -72,10 +72,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -95,7 +95,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 @@ -111,7 +111,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 @@ -119,13 +119,13 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,4 +139,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.ServiceFabric/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.ServiceFabric/operations"} diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py index a6e67358ba95..0dff4dd4c7f9 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/aio/operations/_services_operations.py @@ -97,10 +97,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } async def _create_or_update_initial( self, @@ -156,11 +158,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -185,9 +187,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,7 +207,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @overload async def begin_create_or_update( @@ -318,7 +322,8 @@ async def begin_create_or_update( :param service_name: The name of the service resource in the format of {applicationName}~{serviceName}. Required. :type service_name: str - :param parameters: The service resource. Is either a model type or a IO type. Required. + :param parameters: The service resource. Is either a ServiceResource type or a IO type. + Required. :type parameters: ~azure.mgmt.servicefabric.models.ServiceResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -339,16 +344,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -370,7 +375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -382,9 +387,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } async def _update_initial( self, @@ -406,11 +413,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -435,9 +442,9 @@ 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 + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -455,7 +462,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @overload async def begin_update( @@ -568,8 +577,8 @@ async def begin_update( :param service_name: The name of the service resource in the format of {applicationName}~{serviceName}. Required. :type service_name: str - :param parameters: The service resource for patch operations. Is either a model type or a IO - type. Required. + :param parameters: The service resource for patch operations. Is either a ServiceResourceUpdate + type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ServiceResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -590,16 +599,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -621,7 +630,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -633,9 +642,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_name: str, service_name: str, **kwargs: Any @@ -651,10 +662,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -668,9 +679,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -684,7 +695,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @distributed_trace_async async def begin_delete( @@ -718,13 +731,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -744,7 +757,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -756,9 +769,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @distributed_trace_async async def list( @@ -792,10 +807,10 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceList] + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -808,9 +823,9 @@ async def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -828,4 +843,6 @@ async def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py index 70625ed68343..d3cf26904da5 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/__init__.py @@ -104,7 +104,7 @@ from ._service_fabric_management_client_enums import UpgradeMode from ._service_fabric_management_client_enums import VmssZonalUpgradeMode 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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py index 7f9f1ad9efe3..7b0724b3f88b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_models_py3.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/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 @@ -18,7 +18,8 @@ class ApplicationDeltaHealthPolicy(_serialization.Model): - """Defines a delta health policy used to evaluate the health of an application or one of its child entities when upgrading the cluster. + """Defines a delta health policy used to evaluate the health of an application or one of its child + entities when upgrading the cluster. :ivar default_service_type_delta_health_policy: The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. @@ -46,8 +47,8 @@ def __init__( *, default_service_type_delta_health_policy: Optional["_models.ServiceTypeDeltaHealthPolicy"] = None, service_type_delta_health_policies: Optional[Dict[str, "_models.ServiceTypeDeltaHealthPolicy"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword default_service_type_delta_health_policy: The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. @@ -64,7 +65,8 @@ def __init__( class ApplicationHealthPolicy(_serialization.Model): - """Defines a health policy used to evaluate the health of an application or one of its children entities. + """Defines a health policy used to evaluate the health of an application or one of its children + entities. :ivar default_service_type_health_policy: The health policy used by default to evaluate the health of a service type. @@ -89,8 +91,8 @@ def __init__( *, default_service_type_health_policy: Optional["_models.ServiceTypeHealthPolicy"] = None, service_type_health_policies: Optional[Dict[str, "_models.ServiceTypeHealthPolicy"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword default_service_type_health_policy: The health policy used by default to evaluate the health of a service type. @@ -107,7 +109,8 @@ def __init__( class ApplicationMetricDescription(_serialization.Model): - """Describes capacity information for a custom resource balancing metric. This can be used to limit the total consumption of this metric by the services of this application. + """Describes capacity information for a custom resource balancing metric. This can be used to + limit the total consumption of this metric by the services of this application. :ivar name: The name of the metric. :vartype name: str @@ -152,8 +155,8 @@ def __init__( maximum_capacity: Optional[int] = None, reservation_capacity: Optional[int] = None, total_application_capacity: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the metric. :paramtype name: str @@ -230,7 +233,7 @@ class ProxyResource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -349,8 +352,8 @@ def __init__( metrics: Optional[List["_models.ApplicationMetricDescription"]] = None, managed_identities: Optional[List["_models.ApplicationUserAssignedIdentity"]] = None, type_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -422,7 +425,7 @@ class ApplicationResourceList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ApplicationResource"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.ApplicationResource"]] = None, **kwargs: Any) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.ApplicationResource] @@ -489,8 +492,8 @@ def __init__( remove_application_capacity: Optional[bool] = None, metrics: Optional[List["_models.ApplicationMetricDescription"]] = None, managed_identities: Optional[List["_models.ApplicationUserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type_version: The version of the application type as defined in the application manifest. @@ -598,8 +601,8 @@ def __init__( metrics: Optional[List["_models.ApplicationMetricDescription"]] = None, managed_identities: Optional[List["_models.ApplicationUserAssignedIdentity"]] = None, type_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type_version: The version of the application type as defined in the application manifest. @@ -733,8 +736,8 @@ def __init__( remove_application_capacity: Optional[bool] = None, metrics: Optional[List["_models.ApplicationMetricDescription"]] = None, managed_identities: Optional[List["_models.ApplicationUserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -824,7 +827,7 @@ class ApplicationTypeResource(ProxyResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -856,7 +859,7 @@ class ApplicationTypeResourceList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ApplicationTypeResource"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.ApplicationTypeResource"]] = None, **kwargs: Any) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.ApplicationTypeResource] @@ -925,8 +928,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, app_package_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -943,7 +946,8 @@ def __init__( class ApplicationTypeVersionResourceList(_serialization.Model): - """The list of application type version resources for the specified application type name resource. + """The list of application type version resources for the specified application type name + resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -963,7 +967,9 @@ class ApplicationTypeVersionResourceList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ApplicationTypeVersionResource"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.ApplicationTypeVersionResource"]] = None, **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.ApplicationTypeVersionResource] @@ -991,7 +997,7 @@ class ApplicationTypeVersionsCleanupPolicy(_serialization.Model): "max_unused_versions_to_keep": {"key": "maxUnusedVersionsToKeep", "type": "int"}, } - def __init__(self, *, max_unused_versions_to_keep: int, **kwargs): + def __init__(self, *, max_unused_versions_to_keep: int, **kwargs: Any) -> None: """ :keyword max_unused_versions_to_keep: Number of unused versions per application type to keep. Required. @@ -1051,8 +1057,8 @@ def __init__( application_health_policy: Optional["_models.ArmApplicationHealthPolicy"] = None, upgrade_mode: Union[str, "_models.RollingUpgradeMode"] = "Monitored", recreate_application: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword upgrade_replica_set_check_timeout: The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this @@ -1110,7 +1116,7 @@ class ApplicationUserAssignedIdentity(_serialization.Model): "principal_id": {"key": "principalId", "type": "str"}, } - def __init__(self, *, name: str, principal_id: str, **kwargs): + def __init__(self, *, name: str, principal_id: str, **kwargs: Any) -> None: """ :keyword name: The friendly name of user assigned identity. Required. :paramtype name: str @@ -1123,7 +1129,8 @@ def __init__(self, *, name: str, principal_id: str, **kwargs): class ArmApplicationHealthPolicy(_serialization.Model): - """Defines a health policy used to evaluate the health of an application or one of its children entities. + """Defines a health policy used to evaluate the health of an application or one of its children + entities. :ivar consider_warning_as_error: Indicates whether warnings are treated with the same severity as errors. @@ -1167,8 +1174,8 @@ def __init__( max_percent_unhealthy_deployed_applications: int = 0, default_service_type_health_policy: Optional["_models.ArmServiceTypeHealthPolicy"] = None, service_type_health_policy_map: Optional[Dict[str, "_models.ArmServiceTypeHealthPolicy"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword consider_warning_as_error: Indicates whether warnings are treated with the same severity as errors. @@ -1249,8 +1256,8 @@ def __init__( health_check_retry_timeout: str = "PT0H10M0S", upgrade_timeout: str = "P10675199DT02H48M05.4775807S", upgrade_domain_timeout: str = "P10675199DT02H48M05.4775807S", - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword failure_action: The activation Mode of the service package. Known values are: "Rollback" and "Manual". @@ -1291,7 +1298,8 @@ def __init__( class ArmServiceTypeHealthPolicy(_serialization.Model): - """Represents the health policy used to evaluate the health of services belonging to a service type. + """Represents the health policy used to evaluate the health of services belonging to a service + type. :ivar max_percent_unhealthy_services: The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -1328,8 +1336,8 @@ def __init__( max_percent_unhealthy_services: int = 0, max_percent_unhealthy_partitions_per_service: int = 0, max_percent_unhealthy_replicas_per_partition: int = 0, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword max_percent_unhealthy_services: The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -1374,8 +1382,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: The name of the provider. :paramtype provider: str @@ -1416,8 +1424,8 @@ def __init__( tenant_id: Optional[str] = None, cluster_application: Optional[str] = None, client_application: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tenant_id: Azure active directory tenant id. :paramtype tenant_id: str @@ -1463,8 +1471,8 @@ def __init__( thumbprint: str, thumbprint_secondary: Optional[str] = None, x509_store_name: Optional[Union[str, "_models.StoreName"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword thumbprint: Thumbprint of the primary certificate. Required. :paramtype thumbprint: str @@ -1507,7 +1515,9 @@ class ClientCertificateCommonName(_serialization.Model): "certificate_issuer_thumbprint": {"key": "certificateIssuerThumbprint", "type": "str"}, } - def __init__(self, *, is_admin: bool, certificate_common_name: str, certificate_issuer_thumbprint: str, **kwargs): + def __init__( + self, *, is_admin: bool, certificate_common_name: str, certificate_issuer_thumbprint: str, **kwargs: Any + ) -> None: """ :keyword is_admin: Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. Required. @@ -1546,7 +1556,7 @@ class ClientCertificateThumbprint(_serialization.Model): "certificate_thumbprint": {"key": "certificateThumbprint", "type": "str"}, } - def __init__(self, *, is_admin: bool, certificate_thumbprint: str, **kwargs): + def __init__(self, *, is_admin: bool, certificate_thumbprint: str, **kwargs: Any) -> None: """ :keyword is_admin: Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. Required. @@ -1601,7 +1611,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - 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 location: Azure resource location. Required. :paramtype location: str @@ -1665,8 +1675,9 @@ class Cluster(Resource): # pylint: disable=too-many-instance-attributes list[~azure.mgmt.servicefabric.models.ClientCertificateThumbprint] :ivar cluster_code_version: The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. + Service Fabric versions for new clusters use `ClusterVersion API + `_. To get the list + of available version for existing clusters use **availableClusterVersions**. :vartype cluster_code_version: str :ivar cluster_endpoint: The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. @@ -1878,8 +1889,8 @@ def __init__( # pylint: disable=too-many-locals upgrade_pause_end_timestamp_utc: Optional[datetime.datetime] = None, wave_upgrade_paused: Optional[bool] = None, notifications: Optional[List["_models.Notification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: Azure resource location. Required. :paramtype location: str @@ -1907,8 +1918,9 @@ def __init__( # pylint: disable=too-many-locals list[~azure.mgmt.servicefabric.models.ClientCertificateThumbprint] :keyword cluster_code_version: The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. + Service Fabric versions for new clusters use `ClusterVersion API + `_. To get the list + of available version for existing clusters use **availableClusterVersions**. :paramtype cluster_code_version: str :keyword diagnostics_storage_account_config: The storage account information for storing Service Fabric diagnostic logs. @@ -2036,8 +2048,8 @@ def __init__( *, value: Optional[List["_models.ClusterCodeVersionsResult"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.ClusterCodeVersionsResult] @@ -2085,8 +2097,8 @@ def __init__( code_version: Optional[str] = None, support_expiry_utc: Optional[str] = None, environment: Optional[Union[str, "_models.ClusterEnvironment"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The identification of the result. :paramtype id: str @@ -2166,8 +2178,8 @@ def __init__( max_percent_unhealthy_nodes: int = 0, max_percent_unhealthy_applications: int = 0, application_health_policies: Optional[Dict[str, "_models.ApplicationHealthPolicy"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword max_percent_unhealthy_nodes: The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. @@ -2223,7 +2235,9 @@ class ClusterListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Cluster"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Cluster"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.Cluster] @@ -2260,8 +2274,9 @@ class ClusterUpdateParameters(_serialization.Model): # pylint: disable=too-many list[~azure.mgmt.servicefabric.models.ClientCertificateThumbprint] :ivar cluster_code_version: The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. + Service Fabric versions for new clusters use `ClusterVersion API + `_. To get the list + of available version for existing clusters use **availableClusterVersions**. :vartype cluster_code_version: str :ivar event_store_service_enabled: Indicates if the event store service is enabled. :vartype event_store_service_enabled: bool @@ -2384,8 +2399,8 @@ def __init__( upgrade_pause_end_timestamp_utc: Optional[datetime.datetime] = None, wave_upgrade_paused: Optional[bool] = None, notifications: Optional[List["_models.Notification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Cluster update parameters. :paramtype tags: dict[str, str] @@ -2409,8 +2424,9 @@ def __init__( list[~azure.mgmt.servicefabric.models.ClientCertificateThumbprint] :keyword cluster_code_version: The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available - Service Fabric versions for new clusters use `ClusterVersion API <./ClusterVersion.md>`_. To - get the list of available version for existing clusters use **availableClusterVersions**. + Service Fabric versions for new clusters use `ClusterVersion API + `_. To get the list + of available version for existing clusters use **availableClusterVersions**. :paramtype cluster_code_version: str :keyword event_store_service_enabled: Indicates if the event store service is enabled. :paramtype event_store_service_enabled: bool @@ -2558,8 +2574,8 @@ def __init__( max_percent_upgrade_domain_delta_unhealthy_nodes: int, max_percent_delta_unhealthy_applications: int, application_delta_health_policies: Optional[Dict[str, "_models.ApplicationDeltaHealthPolicy"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword max_percent_delta_unhealthy_nodes: The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. @@ -2668,8 +2684,8 @@ def __init__( health_policy: "_models.ClusterHealthPolicy", force_restart: Optional[bool] = None, delta_health_policy: Optional["_models.ClusterUpgradeDeltaHealthPolicy"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword force_restart: If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). @@ -2741,8 +2757,8 @@ def __init__( code_version: Optional[str] = None, support_expiry_utc: Optional[str] = None, environment: Optional[Union[str, "_models.ClusterEnvironment"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword code_version: The Service Fabric runtime version of the cluster. :paramtype code_version: str @@ -2804,8 +2820,8 @@ def __init__( queue_endpoint: str, table_endpoint: str, protected_account_key_name2: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword storage_account_name: The Azure storage account name. Required. :paramtype storage_account_name: str @@ -2851,7 +2867,7 @@ class EndpointRangeDescription(_serialization.Model): "end_port": {"key": "endPort", "type": "int"}, } - def __init__(self, *, start_port: int, end_port: int, **kwargs): + def __init__(self, *, start_port: int, end_port: int, **kwargs: Any) -> None: """ :keyword start_port: Starting port of a range of ports. Required. :paramtype start_port: int @@ -2874,7 +2890,7 @@ class ErrorModel(_serialization.Model): "error": {"key": "error", "type": "ErrorModelError"}, } - def __init__(self, *, error: Optional["_models.ErrorModelError"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorModelError"] = None, **kwargs: Any) -> None: """ :keyword error: The error details. :paramtype error: ~azure.mgmt.servicefabric.models.ErrorModelError @@ -2897,7 +2913,7 @@ class ErrorModelError(_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: The error code. :paramtype code: str @@ -2947,8 +2963,8 @@ def __init__( *, type: Optional[Union[str, "_models.ManagedIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The type of managed identity for the resource. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". @@ -2996,10 +3012,10 @@ class PartitionSchemeDescription(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.partition_scheme = None # type: Optional[str] + self.partition_scheme: Optional[str] = None class NamedPartitionSchemeDescription(PartitionSchemeDescription): @@ -3029,7 +3045,7 @@ class NamedPartitionSchemeDescription(PartitionSchemeDescription): "names": {"key": "names", "type": "[str]"}, } - def __init__(self, *, count: int, names: List[str], **kwargs): + def __init__(self, *, count: int, names: List[str], **kwargs: Any) -> None: """ :keyword count: The number of partitions. Required. :paramtype count: int @@ -3038,13 +3054,14 @@ def __init__(self, *, count: int, names: List[str], **kwargs): :paramtype names: list[str] """ super().__init__(**kwargs) - self.partition_scheme = "Named" # type: str + self.partition_scheme: str = "Named" self.count = count self.names = names class NodeTypeDescription(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + """Describes a node type in the cluster, each node type represents sub set of nodes in the + cluster. All required parameters must be populated in order to send to Azure. @@ -3135,8 +3152,8 @@ def __init__( reverse_proxy_endpoint_port: Optional[int] = None, is_stateless: Optional[bool] = None, multiple_availability_zones: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the node type. Required. :paramtype name: str @@ -3237,8 +3254,8 @@ def __init__( notification_category: Union[str, "_models.NotificationCategory"], notification_level: Union[str, "_models.NotificationLevel"], notification_targets: List["_models.NotificationTarget"], - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword is_enabled: Indicates if the notification is enabled. Required. :paramtype is_enabled: bool @@ -3281,8 +3298,8 @@ class NotificationTarget(_serialization.Model): } def __init__( - self, *, notification_channel: Union[str, "_models.NotificationChannel"], receivers: List[str], **kwargs - ): + self, *, notification_channel: Union[str, "_models.NotificationChannel"], receivers: List[str], **kwargs: Any + ) -> None: """ :keyword notification_channel: The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. Required. Known values are: @@ -3316,7 +3333,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.OperationResult"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.OperationResult"]] = None, **kwargs: Any) -> None: """ :keyword value: List of operations supported by the Service Fabric resource provider. :paramtype value: list[~azure.mgmt.servicefabric.models.OperationResult] @@ -3357,8 +3374,8 @@ def __init__( display: Optional["_models.AvailableOperationDisplay"] = None, origin: Optional[str] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the operation. :paramtype name: str @@ -3400,7 +3417,7 @@ class ServerCertificateCommonName(_serialization.Model): "certificate_issuer_thumbprint": {"key": "certificateIssuerThumbprint", "type": "str"}, } - def __init__(self, *, certificate_common_name: str, certificate_issuer_thumbprint: str, **kwargs): + def __init__(self, *, certificate_common_name: str, certificate_issuer_thumbprint: str, **kwargs: Any) -> None: """ :keyword certificate_common_name: The common name of the server certificate. Required. :paramtype certificate_common_name: str @@ -3414,7 +3431,8 @@ def __init__(self, *, certificate_common_name: str, certificate_issuer_thumbprin class ServerCertificateCommonNames(_serialization.Model): - """Describes a list of server certificates referenced by common name that are used to secure the cluster. + """Describes a list of server certificates referenced by common name that are used to secure the + cluster. :ivar common_names: The list of server certificates referenced by common name that are used to secure the cluster. @@ -3435,8 +3453,8 @@ def __init__( *, common_names: Optional[List["_models.ServerCertificateCommonName"]] = None, x509_store_name: Optional[Union[str, "_models.StoreName"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword common_names: The list of server certificates referenced by common name that are used to secure the cluster. @@ -3475,7 +3493,9 @@ class ServiceCorrelationDescription(_serialization.Model): "service_name": {"key": "serviceName", "type": "str"}, } - def __init__(self, *, scheme: Union[str, "_models.ServiceCorrelationScheme"], service_name: str, **kwargs): + def __init__( + self, *, scheme: Union[str, "_models.ServiceCorrelationScheme"], service_name: str, **kwargs: Any + ) -> None: """ :keyword scheme: The ServiceCorrelationScheme which describes the relationship between this service and the service specified via ServiceName. Required. Known values are: "Invalid", @@ -3533,8 +3553,8 @@ def __init__( primary_default_load: Optional[int] = None, secondary_default_load: Optional[int] = None, default_load: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric @@ -3580,10 +3600,10 @@ class ServicePlacementPolicyDescription(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.type = None # type: Optional[str] + self.type: Optional[str] = None class ServiceResource(ProxyResource): # pylint: disable=too-many-instance-attributes @@ -3692,8 +3712,8 @@ def __init__( partition_description: Optional["_models.PartitionSchemeDescription"] = None, service_package_activation_mode: Optional[Union[str, "_models.ArmServicePackageActivationMode"]] = None, service_dns_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -3739,7 +3759,7 @@ def __init__( self.service_placement_policies = service_placement_policies self.default_move_cost = default_move_cost self.provisioning_state = None - self.service_kind = None # type: Optional[str] + self.service_kind: Optional[str] = None self.service_type_name = service_type_name self.partition_description = partition_description self.service_package_activation_mode = service_package_activation_mode @@ -3766,7 +3786,7 @@ class ServiceResourceList(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ServiceResource"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.ServiceResource"]] = None, **kwargs: Any) -> None: """ :keyword value: :paramtype value: list[~azure.mgmt.servicefabric.models.ServiceResource] @@ -3820,8 +3840,8 @@ def __init__( service_load_metrics: Optional[List["_models.ServiceLoadMetricDescription"]] = None, service_placement_policies: Optional[List["_models.ServicePlacementPolicyDescription"]] = None, default_move_cost: Optional[Union[str, "_models.MoveCost"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -3939,8 +3959,8 @@ def __init__( partition_description: Optional["_models.PartitionSchemeDescription"] = None, service_package_activation_mode: Optional[Union[str, "_models.ArmServicePackageActivationMode"]] = None, service_dns_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -3983,7 +4003,7 @@ def __init__( **kwargs ) self.provisioning_state = None - self.service_kind = None # type: Optional[str] + self.service_kind: Optional[str] = None self.service_type_name = service_type_name self.partition_description = partition_description self.service_package_activation_mode = service_package_activation_mode @@ -4072,8 +4092,8 @@ def __init__( service_load_metrics: Optional[List["_models.ServiceLoadMetricDescription"]] = None, service_placement_policies: Optional[List["_models.ServicePlacementPolicyDescription"]] = None, default_move_cost: Optional[Union[str, "_models.MoveCost"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword location: It will be deprecated in New API, resource location depends on the parent resource. @@ -4107,7 +4127,7 @@ def __init__( self.service_load_metrics = service_load_metrics self.service_placement_policies = service_placement_policies self.default_move_cost = default_move_cost - self.service_kind = None # type: Optional[str] + self.service_kind: Optional[str] = None class ServiceResourceUpdateProperties(ServiceResourcePropertiesBase): @@ -4171,8 +4191,8 @@ def __init__( service_load_metrics: Optional[List["_models.ServiceLoadMetricDescription"]] = None, service_placement_policies: Optional[List["_models.ServicePlacementPolicyDescription"]] = None, default_move_cost: Optional[Union[str, "_models.MoveCost"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -4203,11 +4223,12 @@ def __init__( default_move_cost=default_move_cost, **kwargs ) - self.service_kind = None # type: Optional[str] + self.service_kind: Optional[str] = None class ServiceTypeDeltaHealthPolicy(_serialization.Model): - """Represents the delta health policy used to evaluate the health of services belonging to a service type when upgrading the cluster. + """Represents the delta health policy used to evaluate the health of services belonging to a + service type when upgrading the cluster. :ivar max_percent_delta_unhealthy_services: The maximum allowed percentage of services health degradation allowed during cluster upgrades. @@ -4226,7 +4247,7 @@ class ServiceTypeDeltaHealthPolicy(_serialization.Model): "max_percent_delta_unhealthy_services": {"key": "maxPercentDeltaUnhealthyServices", "type": "int"}, } - def __init__(self, *, max_percent_delta_unhealthy_services: int = 0, **kwargs): + def __init__(self, *, max_percent_delta_unhealthy_services: int = 0, **kwargs: Any) -> None: """ :keyword max_percent_delta_unhealthy_services: The maximum allowed percentage of services health degradation allowed during cluster upgrades. @@ -4241,7 +4262,8 @@ def __init__(self, *, max_percent_delta_unhealthy_services: int = 0, **kwargs): class ServiceTypeHealthPolicy(_serialization.Model): - """Represents the health policy used to evaluate the health of services belonging to a service type. + """Represents the health policy used to evaluate the health of services belonging to a service + type. :ivar max_percent_unhealthy_services: The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -4256,7 +4278,7 @@ class ServiceTypeHealthPolicy(_serialization.Model): "max_percent_unhealthy_services": {"key": "maxPercentUnhealthyServices", "type": "int"}, } - def __init__(self, *, max_percent_unhealthy_services: int = 0, **kwargs): + def __init__(self, *, max_percent_unhealthy_services: int = 0, **kwargs: Any) -> None: """ :keyword max_percent_unhealthy_services: The maximum percentage of services allowed to be unhealthy before your application is considered in error. @@ -4287,7 +4309,7 @@ class SettingsParameterDescription(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: str, value: str, **kwargs): + def __init__(self, *, name: str, value: str, **kwargs: Any) -> None: """ :keyword name: The parameter name of fabric setting. Required. :paramtype name: str @@ -4320,7 +4342,7 @@ class SettingsSectionDescription(_serialization.Model): "parameters": {"key": "parameters", "type": "[SettingsParameterDescription]"}, } - def __init__(self, *, name: str, parameters: List["_models.SettingsParameterDescription"], **kwargs): + def __init__(self, *, name: str, parameters: List["_models.SettingsParameterDescription"], **kwargs: Any) -> None: """ :keyword name: The section name of the fabric settings. Required. :paramtype name: str @@ -4350,10 +4372,10 @@ class SingletonPartitionSchemeDescription(PartitionSchemeDescription): "partition_scheme": {"key": "partitionScheme", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.partition_scheme = "Singleton" # type: str + self.partition_scheme: str = "Singleton" class StatefulServiceProperties(ServiceResourceProperties): # pylint: disable=too-many-instance-attributes @@ -4466,8 +4488,8 @@ def __init__( replica_restart_wait_duration: Optional[datetime.datetime] = None, quorum_loss_wait_duration: Optional[datetime.datetime] = None, stand_by_replica_keep_duration: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -4530,7 +4552,7 @@ def __init__( service_dns_name=service_dns_name, **kwargs ) - self.service_kind = "Stateful" # type: str + self.service_kind: str = "Stateful" self.has_persisted_state = has_persisted_state self.target_replica_set_size = target_replica_set_size self.min_replica_set_size = min_replica_set_size @@ -4618,8 +4640,8 @@ def __init__( replica_restart_wait_duration: Optional[datetime.datetime] = None, quorum_loss_wait_duration: Optional[datetime.datetime] = None, stand_by_replica_keep_duration: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -4663,7 +4685,7 @@ def __init__( default_move_cost=default_move_cost, **kwargs ) - self.service_kind = "Stateful" # type: str + self.service_kind: str = "Stateful" self.target_replica_set_size = target_replica_set_size self.min_replica_set_size = min_replica_set_size self.replica_restart_wait_duration = replica_restart_wait_duration @@ -4765,8 +4787,8 @@ def __init__( service_dns_name: Optional[str] = None, instance_count: Optional[int] = None, instance_close_delay_duration: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -4821,7 +4843,7 @@ def __init__( service_dns_name=service_dns_name, **kwargs ) - self.service_kind = "Stateless" # type: str + self.service_kind: str = "Stateless" self.instance_count = instance_count self.instance_close_delay_duration = instance_close_delay_duration @@ -4895,8 +4917,8 @@ def __init__( default_move_cost: Optional[Union[str, "_models.MoveCost"]] = None, instance_count: Optional[int] = None, instance_close_delay_duration: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword placement_constraints: The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular @@ -4937,7 +4959,7 @@ def __init__( default_move_cost=default_move_cost, **kwargs ) - self.service_kind = "Stateless" # type: str + self.service_kind: str = "Stateless" self.instance_count = instance_count self.instance_close_delay_duration = instance_close_delay_duration @@ -4977,8 +4999,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[str] = 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 @@ -5003,7 +5025,8 @@ def __init__( class UniformInt64RangePartitionSchemeDescription(PartitionSchemeDescription): - """Describes a partitioning scheme where an integer range is allocated evenly across a number of partitions. + """Describes a partitioning scheme where an integer range is allocated evenly across a number of + partitions. All required parameters must be populated in order to send to Azure. @@ -5034,7 +5057,7 @@ class UniformInt64RangePartitionSchemeDescription(PartitionSchemeDescription): "high_key": {"key": "highKey", "type": "str"}, } - def __init__(self, *, count: int, low_key: str, high_key: str, **kwargs): + def __init__(self, *, count: int, low_key: str, high_key: str, **kwargs: Any) -> None: """ :keyword count: The number of partitions. Required. :paramtype count: int @@ -5046,14 +5069,15 @@ def __init__(self, *, count: int, low_key: str, high_key: str, **kwargs): :paramtype high_key: str """ super().__init__(**kwargs) - self.partition_scheme = "UniformInt64Range" # type: str + self.partition_scheme: str = "UniformInt64Range" self.count = count self.low_key = low_key self.high_key = high_key class UpgradableVersionPathResult(_serialization.Model): - """The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version if no target was given. + """The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and + maximum upgradable version if no target was given. :ivar supported_path: :vartype supported_path: list[str] @@ -5063,7 +5087,7 @@ class UpgradableVersionPathResult(_serialization.Model): "supported_path": {"key": "supportedPath", "type": "[str]"}, } - def __init__(self, *, supported_path: Optional[List[str]] = None, **kwargs): + def __init__(self, *, supported_path: Optional[List[str]] = None, **kwargs: Any) -> None: """ :keyword supported_path: :paramtype supported_path: list[str] @@ -5089,7 +5113,7 @@ class UpgradableVersionsDescription(_serialization.Model): "target_version": {"key": "targetVersion", "type": "str"}, } - def __init__(self, *, target_version: str, **kwargs): + def __init__(self, *, target_version: str, **kwargs: Any) -> None: """ :keyword target_version: The target code version. Required. :paramtype target_version: str @@ -5119,7 +5143,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 diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py index fee26c394fbc..97166902f3d2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/_service_fabric_management_client_enums.py @@ -22,21 +22,21 @@ class AddOnFeatures(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ArmServicePackageActivationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The activation Mode of the service package.""" - #: Indicates the application package activation mode will use shared process. SHARED_PROCESS = "SharedProcess" - #: Indicates the application package activation mode will use exclusive process. + """Indicates the application package activation mode will use shared process.""" EXCLUSIVE_PROCESS = "ExclusiveProcess" + """Indicates the application package activation mode will use exclusive process.""" class ArmUpgradeFailureAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The activation Mode of the service package.""" - #: Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade - #: fails. ROLLBACK = "Rollback" - #: Indicates that a manual repair will need to be performed by the administrator if the upgrade - #: fails. Service Fabric will not proceed to the next upgrade domain automatically. + """Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade + #: fails.""" MANUAL = "Manual" + """Indicates that a manual repair will need to be performed by the administrator if the upgrade + #: fails. Service Fabric will not proceed to the next upgrade domain automatically.""" class ClusterEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -88,15 +88,15 @@ class ClusterUpgradeCadence(str, Enum, metaclass=CaseInsensitiveEnumMeta): default is Wave0. """ - #: Cluster upgrade starts immediately after a new version is rolled out. Recommended for Test/Dev - #: clusters. WAVE0 = "Wave0" - #: Cluster upgrade starts 7 days after a new version is rolled out. Recommended for Pre-prod - #: clusters. + """Cluster upgrade starts immediately after a new version is rolled out. Recommended for Test/Dev + #: clusters.""" WAVE1 = "Wave1" - #: Cluster upgrade starts 14 days after a new version is rolled out. Recommended for Production - #: clusters. + """Cluster upgrade starts 7 days after a new version is rolled out. Recommended for Pre-prod + #: clusters.""" WAVE2 = "Wave2" + """Cluster upgrade starts 14 days after a new version is rolled out. Recommended for Production + #: clusters.""" class ClusterVersionsEnvironment(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -125,35 +125,35 @@ class DurabilityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ManagedIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of managed identity for the resource.""" - #: Indicates that system assigned identity is associated with the resource. SYSTEM_ASSIGNED = "SystemAssigned" - #: Indicates that user assigned identity is associated with the resource. + """Indicates that system assigned identity is associated with the resource.""" USER_ASSIGNED = "UserAssigned" - #: Indicates that both system assigned and user assigned identity are associated with the - #: resource. + """Indicates that user assigned identity is associated with the resource.""" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" - #: Indicates that no identity is associated with the resource. + """Indicates that both system assigned and user assigned identity are associated with the + #: resource.""" NONE = "None" + """Indicates that no identity is associated with the resource.""" class MoveCost(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the move cost for the service.""" - #: Zero move cost. This value is zero. ZERO = "Zero" - #: Specifies the move cost of the service as Low. The value is 1. + """Zero move cost. This value is zero.""" LOW = "Low" - #: Specifies the move cost of the service as Medium. The value is 2. + """Specifies the move cost of the service as Low. The value is 1.""" MEDIUM = "Medium" - #: Specifies the move cost of the service as High. The value is 3. + """Specifies the move cost of the service as Medium. The value is 2.""" HIGH = "High" + """Specifies the move cost of the service as High. The value is 3.""" class NotificationCategory(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The category of notification.""" - #: Notification will be regarding wave progress. WAVE_PROGRESS = "WaveProgress" + """Notification will be regarding wave progress.""" class NotificationChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -161,39 +161,39 @@ class NotificationChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): user or subscription. """ - #: For email user receivers. In this case, the parameter receivers should be a list of email - #: addresses that will receive the notifications. EMAIL_USER = "EmailUser" - #: For subscription receivers. In this case, the parameter receivers should be a list of roles of - #: the subscription for the cluster (eg. Owner, AccountAdmin, etc) that will receive the - #: notifications. + """For email user receivers. In this case, the parameter receivers should be a list of email + #: addresses that will receive the notifications.""" EMAIL_SUBSCRIPTION = "EmailSubscription" + """For subscription receivers. In this case, the parameter receivers should be a list of roles of + #: the subscription for the cluster (eg. Owner, AccountAdmin, etc) that will receive the + #: notifications.""" class NotificationLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The level of notification.""" - #: Receive only critical notifications. CRITICAL = "Critical" - #: Receive all notifications. + """Receive only critical notifications.""" ALL = "All" + """Receive all notifications.""" class PartitionScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enumerates the ways that a service can be partitioned.""" - #: Indicates the partition kind is invalid. All Service Fabric enumerations have the invalid type. - #: The value is zero. INVALID = "Invalid" - #: Indicates that the partition is based on string names, and is a - #: SingletonPartitionSchemeDescription object, The value is 1. + """Indicates the partition kind is invalid. All Service Fabric enumerations have the invalid type. + #: The value is zero.""" SINGLETON = "Singleton" - #: Indicates that the partition is based on Int64 key ranges, and is a - #: UniformInt64RangePartitionSchemeDescription object. The value is 2. + """Indicates that the partition is based on string names, and is a + #: SingletonPartitionSchemeDescription object, The value is 1.""" UNIFORM_INT64_RANGE = "UniformInt64Range" - #: Indicates that the partition is based on string names, and is a NamedPartitionSchemeDescription - #: object. The value is 3 + """Indicates that the partition is based on Int64 key ranges, and is a + #: UniformInt64RangePartitionSchemeDescription object. The value is 2.""" NAMED = "Named" + """Indicates that the partition is based on string names, and is a NamedPartitionSchemeDescription + #: object. The value is 3""" class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -232,49 +232,49 @@ class RollingUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): UnmonitoredManual, and Monitored. """ - #: Indicates the upgrade mode is invalid. All Service Fabric enumerations have the invalid type. - #: The value is zero. INVALID = "Invalid" - #: The upgrade will proceed automatically without performing any health monitoring. The value is 1 + """Indicates the upgrade mode is invalid. All Service Fabric enumerations have the invalid type. + #: The value is zero.""" UNMONITORED_AUTO = "UnmonitoredAuto" - #: The upgrade will stop after completing each upgrade domain, giving the opportunity to manually - #: monitor health before proceeding. The value is 2 + """The upgrade will proceed automatically without performing any health monitoring. The value is 1""" UNMONITORED_MANUAL = "UnmonitoredManual" - #: The upgrade will stop after completing each upgrade domain and automatically monitor health - #: before proceeding. The value is 3 + """The upgrade will stop after completing each upgrade domain, giving the opportunity to manually + #: monitor health before proceeding. The value is 2""" MONITORED = "Monitored" + """The upgrade will stop after completing each upgrade domain and automatically monitor health + #: before proceeding. The value is 3""" class ServiceCorrelationScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The service correlation scheme.""" - #: An invalid correlation scheme. Cannot be used. The value is zero. INVALID = "Invalid" - #: Indicates that this service has an affinity relationship with another service. Provided for - #: backwards compatibility, consider preferring the Aligned or NonAlignedAffinity options. The - #: value is 1. + """An invalid correlation scheme. Cannot be used. The value is zero.""" AFFINITY = "Affinity" - #: Aligned affinity ensures that the primaries of the partitions of the affinitized services are - #: collocated on the same nodes. This is the default and is the same as selecting the Affinity - #: scheme. The value is 2. + """Indicates that this service has an affinity relationship with another service. Provided for + #: backwards compatibility, consider preferring the Aligned or NonAlignedAffinity options. The + #: value is 1.""" ALIGNED_AFFINITY = "AlignedAffinity" - #: Non-Aligned affinity guarantees that all replicas of each service will be placed on the same - #: nodes. Unlike Aligned Affinity, this does not guarantee that replicas of particular role will - #: be collocated. The value is 3. + """Aligned affinity ensures that the primaries of the partitions of the affinitized services are + #: collocated on the same nodes. This is the default and is the same as selecting the Affinity + #: scheme. The value is 2.""" NON_ALIGNED_AFFINITY = "NonAlignedAffinity" + """Non-Aligned affinity guarantees that all replicas of each service will be placed on the same + #: nodes. Unlike Aligned Affinity, this does not guarantee that replicas of particular role will + #: be collocated. The value is 3.""" class ServiceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The kind of service (Stateless or Stateful).""" - #: Indicates the service kind is invalid. All Service Fabric enumerations have the invalid type. - #: The value is zero. INVALID = "Invalid" - #: Does not use Service Fabric to make its state highly available or reliable. The value is 1. + """Indicates the service kind is invalid. All Service Fabric enumerations have the invalid type. + #: The value is zero.""" STATELESS = "Stateless" - #: Uses Service Fabric to make its state or part of its state highly available and reliable. The - #: value is 2. + """Does not use Service Fabric to make its state highly available or reliable. The value is 1.""" STATEFUL = "Stateful" + """Uses Service Fabric to make its state or part of its state highly available and reliable. The + #: value is 2.""" class ServiceLoadMetricWeight(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -283,44 +283,44 @@ class ServiceLoadMetricWeight(str, Enum, metaclass=CaseInsensitiveEnumMeta): prefers the metric with the higher weight. """ - #: Disables resource balancing for this metric. This value is zero. ZERO = "Zero" - #: Specifies the metric weight of the service load as Low. The value is 1. + """Disables resource balancing for this metric. This value is zero.""" LOW = "Low" - #: Specifies the metric weight of the service load as Medium. The value is 2. + """Specifies the metric weight of the service load as Low. The value is 1.""" MEDIUM = "Medium" - #: Specifies the metric weight of the service load as High. The value is 3. + """Specifies the metric weight of the service load as Medium. The value is 2.""" HIGH = "High" + """Specifies the metric weight of the service load as High. The value is 3.""" class ServicePlacementPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of placement policy for a service fabric service. Following are the possible values.""" - #: Indicates the type of the placement policy is invalid. All Service Fabric enumerations have the - #: invalid type. The value is zero. INVALID = "Invalid" - #: Indicates that the ServicePlacementPolicyDescription is of type - #: ServicePlacementInvalidDomainPolicyDescription, which indicates that a particular fault or - #: upgrade domain cannot be used for placement of this service. The value is 1. + """Indicates the type of the placement policy is invalid. All Service Fabric enumerations have the + #: invalid type. The value is zero.""" INVALID_DOMAIN = "InvalidDomain" - #: Indicates that the ServicePlacementPolicyDescription is of type - #: ServicePlacementRequireDomainDistributionPolicyDescription indicating that the replicas of the - #: service must be placed in a specific domain. The value is 2. + """Indicates that the ServicePlacementPolicyDescription is of type + #: ServicePlacementInvalidDomainPolicyDescription, which indicates that a particular fault or + #: upgrade domain cannot be used for placement of this service. The value is 1.""" REQUIRED_DOMAIN = "RequiredDomain" - #: Indicates that the ServicePlacementPolicyDescription is of type + """Indicates that the ServicePlacementPolicyDescription is of type + #: ServicePlacementRequireDomainDistributionPolicyDescription indicating that the replicas of the + #: service must be placed in a specific domain. The value is 2.""" + PREFERRED_PRIMARY_DOMAIN = "PreferredPrimaryDomain" + """Indicates that the ServicePlacementPolicyDescription is of type #: ServicePlacementPreferPrimaryDomainPolicyDescription, which indicates that if possible the #: Primary replica for the partitions of the service should be located in a particular domain as - #: an optimization. The value is 3. - PREFERRED_PRIMARY_DOMAIN = "PreferredPrimaryDomain" - #: Indicates that the ServicePlacementPolicyDescription is of type + #: an optimization. The value is 3.""" + REQUIRED_DOMAIN_DISTRIBUTION = "RequiredDomainDistribution" + """Indicates that the ServicePlacementPolicyDescription is of type #: ServicePlacementRequireDomainDistributionPolicyDescription, indicating that the system will #: disallow placement of any two replicas from the same partition in the same domain at any time. - #: The value is 4. - REQUIRED_DOMAIN_DISTRIBUTION = "RequiredDomainDistribution" - #: Indicates that the ServicePlacementPolicyDescription is of type - #: ServicePlacementNonPartiallyPlaceServicePolicyDescription, which indicates that if possible all - #: replicas of a particular partition of the service should be placed atomically. The value is 5. + #: The value is 4.""" NON_PARTIALLY_PLACE_SERVICE = "NonPartiallyPlaceService" + """Indicates that the ServicePlacementPolicyDescription is of type + #: ServicePlacementNonPartiallyPlaceServicePolicyDescription, which indicates that if possible all + #: replicas of a particular partition of the service should be placed atomically. The value is 5.""" class SfZonalUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -329,16 +329,16 @@ class SfZonalUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): cluster. """ - #: VMs under the node type are grouped into UDs and ignore the zone info in five UDs. This setting + PARALLEL = "Parallel" + """VMs under the node type are grouped into UDs and ignore the zone info in five UDs. This setting #: causes UDs across all zones to be upgraded at the same time. This deployment mode is faster for #: upgrades, we don't recommend it because it goes against the SDP guidelines, which state that - #: the updates should be applied to one zone at a time. - PARALLEL = "Parallel" - #: If this value is omitted or set to Hierarchical, VMs are grouped to reflect the zonal + #: the updates should be applied to one zone at a time.""" + HIERARCHICAL = "Hierarchical" + """If this value is omitted or set to Hierarchical, VMs are grouped to reflect the zonal #: distribution in up to 15 UDs. Each of the three zones has five UDs. This ensures that the zones #: are updated one at a time, moving to next zone only after completing five UDs within the first - #: zone. This update process is safer for the cluster and the user application. - HIERARCHICAL = "Hierarchical" + #: zone. This update process is safer for the cluster and the user application.""" class StoreName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -357,12 +357,12 @@ class StoreName(str, Enum, metaclass=CaseInsensitiveEnumMeta): class UpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The upgrade mode of the cluster when new Service Fabric runtime version is available.""" - #: The cluster will be automatically upgraded to the latest Service Fabric runtime version, - #: **upgradeWave** will determine when the upgrade starts after the new version becomes available. AUTOMATIC = "Automatic" - #: The cluster will not be automatically upgraded to the latest Service Fabric runtime version. - #: The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + """The cluster will be automatically upgraded to the latest Service Fabric runtime version, + #: **upgradeWave** will determine when the upgrade starts after the new version becomes available.""" MANUAL = "Manual" + """The cluster will not be automatically upgraded to the latest Service Fabric runtime version. + #: The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource.""" class VmssZonalUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -370,9 +370,9 @@ class VmssZonalUpgradeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): node type with multiple Availability Zones is added. """ - #: Updates will happen in all Availability Zones at once for the virtual machine scale sets. PARALLEL = "Parallel" - #: VMs are grouped to reflect the zonal distribution in up to 15 UDs. Each of the three zones has - #: five UDs. This ensures that the zones are updated one at a time, moving to next zone only after - #: completing five UDs within the first zone. + """Updates will happen in all Availability Zones at once for the virtual machine scale sets.""" HIERARCHICAL = "Hierarchical" + """VMs are grouped to reflect the zonal distribution in up to 15 UDs. Each of the three zones has + #: five UDs. This ensures that the zones are updated one at a time, moving to next zone only after + #: completing five UDs within the first zone.""" diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py index 69103382d011..aa1919dd5f64 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/__init__.py @@ -15,7 +15,7 @@ from ._services_operations import ServicesOperations 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/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py index f078031660a2..a986e431ccbf 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_type_versions_operations.py @@ -52,7 +52,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "version": _SERIALIZER.url("version", version, "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,8 +90,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_create_or_update_request( "version": _SERIALIZER.url("version", version, "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") @@ -131,7 +131,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -147,7 +147,7 @@ def build_delete_request( "version": _SERIALIZER.url("version", version, "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") @@ -164,7 +164,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_list_request( "applicationTypeName": _SERIALIZER.url("application_type_name", application_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") @@ -242,10 +242,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] + ) + cls: ClsType[_models.ApplicationTypeVersionResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -259,9 +259,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } def _create_or_update_initial( self, @@ -301,11 +303,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeVersionResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -330,9 +332,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -350,7 +352,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @overload def begin_create_or_update( @@ -462,8 +466,8 @@ def begin_create_or_update( :type application_type_name: str :param version: The application type version. Required. :type version: str - :param parameters: The application type version resource. Is either a model type or a IO type. - Required. + :param parameters: The application type version resource. Is either a + ApplicationTypeVersionResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationTypeVersionResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -485,16 +489,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeVersionResource] = 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, cluster_name=cluster_name, application_type_name=application_type_name, @@ -516,7 +520,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -528,9 +532,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_type_name: str, version: str, **kwargs: Any @@ -546,10 +552,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -563,9 +569,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -579,7 +585,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @distributed_trace def begin_delete( @@ -612,13 +620,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -638,7 +646,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -650,9 +658,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}" + } @distributed_trace def list( @@ -686,10 +696,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeVersionResourceList] + ) + cls: ClsType[_models.ApplicationTypeVersionResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -702,9 +712,9 @@ def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -722,4 +732,6 @@ def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py index 840c79d17a2c..11189a434f7d 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_application_types_operations.py @@ -47,7 +47,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_get_request( "applicationTypeName": _SERIALIZER.url("application_type_name", application_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") @@ -79,8 +79,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +95,7 @@ def build_create_or_update_request( "applicationTypeName": _SERIALIZER.url("application_type_name", application_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") @@ -114,7 +114,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_delete_request( "applicationTypeName": _SERIALIZER.url("application_type_name", application_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") @@ -144,7 +144,7 @@ def build_list_request(resource_group_name: str, cluster_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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription "clusterName": _SERIALIZER.url("cluster_name", cluster_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") @@ -219,10 +219,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResource] + ) + cls: ClsType[_models.ApplicationTypeResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -235,9 +235,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -255,7 +255,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @overload def create_or_update( @@ -340,8 +342,8 @@ def create_or_update( :type cluster_name: str :param application_type_name: The name of the application type name resource. Required. :type application_type_name: str - :param parameters: The application type name resource. Is either a model type or a IO type. - Required. + :param parameters: The application type name resource. Is either a ApplicationTypeResource type + or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationTypeResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -362,11 +364,11 @@ 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: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationTypeResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -390,9 +392,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -410,7 +412,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_type_name: str, **kwargs: Any @@ -426,10 +430,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -442,9 +446,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -458,7 +462,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @distributed_trace def begin_delete( @@ -489,13 +495,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -514,7 +520,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -526,9 +532,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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}" + } @distributed_trace def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ApplicationTypeResourceList: @@ -558,10 +566,10 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationTypeResourceList] + ) + cls: ClsType[_models.ApplicationTypeResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -573,9 +581,9 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -593,4 +601,6 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py index 767d41969de5..ae682f6b4525 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_applications_operations.py @@ -47,7 +47,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_get_request( "applicationName": _SERIALIZER.url("application_name", application_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") @@ -79,8 +79,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +95,7 @@ def build_create_or_update_request( "applicationName": _SERIALIZER.url("application_name", application_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") @@ -114,8 +114,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_update_request( "applicationName": _SERIALIZER.url("application_name", application_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") @@ -149,7 +149,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_delete_request( "applicationName": _SERIALIZER.url("application_name", application_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") @@ -179,7 +179,7 @@ def build_list_request(resource_group_name: str, cluster_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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +193,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription "clusterName": _SERIALIZER.url("cluster_name", cluster_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") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -270,9 +270,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } def _create_or_update_initial( self, @@ -311,11 +313,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -339,9 +341,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -359,7 +361,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @overload def begin_create_or_update( @@ -460,7 +464,8 @@ def begin_create_or_update( :type cluster_name: str :param application_name: The name of the application resource. Required. :type application_name: str - :param parameters: The application resource. Is either a model type or a IO type. Required. + :param parameters: The application resource. Is either a ApplicationResource type or a IO type. + Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -481,16 +486,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -511,7 +516,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -523,9 +528,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } def _update_initial( self, @@ -546,11 +553,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -574,9 +581,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -594,7 +601,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @overload def begin_update( @@ -695,8 +704,8 @@ def begin_update( :type cluster_name: str :param application_name: The name of the application resource. Required. :type application_name: str - :param parameters: The application resource for patch operations. Is either a model type or a - IO type. Required. + :param parameters: The application resource for patch operations. Is either a + ApplicationResourceUpdate type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ApplicationResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -717,16 +726,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ApplicationResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -747,7 +756,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -759,9 +768,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_name: str, **kwargs: Any @@ -777,10 +788,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -793,9 +804,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -809,7 +820,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @distributed_trace def begin_delete( @@ -840,13 +853,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -865,7 +878,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -877,9 +890,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}" + } @distributed_trace def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.ApplicationResourceList: @@ -909,10 +924,10 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationResourceList] + ) + cls: ClsType[_models.ApplicationResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -924,9 +939,9 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -944,4 +959,6 @@ def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _m return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py index 14929a115dc8..0b3cc1752131 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_cluster_versions_operations.py @@ -43,7 +43,7 @@ def build_get_request(location: str, cluster_version: 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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_get_request(location: str, cluster_version: str, subscription_id: str, "clusterVersion": _SERIALIZER.url("cluster_version", cluster_version, "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") @@ -78,7 +78,7 @@ def build_get_by_environment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +93,7 @@ def build_get_by_environment_request( "clusterVersion": _SERIALIZER.url("cluster_version", cluster_version, "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") @@ -108,7 +108,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_list_by_environment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +152,7 @@ def build_list_by_environment_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -210,10 +210,10 @@ def get(self, location: str, cluster_version: str, **kwargs: Any) -> _models.Clu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_get_request( location=location, @@ -225,9 +225,9 @@ def get(self, location: str, cluster_version: str, **kwargs: Any) -> _models.Clu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -245,7 +245,9 @@ def get(self, location: str, cluster_version: str, **kwargs: Any) -> _models.Clu return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}" + } @distributed_trace def get_by_environment( @@ -284,10 +286,10 @@ def get_by_environment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_get_by_environment_request( location=location, @@ -300,9 +302,9 @@ def get_by_environment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -320,7 +322,9 @@ def get_by_environment( return deserialized - get_by_environment.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}"} # type: ignore + get_by_environment.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}" + } @distributed_trace def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersionsListResult: @@ -347,10 +351,10 @@ def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersionsListR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_list_request( location=location, @@ -361,9 +365,9 @@ def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersionsListR params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -381,7 +385,9 @@ def list(self, location: str, **kwargs: Any) -> _models.ClusterCodeVersionsListR return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions" + } @distributed_trace def list_by_environment( @@ -413,10 +419,10 @@ def list_by_environment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterCodeVersionsListResult] + ) + cls: ClsType[_models.ClusterCodeVersionsListResult] = kwargs.pop("cls", None) request = build_list_by_environment_request( location=location, @@ -428,9 +434,9 @@ def list_by_environment( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -448,4 +454,6 @@ def list_by_environment( return deserialized - list_by_environment.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions"} # type: ignore + list_by_environment.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py index 4ec747c4e9d6..3611a842825c 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_clusters_operations.py @@ -45,7 +45,7 @@ def build_get_request(resource_group_name: str, cluster_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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -76,8 +76,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,8 +110,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +125,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,7 +144,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,7 +173,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +186,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -201,7 +201,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,7 +210,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,8 +227,8 @@ def build_list_upgradable_versions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +242,7 @@ def build_list_upgradable_versions_request( "clusterName": _SERIALIZER.url("cluster_name", cluster_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") @@ -301,10 +301,10 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -316,9 +316,9 @@ def get(self, resource_group_name: str, cluster_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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -336,7 +336,9 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, parameters: Union[_models.Cluster, IO], **kwargs: Any @@ -352,11 +354,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -379,9 +381,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -399,11 +401,13 @@ def _create_or_update_initial( deserialized = self._deserialize("Cluster", 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.ServiceFabric/clusters/{clusterName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @overload def begin_create_or_update( @@ -489,7 +493,7 @@ def begin_create_or_update( :type resource_group_name: str :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str - :param parameters: The cluster resource. Is either a model type or a IO type. Required. + :param parameters: The cluster resource. Is either a Cluster type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.Cluster or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -509,16 +513,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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, cluster_name=cluster_name, parameters=parameters, @@ -538,7 +542,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -550,9 +554,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.ServiceFabric/clusters/{clusterName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } def _update_initial( self, @@ -572,11 +578,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -599,9 +605,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -619,11 +625,13 @@ def _update_initial( deserialized = self._deserialize("Cluster", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @overload def begin_update( @@ -716,7 +724,8 @@ def begin_update( :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str :param parameters: The parameters which contains the property value and property name which - used to update the cluster configuration. Is either a model type or a IO type. Required. + used to update the cluster configuration. Is either a ClusterUpdateParameters type or a IO + type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ClusterUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -736,16 +745,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Cluster] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = 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, cluster_name=cluster_name, parameters=parameters, @@ -765,7 +774,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -777,9 +786,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.ServiceFabric/clusters/{clusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -809,10 +820,10 @@ 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: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -824,9 +835,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -840,7 +851,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.ClusterListResult: @@ -867,10 +880,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterListResult] + ) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) request = build_list_by_resource_group_request( resource_group_name=resource_group_name, @@ -881,9 +894,9 @@ def list_by_resource_group(self, resource_group_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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -901,7 +914,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _mo return deserialized - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters" + } @distributed_trace def list(self, **kwargs: Any) -> _models.ClusterListResult: @@ -926,10 +941,10 @@ def list(self, **kwargs: Any) -> _models.ClusterListResult: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ClusterListResult] + ) + cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -939,9 +954,9 @@ def list(self, **kwargs: Any) -> _models.ClusterListResult: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -959,7 +974,7 @@ def list(self, **kwargs: Any) -> _models.ClusterListResult: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters"} @overload def list_upgradable_versions( @@ -1047,7 +1062,7 @@ def list_upgradable_versions( :param cluster_name: The name of the cluster resource. Required. :type cluster_name: str :param versions_description: The upgrade path description with target version. Is either a - model type or a IO type. Default value is None. + UpgradableVersionsDescription type or a IO type. Default value is None. :type versions_description: ~azure.mgmt.servicefabric.models.UpgradableVersionsDescription or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -1069,11 +1084,11 @@ def list_upgradable_versions( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpgradableVersionPathResult] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpgradableVersionPathResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1099,9 +1114,9 @@ def list_upgradable_versions( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1119,4 +1134,6 @@ def list_upgradable_versions( return deserialized - list_upgradable_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions"} # type: ignore + list_upgradable_versions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/listUpgradableVersions" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py index 521d2db40062..904606cbb73e 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_operations.py @@ -45,7 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,10 +93,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +116,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -132,7 +132,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -160,4 +160,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.ServiceFabric/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.ServiceFabric/operations"} diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py index d348557766fc..6fd281c3b180 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/azure/mgmt/servicefabric/operations/_services_operations.py @@ -52,7 +52,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "serviceName": _SERIALIZER.url("service_name", service_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,8 +90,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_create_or_update_request( "serviceName": _SERIALIZER.url("service_name", service_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") @@ -131,8 +131,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", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_update_request( "serviceName": _SERIALIZER.url("service_name", service_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") @@ -172,7 +172,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", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +188,7 @@ def build_delete_request( "serviceName": _SERIALIZER.url("service_name", service_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,7 +205,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +220,7 @@ def build_list_request( "applicationName": _SERIALIZER.url("application_name", application_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") @@ -284,10 +284,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -301,9 +301,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -321,7 +321,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } def _create_or_update_initial( self, @@ -343,11 +345,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -372,9 +374,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -392,7 +394,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @overload def begin_create_or_update( @@ -505,7 +509,8 @@ def begin_create_or_update( :param service_name: The name of the service resource in the format of {applicationName}~{serviceName}. Required. :type service_name: str - :param parameters: The service resource. Is either a model type or a IO type. Required. + :param parameters: The service resource. Is either a ServiceResource type or a IO type. + Required. :type parameters: ~azure.mgmt.servicefabric.models.ServiceResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -526,16 +531,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -557,7 +562,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -569,9 +574,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } def _update_initial( self, @@ -593,11 +600,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -622,9 +629,9 @@ 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 + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -642,7 +649,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @overload def begin_update( @@ -755,8 +764,8 @@ def begin_update( :param service_name: The name of the service resource in the format of {applicationName}~{serviceName}. Required. :type service_name: str - :param parameters: The service resource for patch operations. Is either a model type or a IO - type. Required. + :param parameters: The service resource for patch operations. Is either a ServiceResourceUpdate + type or a IO type. Required. :type parameters: ~azure.mgmt.servicefabric.models.ServiceResourceUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -777,16 +786,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResource] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServiceResource] = 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, cluster_name=cluster_name, application_name=application_name, @@ -808,7 +817,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -820,9 +829,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, cluster_name: str, application_name: str, service_name: str, **kwargs: Any @@ -838,10 +849,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -855,9 +866,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -871,7 +882,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @distributed_trace def begin_delete( @@ -905,13 +918,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -931,7 +944,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -943,9 +956,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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}" + } @distributed_trace def list( @@ -979,10 +994,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-06-01"] = kwargs.pop( "api_version", _params.pop("api-version", self._config.api_version) - ) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceResourceList] + ) + cls: ClsType[_models.ServiceResourceList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -995,9 +1010,9 @@ def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1015,4 +1030,6 @@ def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services" + } diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_delete_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_delete_operation_example.py index 023f2a25df6c..d27933b930d6 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_delete_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python delete_an_application.py + python application_delete_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_get_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_get_operation_example.py index 6ffb8ee51ae3..b8ce6c7ba85a 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_get_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_an_application.py + python application_get_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_resources.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_list_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_resources.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_list_operation_example.py index 364dd39f7263..7ac2ec39513b 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_resources.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_list_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_list_of_application_resources.py + python application_list_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_an_application.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_patch_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_an_application.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_patch_operation_example.py index b115f548ab8c..0dce7a3cbb7c 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_an_application.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_patch_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python patch_an_application.py + python application_patch_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_maximum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_max.py similarity index 98% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_maximum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_max.py index b592ef46bb45..e94cd873cd36 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_maximum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_an_application_with_maximum_parameters.py + python application_put_operation_example_max.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_minimum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_min.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_minimum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_min.py index 80d944232748..72c6304551b8 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_minimum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_example_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_an_application_with_minimum_parameters.py + python application_put_operation_example_min.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_recreate_option.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_recreate_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_recreate_option.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_recreate_example.py index af7b717ea162..b607aeaa274d 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_with_recreate_option.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_put_operation_recreate_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_an_application_with_recreate_option.py + python application_put_operation_recreate_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_delete_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_delete_operation_example.py index 32c4415b5e13..ba569b6da6e2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_delete_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python delete_an_application_type.py + python application_type_name_delete_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_get_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_get_operation_example.py index 7e25bcb3c0e7..62ebe1b4cb51 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_get_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_an_application_type.py + python application_type_name_get_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_name_resources.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_list_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_name_resources.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_list_operation_example.py index c8e23fba8e56..5833cb4be3e2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_name_resources.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_list_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_list_of_application_type_name_resources.py + python application_type_name_list_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_put_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_put_operation_example.py index 2e3f51218596..a69f63397e05 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_name_put_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_an_application_type.py + python application_type_name_put_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_delete_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type_version.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_delete_operation_example.py index 2ff80bc57da0..7d481497caa5 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_an_application_type_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_delete_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python delete_an_application_type_version.py + python application_type_version_delete_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_get_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type_version.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_get_operation_example.py index 0eb0a6c9ecce..60be0ea36579 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_an_application_type_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_get_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_an_application_type_version.py + python application_type_version_get_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_version_resources.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_list_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_version_resources.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_list_operation_example.py index 90355c3331de..eea2d04f011d 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_application_type_version_resources.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_list_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_list_of_application_type_version_resources.py + python application_type_version_list_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_put_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type_version.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_put_operation_example.py index f29a21d8ff9f..4279eb432f88 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_an_application_type_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/application_type_version_put_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_an_application_type_version.py + python application_type_version_put_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_cluster.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_delete_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_cluster.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_delete_operation_example.py index 1be52db4a4dc..82ee3a128ca4 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_cluster.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_delete_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python delete_a_cluster.py + python cluster_delete_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_cluster.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_get_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_cluster.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_get_operation_example.py index 9ae8afca5435..33fded8ef7a4 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_cluster.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_get_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_cluster.py + python cluster_get_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_by_resource_group.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_by_resource_group_operation_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_by_resource_group.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_by_resource_group_operation_example.py index 22bc4a92da3d..45c19e160f7e 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_by_resource_group.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_by_resource_group_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python list_cluster_by_resource_group.py + python cluster_list_by_resource_group_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_clusters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_clusters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_operation_example.py index 6b3a0ec75a76..75e55794a04a 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_clusters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_list_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python list_clusters.py + python cluster_list_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_cluster.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_patch_operation_example.py similarity index 98% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_cluster.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_patch_operation_example.py index 8b0227977d2f..17ea56193104 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_cluster.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_patch_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python patch_a_cluster.py + python cluster_patch_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_maximum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_max.py similarity index 99% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_maximum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_max.py index 038eec663174..9f64a3b7d7e3 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_maximum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_a_cluster_with_maximum_parameters.py + python cluster_put_operation_example_max.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_minimum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_min.py similarity index 98% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_minimum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_min.py index eed6522f9308..4c281deb8807 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_cluster_with_minimum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_put_operation_example_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_a_cluster_with_minimum_parameters.py + python cluster_put_operation_example_min.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version_by_environment.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_by_environment_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version_by_environment.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_by_environment_example.py index 6d4e0cda403f..bf5c8e400fb3 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version_by_environment.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_by_environment_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_cluster_version_by_environment.py + python cluster_versions_get_by_environment_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_example.py index dfdc0a7e14ac..91bf33ee61b9 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_cluster_version.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_get_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_cluster_version.py + python cluster_versions_get_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions_by_environment.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_by_environment.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions_by_environment.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_by_environment.py index ed4706b6b73d..997667ddb236 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions_by_environment.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_by_environment.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python list_cluster_versions_by_environment.py + python cluster_versions_list_by_environment.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_example.py index 26a8c516fa35..ed0e4c3f70bc 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_cluster_versions.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/cluster_versions_list_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python list_cluster_versions.py + python cluster_versions_list_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_minimum_and_maximum_code_versions.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_min_max_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_minimum_and_maximum_code_versions.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_min_max_example.py index df57f625f802..295e5304dda2 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_minimum_and_maximum_code_versions.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_min_max_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_minimum_and_maximum_code_versions.py + python list_upgradable_versions_min_max_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_upgrade_path.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_path_example.py similarity index 96% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_upgrade_path.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_path_example.py index ee95544467ac..17fee0c68193 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_upgrade_path.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/list_upgradable_versions_path_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_upgrade_path.py + python list_upgradable_versions_path_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_service.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_delete_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_service.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_delete_operation_example.py index d9a85897d337..8071508f463a 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/delete_a_service.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_delete_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python delete_a_service.py + python service_delete_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_service.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_get_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_service.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_get_operation_example.py index 9021133d080c..2760cec6fbb7 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_service.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_get_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_service.py + python service_get_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_service_resources.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_list_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_service_resources.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_list_operation_example.py index 2f34e89984aa..4adad1c4378a 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/get_a_list_of_service_resources.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_list_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python get_a_list_of_service_resources.py + python service_list_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_service.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_patch_operation_example.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_service.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_patch_operation_example.py index 984c8ccc5cd6..61277b98cba1 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/patch_a_service.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_patch_operation_example.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python patch_a_service.py + python service_patch_operation_example.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_maximum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_max.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_maximum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_max.py index 77e437ed5817..ec402c63dca0 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_maximum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_a_service_with_maximum_parameters.py + python service_put_operation_example_max.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_minimum_parameters.py b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_min.py similarity index 97% rename from sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_minimum_parameters.py rename to sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_min.py index 4c68e3700567..d59d6c57de69 100644 --- a/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/put_a_service_with_minimum_parameters.py +++ b/sdk/servicefabric/azure-mgmt-servicefabric/generated_samples/service_put_operation_example_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-servicefabric # USAGE - python put_a_service_with_minimum_parameters.py + python service_put_operation_example_min.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,