Skip to content

Commit 8502160

Browse files
author
SDKAuto
committed
CodeGen from PR 23332 in Azure/azure-rest-api-specs
Merge b538ac77676b072c5e517e06d67551744b814f88 into aceee26b40a3251a1dbcc76e57fb1e0860f1c76d
1 parent d2092ee commit 8502160

File tree

163 files changed

+1687
-1858
lines changed

Some content is hidden

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

163 files changed

+1687
-1858
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "c4eb7d4facbb9312f435df8c8ffe5061bfb02890",
2+
"commit": "296bf854973d97b1e509f36c894cee5fae7f2d62",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/python@6.4.0",
6+
"@autorest/python@6.4.6",
77
"@autorest/modelerfour@4.24.3"
88
],
9-
"autorest_command": "autorest specification/databox/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.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/databox/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.6 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/databox/resource-manager/readme.md"
1111
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
631631
if xml_desc.get("attr", False):
632632
if xml_ns:
633633
ET.register_namespace(xml_prefix, xml_ns)
634-
xml_name = "{}{}".format(xml_ns, xml_name)
634+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
635635
serialized.set(xml_name, new_attr) # type: ignore
636636
continue
637637
if xml_desc.get("text", False):
@@ -1273,7 +1273,7 @@ def _extract_name_from_internal_type(internal_type):
12731273
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
12741274
xml_ns = internal_type_xml_map.get("ns", None)
12751275
if xml_ns:
1276-
xml_name = "{}{}".format(xml_ns, xml_name)
1276+
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
12771277
return xml_name
12781278

12791279

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

13021302
# If it's an attribute, that's simple
13031303
if xml_desc.get("attr", False):
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
6-
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
76
# --------------------------------------------------------------------------
87

9-
VERSION = "2.0.0b1"
8+
VERSION = "0.1.0"

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_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 DataBoxManagementClientConfiguration(Configuration): # pylint: disable=to
4236

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

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

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_data_box_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
self._config = DataBoxManagementClientConfiguration(
5555
credential=credential, subscription_id=subscription_id, **kwargs
5656
)
57-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
57+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5858

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

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/_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 = "2.0.0b1"
9+
VERSION = "1.0.0b1"

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/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 DataBoxManagementClientConfiguration(Configuration): # pylint: disable=to
4236

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

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

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/_data_box_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(
5454
self._config = DataBoxManagementClientConfiguration(
5555
credential=credential, subscription_id=subscription_id, **kwargs
5656
)
57-
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
57+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
5858

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

sdk/databox/azure-mgmt-databox/azure/mgmt/databox/v2018_01_01/aio/operations/_jobs_operations.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
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
109
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
1110
import urllib.parse
1211

@@ -43,10 +42,6 @@
4342
build_update_request,
4443
)
4544

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

@@ -86,7 +81,7 @@ def list(self, skip_token: Optional[str] = None, **kwargs: Any) -> AsyncIterable
8681
_headers = kwargs.pop("headers", {}) or {}
8782
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
8883

89-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
84+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
9085
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
9186

9287
error_map = {
@@ -139,8 +134,9 @@ async def extract_data(pipeline_response):
139134
async def get_next(next_link=None):
140135
request = prepare_request(next_link)
141136

137+
_stream = False
142138
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
143-
request, stream=False, **kwargs
139+
request, stream=_stream, **kwargs
144140
)
145141
response = pipeline_response.http_response
146142

