Skip to content

Commit 8e75bda

Browse files
author
SDKAuto
committed
CodeGen from PR 23985 in Azure/azure-rest-api-specs
Merge 2add3c61680e0e7ec3de81cbf0ffdbd30fbd6b15 into 904e6604a3e616709510de199aeec63e3bb8b927
1 parent ec855c2 commit 8e75bda

File tree

76 files changed

+1868
-2324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1868
-2324
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "d70ba571ddb519a63aa2ad96a96faff04647f81c",
2+
"commit": "fd954ab01085498b191569ad18497ae56c7ca76a",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/[email protected].0",
6+
"@autorest/[email protected].12",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/datafactory/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/[email protected].0 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/datafactory/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/[email protected].12 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/datafactory/resource-manager/readme.md"
1111
}

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_configuration.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from ._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials import TokenCredential
@@ -42,7 +36,7 @@ class DataFactoryManagementClientConfiguration(Configuration): # pylint: disabl
4236

4337
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01")
39+
api_version: str = kwargs.pop("api_version", "2018-06-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_data_factory_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def __init__(
126126
self._config = DataFactoryManagementClientConfiguration(
127127
credential=credential, subscription_id=subscription_id, **kwargs
128128
)
129-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
129+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
130130

131131
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
132132
self._serialize = Serializer(client_models)

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_serialization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
629629
if xml_desc.get("attr", False):
630630
if xml_ns:
631631
ET.register_namespace(xml_prefix, xml_ns)
632-
xml_name = "{}{}".format(xml_ns, xml_name)
632+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
633633
serialized.set(xml_name, new_attr) # type: ignore
634634
continue
635635
if xml_desc.get("text", False):
@@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
12711271
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12721272
xml_ns = internal_type_xml_map.get("ns", None)
12731273
if xml_ns:
1274-
xml_name = "{}{}".format(xml_ns, xml_name)
1274+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12751275
return xml_name
12761276

12771277

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

13001300
# If it's an attribute, that's simple
13011301
if xml_desc.get("attr", False):

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "3.1.0"
9+
VERSION = "1.0.0"

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/_configuration.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from .._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials_async import AsyncTokenCredential
@@ -42,7 +36,7 @@ class DataFactoryManagementClientConfiguration(Configuration): # pylint: disabl
4236

4337
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
4438
super(DataFactoryManagementClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01")
39+
api_version: str = kwargs.pop("api_version", "2018-06-01")
4640

4741
if credential is None:
4842
raise ValueError("Parameter 'credential' must not be None.")

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/_data_factory_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(
127127
self._config = DataFactoryManagementClientConfiguration(
128128
credential=credential, subscription_id=subscription_id, **kwargs
129129
)
130-
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
130+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
131131

132132
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
133133
self._serialize = Serializer(client_models)

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_activity_runs_operations.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9-
import sys
9+
from io import IOBase
1010
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
1111

1212
from azure.core.exceptions import (
@@ -28,10 +28,6 @@
2828
from ..._vendor import _convert_request
2929
from ...operations._activity_runs_operations import build_query_by_pipeline_run_request
3030

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

@@ -154,16 +150,14 @@ async def query_by_pipeline_run(
154150
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
155151
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
156152

157-
api_version: Literal["2018-06-01"] = kwargs.pop(
158-
"api_version", _params.pop("api-version", self._config.api_version)
159-
)
153+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
160154
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
161155
cls: ClsType[_models.ActivityRunsQueryResponse] = kwargs.pop("cls", None)
162156

163157
content_type = content_type or "application/json"
164158
_json = None
165159
_content = None
166-
if isinstance(filter_parameters, (IO, bytes)):
160+
if isinstance(filter_parameters, (IOBase, bytes)):
167161
_content = filter_parameters
168162
else:
169163
_json = self._serialize.body(filter_parameters, "RunFilterParameters")
@@ -184,8 +178,9 @@ async def query_by_pipeline_run(
184178
request = _convert_request(request)
185179
request.url = self._client.format_url(request.url)
186180

181+
_stream = False
187182
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
188-
request, stream=False, **kwargs
183+
request, stream=_stream, **kwargs
189184
)
190185

191186
response = pipeline_response.http_response

sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_credential_operations_operations.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9-
import sys
9+
from io import IOBase
1010
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
1111
import urllib.parse
1212

@@ -36,10 +36,6 @@
3636
build_list_by_factory_request,
3737
)
3838

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

@@ -83,9 +79,7 @@ def list_by_factory(
8379
_headers = kwargs.pop("headers", {}) or {}
8480
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
8581

86-
api_version: Literal["2018-06-01"] = kwargs.pop(
87-
"api_version", _params.pop("api-version", self._config.api_version)
88-
)
82+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
8983
cls: ClsType[_models.CredentialListResponse] = kwargs.pop("cls", None)
9084

9185
error_map = {
@@ -139,8 +133,9 @@ async def extract_data(pipeline_response):
139133
async def get_next(next_link=None):
140134
request = prepare_request(next_link)
141135

136+
_stream = False
142137
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
143-
request, stream=False, **kwargs
138+
request, stream=_stream, **kwargs
144139
)
145140
response = pipeline_response.http_response
146141

@@ -267,16 +262,14 @@ async def create_or_update(
267262
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
268263
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
269264

270-
api_version: Literal["2018-06-01"] = kwargs.pop(
271-
"api_version", _params.pop("api-version", self._config.api_version)
272-
)
265+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
273266
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
274267
cls: ClsType[_models.ManagedIdentityCredentialResource] = kwargs.pop("cls", None)
275268

276269
content_type = content_type or "application/json"
277270
_json = None
278271
_content = None
279-
if isinstance(credential, (IO, bytes)):
272+
if isinstance(credential, (IOBase, bytes)):
280273
_content = credential
281274
else:
282275
_json = self._serialize.body(credential, "ManagedIdentityCredentialResource")
@@ -298,8 +291,9 @@ async def create_or_update(
298291
request = _convert_request(request)
299292
request.url = self._client.format_url(request.url)
300293

294+
_stream = False
301295
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
302-
request, stream=False, **kwargs
296+
request, stream=_stream, **kwargs
303297
)
304298

305299
response = pipeline_response.http_response
@@ -356,9 +350,7 @@ async def get(
356350
_headers = kwargs.pop("headers", {}) or {}
357351
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
358352

359-
api_version: Literal["2018-06-01"] = kwargs.pop(
360-
"api_version", _params.pop("api-version", self._config.api_version)
361-
)
353+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
362354
cls: ClsType[Optional[_models.ManagedIdentityCredentialResource]] = kwargs.pop("cls", None)
363355

364356
request = build_get_request(
@@ -375,8 +367,9 @@ async def get(
375367
request = _convert_request(request)
376368
request.url = self._client.format_url(request.url)
377369

370+
_stream = False
378371
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
379-
request, stream=False, **kwargs
372+
request, stream=_stream, **kwargs
380373
)
381374

382375
response = pipeline_response.http_response
@@ -426,9 +419,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
426419
_headers = kwargs.pop("headers", {}) or {}
427420
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
428421

429-
api_version: Literal["2018-06-01"] = kwargs.pop(
430-
"api_version", _params.pop("api-version", self._config.api_version)
431-
)
422+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
432423
cls: ClsType[None] = kwargs.pop("cls", None)
433424

434425
request = build_delete_request(
@@ -444,8 +435,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
444435
request = _convert_request(request)
445436
request.url = self._client.format_url(request.url)
446437

438+
_stream = False
447439
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
448-
request, stream=False, **kwargs
440+
request, stream=_stream, **kwargs
449441
)
450442

451443
response = pipeline_response.http_response

0 commit comments

Comments
 (0)