From 015cf1ebbddab504a953e9b1696a521a44547237 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 26 Jan 2024 07:11:19 +0000 Subject: [PATCH] CodeGen from PR 3178 in test-repo-billy/azure-rest-api-specs Merge a6a9641645aebb119ecfe93a7cd7575e6f51ef40 into 19077176ed509f8139ce021aca5b14b1924a1fd9 --- .../azure-mgmt-servicelinker/_meta.json | 12 +- .../mgmt/servicelinker/_configuration.py | 8 +- .../mgmt/servicelinker/_serialization.py | 119 ++++--- .../_service_linker_management_client.py | 6 +- .../azure/mgmt/servicelinker/_vendor.py | 11 - .../azure/mgmt/servicelinker/_version.py | 2 +- .../mgmt/servicelinker/aio/_configuration.py | 8 +- .../aio/_service_linker_management_client.py | 6 +- .../_configuration_names_operations.py | 12 +- .../aio/operations/_connector_operations.py | 136 +++---- .../aio/operations/_linker_operations.py | 79 ++--- .../aio/operations/_linkers_operations.py | 70 ++-- .../aio/operations/_operations.py | 12 +- .../mgmt/servicelinker/models/__init__.py | 4 + .../mgmt/servicelinker/models/_models_py3.py | 333 +++++++++++++----- ..._service_linker_management_client_enums.py | 1 + .../_configuration_names_operations.py | 16 +- .../operations/_connector_operations.py | 210 +++++------ .../operations/_linker_operations.py | 123 +++---- .../operations/_linkers_operations.py | 108 +++--- .../servicelinker/operations/_operations.py | 16 +- .../connector_dryrun_delete.py | 3 +- .../generated_samples/delete_connector.py | 3 +- .../generated_samples/delete_dryrun.py | 3 +- .../generated_samples/delete_linker.py | 3 +- 25 files changed, 631 insertions(+), 673 deletions(-) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json index 9dd88955eb82c..c4a95176ccaca 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json +++ b/sdk/servicelinker/azure-mgmt-servicelinker/_meta.json @@ -1,11 +1,11 @@ { - "commit": "279924e2cefe36a86703fd85a91679f6dfc067fc", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "commit": "f6aa8fd0858b1a09debeb4462d9d635990947506", + "repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.2.7", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/servicelinker/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 --tag=package-2022-11-01-preview --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/servicelinker/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/servicelinker/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py index 096b5822e77e9..2c36a7a891d22 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from ._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -40,7 +34,7 @@ class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disa def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(ServiceLinkerManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-11-01-preview"] = kwargs.pop("api_version", "2022-11-01-preview") + api_version: str = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_serialization.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_serialization.py index 2c170e28dbca2..4bae2292227bd 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_serialization.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - 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") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _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__) @@ -287,25 +304,25 @@ 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 # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): 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)`. @@ -336,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: @@ -384,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. @@ -396,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 @@ -409,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, @@ -518,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, @@ -534,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 @@ -602,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -636,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -656,8 +683,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: @@ -715,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -723,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -777,6 +804,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) @@ -863,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -875,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -922,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -1161,7 +1199,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 @@ -1242,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1266,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1332,7 +1371,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, @@ -1352,7 +1391,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 @@ -1471,7 +1510,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 @@ -1486,7 +1525,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, @@ -1496,7 +1535,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: diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py index 2212b97af8870..54bba10581d53 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_service_linker_management_client.py @@ -29,7 +29,7 @@ class ServiceLinkerManagementClient: # pylint: disable=client-accepts-api-version-keyword - """Microsoft.ServiceLinker provider. + """Microsoft.ServiceLinker provider test node 20. :ivar connector: ConnectorOperations operations :vartype connector: azure.mgmt.servicelinker.operations.ConnectorOperations @@ -56,7 +56,7 @@ def __init__( self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = ServiceLinkerManagementClientConfiguration(credential=credential, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -99,5 +99,5 @@ def __enter__(self) -> "ServiceLinkerManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_vendor.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_vendor.py index 9aad73fc743e7..0dafe0e287ff1 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_vendor.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_vendor.py @@ -14,14 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py index 58920e6942de0..e5754a47ce68f 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py index 52e9af507a221..16cb1cac0e57b 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_configuration.py @@ -6,7 +6,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -15,11 +14,6 @@ from .._version import VERSION -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -40,7 +34,7 @@ class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disa def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(ServiceLinkerManagementClientConfiguration, self).__init__(**kwargs) - api_version: Literal["2022-11-01-preview"] = kwargs.pop("api_version", "2022-11-01-preview") + api_version: str = kwargs.pop("api_version", "2022-11-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py index e46ec5e97a012..1780e27cd7b05 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/_service_linker_management_client.py @@ -29,7 +29,7 @@ class ServiceLinkerManagementClient: # pylint: disable=client-accepts-api-version-keyword - """Microsoft.ServiceLinker provider. + """Microsoft.ServiceLinker provider test node 20. :ivar connector: ConnectorOperations operations :vartype connector: azure.mgmt.servicelinker.aio.operations.ConnectorOperations @@ -57,7 +57,7 @@ def __init__( self, credential: "AsyncTokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = ServiceLinkerManagementClientConfiguration(credential=credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -100,5 +100,5 @@ async def __aenter__(self) -> "ServiceLinkerManagementClient": 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/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_configuration_names_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_configuration_names_operations.py index 941b515504392..2121eb93cab33 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_configuration_names_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_configuration_names_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._configuration_names_operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +73,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationNameResult] = kwargs.pop("cls", None) error_map = { @@ -133,8 +126,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_connector_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_connector_operations.py index e8f0e3a10d43d..951d8682e504b 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_connector_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_connector_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,10 +46,6 @@ build_validate_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +91,7 @@ def list_dryrun( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunList] = kwargs.pop("cls", None) error_map = { @@ -151,8 +145,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -200,9 +195,7 @@ async def get_dryrun( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) request = build_get_dryrun_request( @@ -218,8 +211,9 @@ async def get_dryrun( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -260,16 +254,14 @@ async def _create_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunResource") @@ -290,8 +282,9 @@ async def _create_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,7 +414,7 @@ async def begin_create_dryrun( :type location: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -442,9 +435,7 @@ async def begin_create_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -514,16 +505,14 @@ async def _update_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DryrunResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunPatch") @@ -544,8 +533,9 @@ async def _update_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,7 +663,7 @@ async def begin_update_dryrun( :type location: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -694,9 +684,7 @@ async def begin_update_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -777,9 +765,7 @@ async def delete_dryrun( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dryrun_request( @@ -795,8 +781,9 @@ async def delete_dryrun( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -836,9 +823,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceList] = kwargs.pop("cls", None) error_map = { @@ -892,8 +877,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -941,9 +927,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) request = build_get_request( @@ -959,8 +943,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1001,16 +986,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerResource") @@ -1031,8 +1014,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1162,7 +1146,7 @@ async def begin_create_or_update( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connector details. Is either a model type or a IO type. Required. + :param parameters: Connector details. Is either a LinkerResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1183,9 +1167,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1249,9 +1231,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1267,8 +1247,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1315,9 +1296,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1382,16 +1361,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerPatch") @@ -1412,8 +1389,9 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1543,7 +1521,7 @@ async def begin_update( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connector details. Is either a model type or a IO type. Required. + :param parameters: Connector details. Is either a LinkerPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1564,9 +1542,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1630,9 +1606,7 @@ async def _validate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.ValidateOperationResult]] = kwargs.pop("cls", None) request = build_validate_request( @@ -1648,8 +1622,9 @@ async def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1704,9 +1679,7 @@ async def begin_validate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ValidateOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1841,8 +1814,8 @@ async def generate_configurations( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connection Info, including format, secret store, etc. Is either a model type - or a IO type. Default value is None. + :param parameters: Connection Info, including format, secret store, etc. Is either a + ConfigurationInfo type or a IO type. Default value is None. :type parameters: ~azure.mgmt.servicelinker.models.ConfigurationInfo or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1863,16 +1836,14 @@ async def generate_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: if parameters is not None: @@ -1896,8 +1867,9 @@ async def generate_configurations( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py index 7d971b7057a59..aa7384572e73d 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linker_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -41,10 +41,6 @@ build_validate_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.Linke _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceList] = kwargs.pop("cls", None) error_map = { @@ -139,8 +133,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -180,9 +175,7 @@ async def get(self, resource_uri: str, linker_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) request = build_get_request( @@ -196,8 +189,9 @@ async def get(self, resource_uri: str, linker_name: str, **kwargs: Any) -> _mode request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -230,16 +224,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerResource") @@ -258,8 +250,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -367,7 +360,7 @@ async def begin_create_or_update( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Linker details. Is either a model type or a IO type. Required. + :param parameters: Linker details. Is either a LinkerResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -388,9 +381,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -450,9 +441,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -466,8 +455,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -506,9 +496,7 @@ async def begin_delete(self, resource_uri: str, linker_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -563,16 +551,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerPatch") @@ -591,8 +577,9 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -698,7 +685,7 @@ async def begin_update( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Linker details. Is either a model type or a IO type. Required. + :param parameters: Linker details. Is either a LinkerPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -719,9 +706,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -781,9 +766,7 @@ async def _validate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.ValidateOperationResult]] = kwargs.pop("cls", None) request = build_validate_request( @@ -797,8 +780,9 @@ async def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -849,9 +833,7 @@ async def begin_validate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ValidateOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -922,9 +904,7 @@ async def list_configurations( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) request = build_list_configurations_request( @@ -938,8 +918,9 @@ async def list_configurations( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linkers_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linkers_operations.py index 25aa290694a2d..d3c1eae25abe9 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linkers_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_linkers_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,10 +40,6 @@ build_update_dryrun_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_dryrun(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunList] = kwargs.pop("cls", None) error_map = { @@ -137,8 +131,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -178,9 +173,7 @@ async def get_dryrun(self, resource_uri: str, dryrun_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) request = build_get_dryrun_request( @@ -194,8 +187,9 @@ async def get_dryrun(self, resource_uri: str, dryrun_name: str, **kwargs: Any) - request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -228,16 +222,14 @@ async def _create_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunResource") @@ -256,8 +248,9 @@ async def _create_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -363,7 +356,7 @@ async def begin_create_dryrun( :type resource_uri: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -384,9 +377,7 @@ async def begin_create_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -446,16 +437,14 @@ async def _update_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DryrunResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunPatch") @@ -474,8 +463,9 @@ async def _update_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -579,7 +569,7 @@ async def begin_update_dryrun( :type resource_uri: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -600,9 +590,7 @@ async def begin_update_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -675,9 +663,7 @@ async def delete_dryrun( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dryrun_request( @@ -691,8 +677,9 @@ async def delete_dryrun( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -778,8 +765,8 @@ async def generate_configurations( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Connection Info, including format, secret store, etc. Is either a model type - or a IO type. Default value is None. + :param parameters: Connection Info, including format, secret store, etc. Is either a + ConfigurationInfo type or a IO type. Default value is None. :type parameters: ~azure.mgmt.servicelinker.models.ConfigurationInfo or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -800,16 +787,14 @@ async def generate_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: if parameters is not None: @@ -831,8 +816,9 @@ async def generate_configurations( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py index 27c38f1b97828..672ca4560ab86 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,9 +64,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -122,8 +115,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py index aaa1b77d5a887..b553a59874b56 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/__init__.py @@ -20,6 +20,8 @@ from ._models_py3 import ConfluentBootstrapServer from ._models_py3 import ConfluentSchemaRegistry from ._models_py3 import CreateOrUpdateDryrunParameters +from ._models_py3 import DaprMetadata +from ._models_py3 import DaprProperties from ._models_py3 import DatabaseAadAuthInfo from ._models_py3 import DryrunList from ._models_py3 import DryrunOperationPreview @@ -96,6 +98,8 @@ "ConfluentBootstrapServer", "ConfluentSchemaRegistry", "CreateOrUpdateDryrunParameters", + "DaprMetadata", + "DaprProperties", "DatabaseAadAuthInfo", "DryrunList", "DryrunOperationPreview", diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py index e24a2dd6129e4..10a0d24ddce38 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_models_py3.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/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 @@ -53,14 +53,15 @@ class AuthInfoBase(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.auth_type: Optional[str] = None class AccessKeyInfoBase(AuthInfoBase): - """The access key directly from target resource properties, which target service is Azure Resource, such as Microsoft.Storage. + """The access key directly from target resource properties, which target service is Azure + Resource, such as Microsoft.Storage. All required parameters must be populated in order to send to Azure. @@ -83,7 +84,9 @@ class AccessKeyInfoBase(AuthInfoBase): "permissions": {"key": "permissions", "type": "[str]"}, } - def __init__(self, *, permissions: Optional[List[Union[str, "_models.AccessKeyPermissions"]]] = None, **kwargs): + def __init__( + self, *, permissions: Optional[List[Union[str, "_models.AccessKeyPermissions"]]] = None, **kwargs: Any + ) -> None: """ :keyword permissions: Permissions of the accessKey. ``Read`` and ``Write`` are for Azure Cosmos DB and Azure App Configuration, ``Listen``\ , ``Send`` and ``Manage`` are for Azure Event Hub @@ -117,7 +120,7 @@ class AzureResourcePropertiesBase(_serialization.Model): _subtype_map = {"type": {"KeyVault": "AzureKeyVaultProperties"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type: Optional[str] = None @@ -143,7 +146,7 @@ class AzureKeyVaultProperties(AzureResourcePropertiesBase): "connect_as_kubernetes_csi_driver": {"key": "connectAsKubernetesCsiDriver", "type": "bool"}, } - def __init__(self, *, connect_as_kubernetes_csi_driver: Optional[bool] = None, **kwargs): + def __init__(self, *, connect_as_kubernetes_csi_driver: Optional[bool] = None, **kwargs: Any) -> None: """ :keyword connect_as_kubernetes_csi_driver: True if connect via Kubernetes CSI Driver. :paramtype connect_as_kubernetes_csi_driver: bool @@ -183,7 +186,7 @@ class TargetServiceBase(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type: Optional[str] = None @@ -218,8 +221,8 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin resource_properties: Optional["_models.AzureResourcePropertiesBase"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The Id of azure resource. :paramtype id: str @@ -260,7 +263,7 @@ class DryrunPrerequisiteResult(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type: Optional[str] = None @@ -290,7 +293,7 @@ class BasicErrorDryrunPrerequisiteResult(DryrunPrerequisiteResult): "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 @@ -318,6 +321,8 @@ class ConfigurationInfo(_serialization.Model): :ivar customized_keys: Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations. :vartype customized_keys: dict[str, str] + :ivar dapr_properties: Indicates some additional properties for dapr client type. + :vartype dapr_properties: ~azure.mgmt.servicelinker.models.DaprProperties :ivar additional_configurations: A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations. @@ -328,6 +333,7 @@ class ConfigurationInfo(_serialization.Model): "delete_or_update_behavior": {"key": "deleteOrUpdateBehavior", "type": "str"}, "action": {"key": "action", "type": "str"}, "customized_keys": {"key": "customizedKeys", "type": "{str}"}, + "dapr_properties": {"key": "daprProperties", "type": "DaprProperties"}, "additional_configurations": {"key": "additionalConfigurations", "type": "{str}"}, } @@ -337,9 +343,10 @@ def __init__( delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, action: Optional[Union[str, "_models.ActionType"]] = None, customized_keys: Optional[Dict[str, str]] = None, + dapr_properties: Optional["_models.DaprProperties"] = None, additional_configurations: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword delete_or_update_behavior: Indicates whether to clean up previous operation when Linker is updating or deleting. Known values are: "Default" and "ForcedCleanup". @@ -353,6 +360,8 @@ def __init__( :keyword customized_keys: Optional. A dictionary of default key name and customized key name mapping. If not specified, default key name will be used for generate configurations. :paramtype customized_keys: dict[str, str] + :keyword dapr_properties: Indicates some additional properties for dapr client type. + :paramtype dapr_properties: ~azure.mgmt.servicelinker.models.DaprProperties :keyword additional_configurations: A dictionary of additional configurations to be added. Service will auto generate a set of basic configurations and this property is to full fill more customized configurations. @@ -362,6 +371,7 @@ def __init__( self.delete_or_update_behavior = delete_or_update_behavior self.action = action self.customized_keys = customized_keys + self.dapr_properties = dapr_properties self.additional_configurations = additional_configurations @@ -372,23 +382,36 @@ class ConfigurationName(_serialization.Model): :vartype value: str :ivar description: Description for the configuration name. :vartype description: str + :ivar required: Represent the configuration is required or not. + :vartype required: bool """ _attribute_map = { "value": {"key": "value", "type": "str"}, "description": {"key": "description", "type": "str"}, + "required": {"key": "required", "type": "bool"}, } - def __init__(self, *, value: Optional[str] = None, description: Optional[str] = None, **kwargs): + def __init__( + self, + *, + value: Optional[str] = None, + description: Optional[str] = None, + required: Optional[bool] = None, + **kwargs: Any + ) -> None: """ :keyword value: :paramtype value: str :keyword description: Description for the configuration name. :paramtype description: str + :keyword required: Represent the configuration is required or not. + :paramtype required: bool """ super().__init__(**kwargs) self.value = value self.description = description + self.required = required class ConfigurationNameItem(_serialization.Model): @@ -397,13 +420,15 @@ class ConfigurationNameItem(_serialization.Model): :ivar target_service: The target service provider name and resource name. :vartype target_service: str :ivar client_type: The client type for configuration names. Known values are: "none", "dotnet", - "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and - "kafka-springBoot". + "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", + and "dapr". :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar auth_type: The auth type. Known values are: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", and "userAccount". :vartype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType + :ivar dapr_properties: Indicates some additional properties for dapr client type. + :vartype dapr_properties: ~azure.mgmt.servicelinker.models.DaprProperties :ivar names: The configuration names to be set in compute service environment. :vartype names: list[~azure.mgmt.servicelinker.models.ConfigurationName] """ @@ -412,6 +437,7 @@ class ConfigurationNameItem(_serialization.Model): "target_service": {"key": "properties.targetService", "type": "str"}, "client_type": {"key": "properties.clientType", "type": "str"}, "auth_type": {"key": "properties.authType", "type": "str"}, + "dapr_properties": {"key": "properties.daprProperties", "type": "DaprProperties"}, "names": {"key": "properties.names", "type": "[ConfigurationName]"}, } @@ -421,20 +447,23 @@ def __init__( target_service: Optional[str] = None, client_type: Optional[Union[str, "_models.ClientType"]] = None, auth_type: Optional[Union[str, "_models.AuthType"]] = None, + dapr_properties: Optional["_models.DaprProperties"] = None, names: Optional[List["_models.ConfigurationName"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword target_service: The target service provider name and resource name. :paramtype target_service: str :keyword client_type: The client type for configuration names. Known values are: "none", - "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and - "kafka-springBoot". + "dotnet", "java", "python", "go", "php", "ruby", "django", "nodejs", "springBoot", + "kafka-springBoot", and "dapr". :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword auth_type: The auth type. Known values are: "systemAssignedIdentity", "userAssignedIdentity", "servicePrincipalSecret", "servicePrincipalCertificate", "secret", "accessKey", and "userAccount". :paramtype auth_type: str or ~azure.mgmt.servicelinker.models.AuthType + :keyword dapr_properties: Indicates some additional properties for dapr client type. + :paramtype dapr_properties: ~azure.mgmt.servicelinker.models.DaprProperties :keyword names: The configuration names to be set in compute service environment. :paramtype names: list[~azure.mgmt.servicelinker.models.ConfigurationName] """ @@ -442,11 +471,13 @@ def __init__( self.target_service = target_service self.client_type = client_type self.auth_type = auth_type + self.dapr_properties = dapr_properties self.names = names class ConfigurationNameResult(_serialization.Model): - """Configuration Name list which will be set based on different target resource, client type, auth type. + """Configuration Name list which will be set based on different target resource, client type, auth + type. Variables are only populated by the server, and will be ignored when sending a request. @@ -465,7 +496,7 @@ class ConfigurationNameResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.ConfigurationNameItem"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.ConfigurationNameItem"]] = None, **kwargs: Any) -> None: """ :keyword value: Expected configuration names for each target service. :paramtype value: list[~azure.mgmt.servicelinker.models.ConfigurationNameItem] @@ -486,7 +517,7 @@ class ConfigurationResult(_serialization.Model): "configurations": {"key": "configurations", "type": "[SourceConfiguration]"}, } - def __init__(self, *, configurations: Optional[List["_models.SourceConfiguration"]] = None, **kwargs): + def __init__(self, *, configurations: Optional[List["_models.SourceConfiguration"]] = None, **kwargs: Any) -> None: """ :keyword configurations: The configuration properties for source resource. :paramtype configurations: list[~azure.mgmt.servicelinker.models.SourceConfiguration] @@ -516,7 +547,7 @@ class ConfluentBootstrapServer(TargetServiceBase): "endpoint": {"key": "endpoint", "type": "str"}, } - def __init__(self, *, endpoint: Optional[str] = None, **kwargs): + def __init__(self, *, endpoint: Optional[str] = None, **kwargs: Any) -> None: """ :keyword endpoint: The endpoint of service. :paramtype endpoint: str @@ -547,7 +578,7 @@ class ConfluentSchemaRegistry(TargetServiceBase): "endpoint": {"key": "endpoint", "type": "str"}, } - def __init__(self, *, endpoint: Optional[str] = None, **kwargs): + def __init__(self, *, endpoint: Optional[str] = None, **kwargs: Any) -> None: """ :keyword endpoint: The endpoint of service. :paramtype endpoint: str @@ -567,7 +598,8 @@ class LinkerProperties(_serialization.Model): :ivar auth_info: The authentication type. :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str @@ -611,15 +643,16 @@ def __init__( scope: Optional[str] = None, public_network_solution: Optional["_models.PublicNetworkSolution"] = None, configuration_info: Optional["_models.ConfigurationInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword target_service: The target service properties. :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution @@ -667,7 +700,7 @@ class DryrunParameters(_serialization.Model): _subtype_map = {"action_name": {"createOrUpdate": "CreateOrUpdateDryrunParameters"}} - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.action_name: Optional[str] = None @@ -685,7 +718,8 @@ class CreateOrUpdateDryrunParameters(DryrunParameters, LinkerProperties): :ivar auth_info: The authentication type. :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str @@ -733,15 +767,16 @@ def __init__( scope: Optional[str] = None, public_network_solution: Optional["_models.PublicNetworkSolution"] = None, configuration_info: Optional["_models.ConfigurationInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword target_service: The target service properties. :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution @@ -778,6 +813,98 @@ def __init__( self.action_name: str = "createOrUpdate" +class DaprMetadata(_serialization.Model): + """The dapr component metadata. + + :ivar name: Metadata property name. + :vartype name: str + :ivar value: Metadata property value. + :vartype value: str + :ivar secret_ref: The secret name where dapr could get value. + :vartype secret_ref: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "secret_ref": {"key": "secretRef", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + secret_ref: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Metadata property name. + :paramtype name: str + :keyword value: Metadata property value. + :paramtype value: str + :keyword secret_ref: The secret name where dapr could get value. + :paramtype secret_ref: str + """ + super().__init__(**kwargs) + self.name = name + self.value = value + self.secret_ref = secret_ref + + +class DaprProperties(_serialization.Model): + """Indicates some additional properties for dapr client type. + + :ivar version: The dapr component version. + :vartype version: str + :ivar component_type: The dapr component type. + :vartype component_type: str + :ivar secret_store_component: The name of a secret store dapr to retrieve secret. + :vartype secret_store_component: str + :ivar metadata: Additional dapr metadata. + :vartype metadata: list[~azure.mgmt.servicelinker.models.DaprMetadata] + :ivar scopes: The dapr component scopes. + :vartype scopes: list[str] + """ + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "component_type": {"key": "componentType", "type": "str"}, + "secret_store_component": {"key": "secretStoreComponent", "type": "str"}, + "metadata": {"key": "metadata", "type": "[DaprMetadata]"}, + "scopes": {"key": "scopes", "type": "[str]"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + component_type: Optional[str] = None, + secret_store_component: Optional[str] = None, + metadata: Optional[List["_models.DaprMetadata"]] = None, + scopes: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: The dapr component version. + :paramtype version: str + :keyword component_type: The dapr component type. + :paramtype component_type: str + :keyword secret_store_component: The name of a secret store dapr to retrieve secret. + :paramtype secret_store_component: str + :keyword metadata: Additional dapr metadata. + :paramtype metadata: list[~azure.mgmt.servicelinker.models.DaprMetadata] + :keyword scopes: The dapr component scopes. + :paramtype scopes: list[str] + """ + super().__init__(**kwargs) + self.version = version + self.component_type = component_type + self.secret_store_component = secret_store_component + self.metadata = metadata + self.scopes = scopes + + class DatabaseAadAuthInfo(_serialization.Model): """The extra auth info required by Database AAD authentication. @@ -789,7 +916,7 @@ class DatabaseAadAuthInfo(_serialization.Model): "user_name": {"key": "userName", "type": "str"}, } - def __init__(self, *, user_name: Optional[str] = None, **kwargs): + def __init__(self, *, user_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword user_name: Username created in the database which is mapped to a user in AAD. :paramtype user_name: str @@ -813,8 +940,8 @@ class DryrunList(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.DryrunResource"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.DryrunResource"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The link used to get the next page of dryrun list. :paramtype next_link: str @@ -860,8 +987,8 @@ def __init__( description: Optional[str] = None, action: Optional[str] = None, scope: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The operation name. :paramtype name: str @@ -913,7 +1040,7 @@ class DryrunPatch(_serialization.Model): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, *, parameters: Optional["_models.DryrunParameters"] = None, **kwargs): + def __init__(self, *, parameters: Optional["_models.DryrunParameters"] = None, **kwargs: Any) -> None: """ :keyword parameters: The parameters of the dryrun. :paramtype parameters: ~azure.mgmt.servicelinker.models.DryrunParameters @@ -957,7 +1084,7 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -967,7 +1094,8 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -998,7 +1126,7 @@ class ProxyResource(Resource): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -1050,7 +1178,7 @@ class DryrunResource(ProxyResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, *, parameters: Optional["_models.DryrunParameters"] = None, **kwargs): + def __init__(self, *, parameters: Optional["_models.DryrunParameters"] = None, **kwargs: Any) -> None: """ :keyword parameters: The parameters of the dryrun. :paramtype parameters: ~azure.mgmt.servicelinker.models.DryrunParameters @@ -1083,7 +1211,7 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type = None @@ -1123,7 +1251,7 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.code = None @@ -1134,7 +1262,8 @@ def __init__(self, **kwargs): class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~azure.mgmt.servicelinker.models.ErrorDetail @@ -1144,7 +1273,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~azure.mgmt.servicelinker.models.ErrorDetail @@ -1180,8 +1309,8 @@ def __init__( ip_ranges: Optional[List[str]] = None, azure_services: Optional[Union[str, "_models.AllowType"]] = None, caller_client_ip: Optional[Union[str, "_models.AllowType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword ip_ranges: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. @@ -1229,14 +1358,16 @@ class SecretInfoBase(_serialization.Model): } } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.secret_type: Optional[str] = None class KeyVaultSecretReferenceSecretInfo(SecretInfoBase): - """The secret info when type is keyVaultSecretReference. It's for scenario that user provides a secret stored in user's keyvault and source is Azure Kubernetes. The key Vault's resource id is linked to secretStore.keyVaultId. + """The secret info when type is keyVaultSecretReference. It's for scenario that user provides a + secret stored in user's keyvault and source is Azure Kubernetes. The key Vault's resource id is + linked to secretStore.keyVaultId. All required parameters must be populated in order to send to Azure. @@ -1259,7 +1390,7 @@ class KeyVaultSecretReferenceSecretInfo(SecretInfoBase): "version": {"key": "version", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of the Key Vault secret. :paramtype name: str @@ -1273,7 +1404,8 @@ def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, class KeyVaultSecretUriSecretInfo(SecretInfoBase): - """The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret stored in user's keyvault and source is Web App, Spring Cloud or Container App. + """The secret info when type is keyVaultSecretUri. It's for scenario that user provides a secret + stored in user's keyvault and source is Web App, Spring Cloud or Container App. All required parameters must be populated in order to send to Azure. @@ -1293,7 +1425,7 @@ class KeyVaultSecretUriSecretInfo(SecretInfoBase): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: URI to the keyvault secret. :paramtype value: str @@ -1313,7 +1445,8 @@ class LinkerPatch(_serialization.Model): :ivar auth_info: The authentication type. :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str @@ -1357,15 +1490,16 @@ def __init__( scope: Optional[str] = None, public_network_solution: Optional["_models.PublicNetworkSolution"] = None, configuration_info: Optional["_models.ConfigurationInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword target_service: The target service properties. :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution @@ -1412,7 +1546,8 @@ class LinkerResource(ProxyResource): # pylint: disable=too-many-instance-attrib :ivar auth_info: The authentication type. :vartype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :ivar client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :vartype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :ivar provisioning_state: The provisioning state. :vartype provisioning_state: str @@ -1464,15 +1599,16 @@ def __init__( scope: Optional[str] = None, public_network_solution: Optional["_models.PublicNetworkSolution"] = None, configuration_info: Optional["_models.ConfigurationInfo"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword target_service: The target service properties. :paramtype target_service: ~azure.mgmt.servicelinker.models.TargetServiceBase :keyword auth_info: The authentication type. :paramtype auth_info: ~azure.mgmt.servicelinker.models.AuthInfoBase :keyword client_type: The application client type. Known values are: "none", "dotnet", "java", - "python", "go", "php", "ruby", "django", "nodejs", "springBoot", and "kafka-springBoot". + "python", "go", "php", "ruby", "django", "nodejs", "springBoot", "kafka-springBoot", and + "dapr". :paramtype client_type: str or ~azure.mgmt.servicelinker.models.ClientType :keyword v_net_solution: The VNet solution. :paramtype v_net_solution: ~azure.mgmt.servicelinker.models.VNetSolution @@ -1535,7 +1671,7 @@ class Operation(_serialization.Model): "action_type": {"key": "actionType", "type": "str"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs): + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ :keyword display: Localized display information for this particular operation. :paramtype display: ~azure.mgmt.servicelinker.models.OperationDisplay @@ -1581,7 +1717,7 @@ class OperationDisplay(_serialization.Model): "description": {"key": "description", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.provider = None @@ -1591,7 +1727,8 @@ def __init__(self, **kwargs): class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. @@ -1611,7 +1748,7 @@ class OperationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None @@ -1651,8 +1788,8 @@ def __init__( scope: Optional[str] = None, permissions: Optional[List[str]] = None, recommended_role: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword scope: The permission scope. :paramtype scope: str @@ -1697,8 +1834,8 @@ def __init__( delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, action: Optional[Union[str, "_models.ActionType"]] = None, firewall_rules: Optional["_models.FirewallRules"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword delete_or_update_behavior: Indicates whether to clean up previous operation(such as firewall rules) when Linker is updating or deleting. Known values are: "Default" and @@ -1734,8 +1871,8 @@ class ResourceList(_serialization.Model): } def __init__( - self, *, next_link: Optional[str] = None, value: Optional[List["_models.LinkerResource"]] = None, **kwargs - ): + self, *, next_link: Optional[str] = None, value: Optional[List["_models.LinkerResource"]] = None, **kwargs: Any + ) -> None: """ :keyword next_link: The Linker used to get the next page of Linker list. :paramtype next_link: str @@ -1772,7 +1909,9 @@ class SecretAuthInfo(AuthInfoBase): "secret_info": {"key": "secretInfo", "type": "SecretInfoBase"}, } - def __init__(self, *, name: Optional[str] = None, secret_info: Optional["_models.SecretInfoBase"] = None, **kwargs): + def __init__( + self, *, name: Optional[str] = None, secret_info: Optional["_models.SecretInfoBase"] = None, **kwargs: Any + ) -> None: """ :keyword name: Username or account name for secret auth. :paramtype name: str @@ -1800,7 +1939,9 @@ class SecretStore(_serialization.Model): "key_vault_secret_name": {"key": "keyVaultSecretName", "type": "str"}, } - def __init__(self, *, key_vault_id: Optional[str] = None, key_vault_secret_name: Optional[str] = None, **kwargs): + def __init__( + self, *, key_vault_id: Optional[str] = None, key_vault_secret_name: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword key_vault_id: The key vault id to store secret. :paramtype key_vault_id: str @@ -1834,7 +1975,7 @@ class SelfHostedServer(TargetServiceBase): "endpoint": {"key": "endpoint", "type": "str"}, } - def __init__(self, *, endpoint: Optional[str] = None, **kwargs): + def __init__(self, *, endpoint: Optional[str] = None, **kwargs: Any) -> None: """ :keyword endpoint: The endpoint of service. :paramtype endpoint: str @@ -1891,8 +2032,8 @@ def __init__( certificate: str, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, roles: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword client_id: Application clientId for servicePrincipal auth. Required. :paramtype client_id: str @@ -1967,8 +2108,8 @@ def __init__( user_name: Optional[str] = None, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, roles: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: Username created in the database which is mapped to a user in AAD. :paramtype user_name: str @@ -2009,7 +2150,7 @@ class SourceConfiguration(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of setting. :paramtype name: str @@ -2057,8 +2198,8 @@ def __init__( user_name: Optional[str] = None, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, roles: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: Username created in the database which is mapped to a user in AAD. :paramtype user_name: str @@ -2113,8 +2254,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -2180,8 +2321,8 @@ def __init__( principal_id: Optional[str] = None, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, roles: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: Username created in the database which is mapped to a user in AAD. :paramtype user_name: str @@ -2246,8 +2387,8 @@ def __init__( subscription_id: Optional[str] = None, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, roles: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword user_name: Username created in the database which is mapped to a user in AAD. :paramtype user_name: str @@ -2325,8 +2466,8 @@ def __init__( target_id: Optional[str] = None, auth_type: Optional[Union[str, "_models.AuthType"]] = None, validation_detail: Optional[List["_models.ValidationResultItem"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_id: Validated Linker id. :paramtype resource_id: str @@ -2396,8 +2537,8 @@ def __init__( result: Optional[Union[str, "_models.ValidationResultStatus"]] = None, error_message: Optional[str] = None, error_code: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The validation item name. :paramtype name: str @@ -2440,7 +2581,7 @@ class ValueSecretInfo(SecretInfoBase): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: The actual value of the secret. :paramtype value: str @@ -2471,8 +2612,8 @@ def __init__( *, type: Optional[Union[str, "_models.VNetSolutionType"]] = None, delete_or_update_behavior: Optional[Union[str, "_models.DeleteOrUpdateBehavior"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: Type of VNet solution. Known values are: "serviceEndpoint" and "privateLink". :paramtype type: str or ~azure.mgmt.servicelinker.models.VNetSolutionType diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py index ae45bc931eaa2..c3b613611b7bd 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/models/_service_linker_management_client_enums.py @@ -67,6 +67,7 @@ class ClientType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NODEJS = "nodejs" SPRING_BOOT = "springBoot" KAFKA_SPRING_BOOT = "kafka-springBoot" + DAPR = "dapr" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_configuration_names_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_configuration_names_operations.py index 5faa1ebc6879a..e32ac7d1fe9bb 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_configuration_names_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_configuration_names_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +40,7 @@ def build_list_request(*, filter: Optional[str] = None, skip_token: Optional[str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,9 +98,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationNameResult] = kwargs.pop("cls", None) error_map = { @@ -160,8 +151,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_connector_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_connector_operations.py index fc79258dcc265..e485666ffaba2 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_connector_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_connector_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +45,7 @@ def build_list_dryrun_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +61,7 @@ def build_list_dryrun_request( "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,9 +78,7 @@ def build_get_dryrun_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +95,7 @@ def build_get_dryrun_request( "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -120,9 +112,7 @@ def build_create_dryrun_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,7 +130,7 @@ def build_create_dryrun_request( "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,9 +149,7 @@ def build_update_dryrun_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -179,7 +167,7 @@ def build_update_dryrun_request( "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -198,9 +186,7 @@ def build_delete_dryrun_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -217,7 +203,7 @@ def build_delete_dryrun_request( "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -232,9 +218,7 @@ def build_list_request(subscription_id: str, resource_group_name: str, location: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -250,7 +234,7 @@ def build_list_request(subscription_id: str, resource_group_name: str, location: "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,9 +251,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +268,7 @@ def build_get_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -303,9 +285,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -323,7 +303,7 @@ def build_create_or_update_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -342,9 +322,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -361,7 +339,7 @@ def build_delete_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -378,9 +356,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -398,7 +374,7 @@ def build_update_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -417,9 +393,7 @@ def build_validate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -436,7 +410,7 @@ def build_validate_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -453,9 +427,7 @@ def build_generate_configurations_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -473,7 +445,7 @@ def build_generate_configurations_request( "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -526,9 +498,7 @@ def list_dryrun( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunList] = kwargs.pop("cls", None) error_map = { @@ -582,8 +552,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -631,9 +602,7 @@ def get_dryrun( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) request = build_get_dryrun_request( @@ -649,8 +618,9 @@ def get_dryrun( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -691,16 +661,14 @@ def _create_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunResource") @@ -721,8 +689,9 @@ def _create_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -852,7 +821,7 @@ def begin_create_dryrun( :type location: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -873,9 +842,7 @@ def begin_create_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -944,16 +911,14 @@ def _update_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DryrunResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunPatch") @@ -974,8 +939,9 @@ def _update_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1103,7 +1069,7 @@ def begin_update_dryrun( :type location: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1124,9 +1090,7 @@ def begin_update_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1206,9 +1170,7 @@ def delete_dryrun( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dryrun_request( @@ -1224,8 +1186,9 @@ def delete_dryrun( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1264,9 +1227,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceList] = kwargs.pop("cls", None) error_map = { @@ -1320,8 +1281,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1369,9 +1331,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) request = build_get_request( @@ -1387,8 +1347,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1429,16 +1390,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerResource") @@ -1459,8 +1418,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1590,7 +1550,7 @@ def begin_create_or_update( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connector details. Is either a model type or a IO type. Required. + :param parameters: Connector details. Is either a LinkerResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1611,9 +1571,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1676,9 +1634,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1694,8 +1650,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1742,9 +1699,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1808,16 +1763,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerPatch") @@ -1838,8 +1791,9 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1969,7 +1923,7 @@ def begin_update( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connector details. Is either a model type or a IO type. Required. + :param parameters: Connector details. Is either a LinkerPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1990,9 +1944,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2055,9 +2007,7 @@ def _validate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.ValidateOperationResult]] = kwargs.pop("cls", None) request = build_validate_request( @@ -2073,8 +2023,9 @@ def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -2128,9 +2079,7 @@ def begin_validate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ValidateOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2265,8 +2214,8 @@ def generate_configurations( :type location: str :param connector_name: The name of resource. Required. :type connector_name: str - :param parameters: Connection Info, including format, secret store, etc. Is either a model type - or a IO type. Default value is None. + :param parameters: Connection Info, including format, secret store, etc. Is either a + ConfigurationInfo type or a IO type. Default value is None. :type parameters: ~azure.mgmt.servicelinker.models.ConfigurationInfo or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -2287,16 +2236,14 @@ def generate_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: if parameters is not None: @@ -2320,8 +2267,9 @@ def generate_configurations( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py index 614b13d06c667..aa9770f3aadd6 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linker_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +43,7 @@ def build_list_request(resource_uri: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +52,7 @@ def build_list_request(resource_uri: str, **kwargs: Any) -> HttpRequest: "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +67,7 @@ def build_get_request(resource_uri: str, linker_name: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +77,7 @@ def build_get_request(resource_uri: str, linker_name: str, **kwargs: Any) -> Htt "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,9 +92,7 @@ def build_create_or_update_request(resource_uri: str, linker_name: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -113,7 +103,7 @@ def build_create_or_update_request(resource_uri: str, linker_name: str, **kwargs "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,9 +120,7 @@ def build_delete_request(resource_uri: str, linker_name: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +130,7 @@ def build_delete_request(resource_uri: str, linker_name: str, **kwargs: Any) -> "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,9 +145,7 @@ def build_update_request(resource_uri: str, linker_name: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,7 +156,7 @@ def build_update_request(resource_uri: str, linker_name: str, **kwargs: Any) -> "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,9 +173,7 @@ def build_validate_request(resource_uri: str, linker_name: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -201,7 +185,7 @@ def build_validate_request(resource_uri: str, linker_name: str, **kwargs: Any) - "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,9 +200,7 @@ def build_list_configurations_request(resource_uri: str, linker_name: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +212,7 @@ def build_list_configurations_request(resource_uri: str, linker_name: str, **kwa "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,9 +258,7 @@ def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.LinkerReso _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ResourceList] = kwargs.pop("cls", None) error_map = { @@ -330,8 +310,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -371,9 +352,7 @@ def get(self, resource_uri: str, linker_name: str, **kwargs: Any) -> _models.Lin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) request = build_get_request( @@ -387,8 +366,9 @@ def get(self, resource_uri: str, linker_name: str, **kwargs: Any) -> _models.Lin request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -421,16 +401,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerResource") @@ -449,8 +427,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -558,7 +537,7 @@ def begin_create_or_update( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Linker details. Is either a model type or a IO type. Required. + :param parameters: Linker details. Is either a LinkerResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -579,9 +558,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -640,9 +617,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -656,8 +631,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -696,9 +672,7 @@ def begin_delete(self, resource_uri: str, linker_name: str, **kwargs: Any) -> LR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -752,16 +726,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LinkerPatch") @@ -780,8 +752,9 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -887,7 +860,7 @@ def begin_update( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Linker details. Is either a model type or a IO type. Required. + :param parameters: Linker details. Is either a LinkerPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.LinkerPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -908,9 +881,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkerResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -969,9 +940,7 @@ def _validate_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.ValidateOperationResult]] = kwargs.pop("cls", None) request = build_validate_request( @@ -985,8 +954,9 @@ def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1036,9 +1006,7 @@ def begin_validate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ValidateOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1107,9 +1075,7 @@ def list_configurations(self, resource_uri: str, linker_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) request = build_list_configurations_request( @@ -1123,8 +1089,9 @@ def list_configurations(self, resource_uri: str, linker_name: str, **kwargs: Any request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linkers_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linkers_operations.py index fec0c2e128d4a..6e0842aaa6d44 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linkers_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_linkers_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -30,12 +30,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +43,7 @@ def build_list_dryrun_request(resource_uri: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +52,7 @@ def build_list_dryrun_request(resource_uri: str, **kwargs: Any) -> HttpRequest: "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +67,7 @@ def build_get_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +77,7 @@ def build_get_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: Any) "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,9 +92,7 @@ def build_create_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -113,7 +103,7 @@ def build_create_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,9 +120,7 @@ def build_update_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,7 +131,7 @@ def build_update_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -160,9 +148,7 @@ def build_delete_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +158,7 @@ def build_delete_dryrun_request(resource_uri: str, dryrun_name: str, **kwargs: A "dryrunName": _SERIALIZER.url("dryrun_name", dryrun_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,9 +173,7 @@ def build_generate_configurations_request(resource_uri: str, linker_name: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,7 +186,7 @@ def build_generate_configurations_request(resource_uri: str, linker_name: str, * "linkerName": _SERIALIZER.url("linker_name", linker_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -249,9 +233,7 @@ def list_dryrun(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.Dry _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunList] = kwargs.pop("cls", None) error_map = { @@ -303,8 +285,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -344,9 +327,7 @@ def get_dryrun(self, resource_uri: str, dryrun_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) request = build_get_dryrun_request( @@ -360,8 +341,9 @@ def get_dryrun(self, resource_uri: str, dryrun_name: str, **kwargs: Any) -> _mod request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -394,16 +376,14 @@ def _create_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunResource") @@ -422,8 +402,9 @@ def _create_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -529,7 +510,7 @@ def begin_create_dryrun( :type resource_uri: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunResource type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunResource or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -550,9 +531,7 @@ def begin_create_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -611,16 +590,14 @@ def _update_dryrun_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DryrunResource]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DryrunPatch") @@ -639,8 +616,9 @@ def _update_dryrun_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -744,7 +722,7 @@ def begin_update_dryrun( :type resource_uri: str :param dryrun_name: The name of dryrun. Required. :type dryrun_name: str - :param parameters: dryrun resource. Is either a model type or a IO type. Required. + :param parameters: dryrun resource. Is either a DryrunPatch type or a IO type. Required. :type parameters: ~azure.mgmt.servicelinker.models.DryrunPatch or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -765,9 +743,7 @@ def begin_update_dryrun( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DryrunResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -839,9 +815,7 @@ def delete_dryrun( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_dryrun_request( @@ -855,8 +829,9 @@ def delete_dryrun( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -942,8 +917,8 @@ def generate_configurations( :type resource_uri: str :param linker_name: The name Linker resource. Required. :type linker_name: str - :param parameters: Connection Info, including format, secret store, etc. Is either a model type - or a IO type. Default value is None. + :param parameters: Connection Info, including format, secret store, etc. Is either a + ConfigurationInfo type or a IO type. Default value is None. :type parameters: ~azure.mgmt.servicelinker.models.ConfigurationInfo or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -964,16 +939,14 @@ def generate_configurations( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConfigurationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: if parameters is not None: @@ -995,8 +968,9 @@ def generate_configurations( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py index 3521a31d7e2e3..48de31a72ec10 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/azure/mgmt/servicelinker/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +86,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", self._config.api_version) - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -146,8 +137,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/connector_dryrun_delete.py b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/connector_dryrun_delete.py index 2c046d96e7060..641c299093840 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/connector_dryrun_delete.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/connector_dryrun_delete.py @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.connector.delete_dryrun( + client.connector.delete_dryrun( subscription_id="00000000-0000-0000-0000-000000000000", resource_group_name="test-rg", location="westus", dryrun_name="dryrunName", ) - print(response) # x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/ConnectorDryrunDelete.json diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_connector.py b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_connector.py index 811175603563b..2b2e051f0ef41 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_connector.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_connector.py @@ -28,13 +28,12 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.connector.begin_delete( + client.connector.begin_delete( subscription_id="00000000-0000-0000-0000-000000000000", resource_group_name="test-rg", location="westus", connector_name="connectorName", ).result() - print(response) # x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteConnector.json diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_dryrun.py b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_dryrun.py index 800955ff63428..3f7ff9ac68bbc 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_dryrun.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_dryrun.py @@ -28,11 +28,10 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.linkers.delete_dryrun( + client.linkers.delete_dryrun( resource_uri="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", dryrun_name="dryrunName", ) - print(response) # x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteDryrun.json diff --git a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_linker.py b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_linker.py index e91d30ca6f6e4..f49a640f0396d 100644 --- a/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_linker.py +++ b/sdk/servicelinker/azure-mgmt-servicelinker/generated_samples/delete_linker.py @@ -28,11 +28,10 @@ def main(): credential=DefaultAzureCredential(), ) - response = client.linker.begin_delete( + client.linker.begin_delete( resource_uri="subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", linker_name="linkName", ).result() - print(response) # x-ms-original-file: specification/servicelinker/resource-manager/Microsoft.ServiceLinker/preview/2022-11-01-preview/examples/DeleteLinker.json