Skip to content

Commit

Permalink
CodeGen from PR 24089 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 76a8df20a7bc39fe25238a9a60fbc61b4eb747a4 into 3c2bb08d44536eecec0a8624587776a05692031c
  • Loading branch information
SDKAuto committed May 24, 2023
1 parent b8fecd9 commit 8f30b78
Show file tree
Hide file tree
Showing 194 changed files with 2,278 additions and 2,996 deletions.
6 changes: 3 additions & 3 deletions sdk/synapse/azure-mgmt-synapse/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "0e20dd2e4e2a40e83840c30cce2efc4847fd9cb9",
"commit": "ea1aafeb4bb84f1bc7bd235d305c269341b860fa",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.16",
"@autorest/python@6.4.12",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/synapse/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.16 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/synapse/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/synapse/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -629,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):
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name


Expand All @@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data):
# Integrate namespace if necessary
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)

# If it's an attribute, that's simple
if xml_desc.get("attr", False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __init__(
self._config = SynapseManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down Expand Up @@ -586,5 +586,5 @@ def __enter__(self) -> "SynapseManagementClient":
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
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.1.0b7"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def __init__(
self._config = SynapseManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand Down Expand Up @@ -590,5 +590,5 @@ async def __aenter__(self) -> "SynapseManagementClient":
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
Expand Up @@ -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

from azure.core.async_paging import AsyncItemPaged, AsyncList
Expand Down Expand Up @@ -36,10 +36,6 @@
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]]

Expand Down Expand Up @@ -99,7 +95,7 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
cls: ClsType[_models.AzureADOnlyAuthentication] = kwargs.pop("cls", None)

request = build_get_request(
Expand All @@ -115,8 +111,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
Expand Down Expand Up @@ -156,14 +153,14 @@ async def _create_initial(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[Optional[_models.AzureADOnlyAuthentication]] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(azure_ad_only_authentication_info, (IO, bytes)):
if isinstance(azure_ad_only_authentication_info, (IOBase, bytes)):
_content = azure_ad_only_authentication_info
else:
_json = self._serialize.body(azure_ad_only_authentication_info, "AzureADOnlyAuthentication")
Expand All @@ -184,8 +181,9 @@ async def _create_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
Expand Down Expand Up @@ -318,8 +316,8 @@ async def begin_create(
:param azure_ad_only_authentication_name: name of the property. "default" Required.
:type azure_ad_only_authentication_name: str or
~azure.mgmt.synapse.models.AzureADOnlyAuthenticationName
:param azure_ad_only_authentication_info: Azure Active Directory Property. Is either a model
type or a IO type. Required.
:param azure_ad_only_authentication_info: Azure Active Directory Property. Is either a
AzureADOnlyAuthentication type or a IO type. Required.
:type azure_ad_only_authentication_info: ~azure.mgmt.synapse.models.AzureADOnlyAuthentication
or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Expand All @@ -342,7 +340,7 @@ async def begin_create(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AzureADOnlyAuthentication] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
Expand Down Expand Up @@ -413,7 +411,7 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01"))
cls: ClsType[_models.AzureADOnlyAuthenticationListResult] = kwargs.pop("cls", None)

error_map = {
Expand Down Expand Up @@ -456,8 +454,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

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

from azure.core.async_paging import AsyncItemPaged, AsyncList
Expand Down Expand Up @@ -38,10 +38,6 @@
build_update_request,
)

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -96,9 +92,7 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
cls: ClsType[_models.BigDataPoolResourceInfo] = kwargs.pop("cls", None)

request = build_get_request(
Expand All @@ -114,8 +108,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
Expand Down Expand Up @@ -222,8 +217,8 @@ async def update(
:type workspace_name: str
:param big_data_pool_name: Big Data pool name. Required.
:type big_data_pool_name: str
:param big_data_pool_patch_info: The updated Big Data pool properties. Is either a model type
or a IO type. Required.
:param big_data_pool_patch_info: The updated Big Data pool properties. Is either a
BigDataPoolPatchInfo type or a IO type. Required.
:type big_data_pool_patch_info: ~azure.mgmt.synapse.models.BigDataPoolPatchInfo or IO
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
Default value is None.
Expand All @@ -244,16 +239,14 @@ async def update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.BigDataPoolResourceInfo] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(big_data_pool_patch_info, (IO, bytes)):
if isinstance(big_data_pool_patch_info, (IOBase, bytes)):
_content = big_data_pool_patch_info
else:
_json = self._serialize.body(big_data_pool_patch_info, "BigDataPoolPatchInfo")
Expand All @@ -274,8 +267,9 @@ async def update(
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
Expand Down Expand Up @@ -316,16 +310,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["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.BigDataPoolResourceInfo] = kwargs.pop("cls", None)

content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(big_data_pool_info, (IO, bytes)):
if isinstance(big_data_pool_info, (IOBase, bytes)):
_content = big_data_pool_info
else:
_json = self._serialize.body(big_data_pool_info, "BigDataPoolResourceInfo")
Expand All @@ -347,8 +339,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
Expand Down Expand Up @@ -482,8 +475,8 @@ async def begin_create_or_update(
:type workspace_name: str
:param big_data_pool_name: Big Data pool name. Required.
:type big_data_pool_name: str
:param big_data_pool_info: The Big Data pool to create. Is either a model type or a IO type.
Required.
:param big_data_pool_info: The Big Data pool to create. Is either a BigDataPoolResourceInfo
type or a IO type. Required.
:type big_data_pool_info: ~azure.mgmt.synapse.models.BigDataPoolResourceInfo or IO
:param force: Whether to stop any running jobs in the Big Data pool. Default value is False.
:type force: bool
Expand All @@ -506,9 +499,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["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.BigDataPoolResourceInfo] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
Expand Down Expand Up @@ -572,9 +563,7 @@ async def _delete_initial(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
cls: ClsType[Optional[_models.BigDataPoolResourceInfo]] = kwargs.pop("cls", None)

request = build_delete_request(
Expand All @@ -590,8 +579,9 @@ async def _delete_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
Expand Down Expand Up @@ -648,9 +638,7 @@ async def begin_delete(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
cls: ClsType[_models.BigDataPoolResourceInfo] = kwargs.pop("cls", None)
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
Expand Down Expand Up @@ -719,9 +707,7 @@ def list_by_workspace(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01-preview"))
cls: ClsType[_models.BigDataPoolResourceInfoListResult] = kwargs.pop("cls", None)

error_map = {
Expand Down Expand Up @@ -764,8 +750,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

Expand Down
Loading

0 comments on commit 8f30b78

Please sign in to comment.