@@ -174,7 +170,7 @@ def list_by_resource_group(
174170
_headers = kwargs.pop("headers", {}) or {}
175171
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
176172

177-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
173+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
178174
cls: ClsType[_models.JobResourceList] = kwargs.pop("cls", None)
179175

180176
error_map = {
@@ -228,8 +224,9 @@ async def extract_data(pipeline_response):
228224
async def get_next(next_link=None):
229225
request = prepare_request(next_link)
230226

227+
_stream = False
231228
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
232-
request, stream=False, **kwargs
229+
request, stream=_stream, **kwargs
233230
)
234231
response = pipeline_response.http_response
235232

@@ -276,7 +273,7 @@ async def get(
276273
_headers = kwargs.pop("headers", {}) or {}
277274
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
278275

279-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
276+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
280277
cls: ClsType[_models.JobResource] = kwargs.pop("cls", None)
281278

282279
request = build_get_request(
@@ -292,8 +289,9 @@ async def get(
292289
request = _convert_request(request)
293290
request.url = self._client.format_url(request.url)
294291

292+
_stream = False
295293
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
296-
request, stream=False, **kwargs
294+
request, stream=_stream, **kwargs
297295
)
298296

299297
response = pipeline_response.http_response
@@ -327,7 +325,7 @@ async def _create_initial(
327325
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
328326
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
329327

330-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
328+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
331329
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
332330
cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None)
333331

@@ -354,8 +352,9 @@ async def _create_initial(
354352
request = _convert_request(request)
355353
request.url = self._client.format_url(request.url)
356354

355+
_stream = False
357356
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
358-
request, stream=False, **kwargs
357+
request, stream=_stream, **kwargs
359358
)
360359

361360
response = pipeline_response.http_response
@@ -488,7 +487,7 @@ async def begin_create(
488487
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
489488
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
490489

491-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
490+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
492491
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
493492
cls: ClsType[_models.JobResource] = kwargs.pop("cls", None)
494493
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
@@ -547,7 +546,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
547546
_headers = kwargs.pop("headers", {}) or {}
548547
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
549548

550-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
549+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
551550
cls: ClsType[None] = kwargs.pop("cls", None)
552551

553552
request = build_delete_request(
@@ -562,8 +561,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements
562561
request = _convert_request(request)
563562
request.url = self._client.format_url(request.url)
564563

564+
_stream = False
565565
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
566-
request, stream=False, **kwargs
566+
request, stream=_stream, **kwargs
567567
)
568568

569569
response = pipeline_response.http_response
@@ -604,7 +604,7 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs:
604604
_headers = kwargs.pop("headers", {}) or {}
605605
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
606606

607-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
607+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
608608
cls: ClsType[None] = kwargs.pop("cls", None)
609609
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
610610
lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
@@ -663,7 +663,7 @@ async def _update_initial(
663663
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
664664
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
665665

666-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
666+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
667667
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
668668
cls: ClsType[Optional[_models.JobResource]] = kwargs.pop("cls", None)
669669

@@ -691,8 +691,9 @@ async def _update_initial(
691691
request = _convert_request(request)
692692
request.url = self._client.format_url(request.url)
693693

694+
_stream = False
694695
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
695-
request, stream=False, **kwargs
696+
request, stream=_stream, **kwargs
696697
)
697698

698699
response = pipeline_response.http_response
@@ -840,7 +841,7 @@ async def begin_update(
840841
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
841842
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
842843

843-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
844+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
844845
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
845846
cls: ClsType[_models.JobResource] = kwargs.pop("cls", None)
846847
polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
@@ -983,7 +984,7 @@ async def book_shipment_pick_up(
983984
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
984985
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
985986

986-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
987+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
987988
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
988989
cls: ClsType[_models.ShipmentPickUpResponse] = kwargs.pop("cls", None)
989990

@@ -1010,8 +1011,9 @@ async def book_shipment_pick_up(
10101011
request = _convert_request(request)
10111012
request.url = self._client.format_url(request.url)
10121013

1014+
_stream = False
10131015
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1014-
request, stream=False, **kwargs
1016+
request, stream=_stream, **kwargs
10151017
)
10161018

10171019
response = pipeline_response.http_response
@@ -1127,7 +1129,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements
11271129
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
11281130
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
11291131

1130-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
1132+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
11311133
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
11321134
cls: ClsType[None] = kwargs.pop("cls", None)
11331135

@@ -1154,8 +1156,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements
11541156
request = _convert_request(request)
11551157
request.url = self._client.format_url(request.url)
11561158

1159+
_stream = False
11571160
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1158-
request, stream=False, **kwargs
1161+
request, stream=_stream, **kwargs
11591162
)
11601163

11611164
response = pipeline_response.http_response
@@ -1193,7 +1196,7 @@ def list_credentials(
11931196
_headers = kwargs.pop("headers", {}) or {}
11941197
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
11951198

1196-
api_version: Literal["2018-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
1199+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-01-01"))
11971200
cls: ClsType[_models.UnencryptedCredentialsList] = kwargs.pop("cls", None)
11981201

11991202
error_map = {
@@ -1247,8 +1250,9 @@ async def extract_data(pipeline_response):
12471250
async def get_next(next_link=None):
12481251
request = prepare_request(next_link)
12491252

1253+
_stream = False
12501254
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
1251-
request, stream=False, **kwargs
1255+
request, stream=_stream, **kwargs
12521256
)
12531257
response = pipeline_response.http_response
12541258

0 commit comments

Comments
 (0)