Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 3178 in test-repo-billy/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge a6a9641645aebb119ecfe93a7cd7575e6f51ef40 into 67f4b5ff52fd6a0f6a4bfae872b3f16b31c25362
SDKAuto committed Jan 3, 2024
1 parent e56a49c commit 863c47f
Showing 25 changed files with 631 additions and 673 deletions.
12 changes: 6 additions & 6 deletions sdk/servicelinker/azure-mgmt-servicelinker/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "279924e2cefe36a86703fd85a91679f6dfc067fc",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"commit": "4cc63633e357147a812987e57ee6a0ded38cd8ba",
"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"
}
Original file line number Diff line number Diff line change
@@ -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.")
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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.")
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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",

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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):
Original file line number Diff line number Diff line change
@@ -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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 863c47f

Please sign in to comment.