Skip to content

Commit ef35c1a

Browse files
author
SDKAuto
committed
CodeGen from PR 29632 in Azure/azure-rest-api-specs
Merge dd6db5d55af63d67cf56908446455e4adbce9437 into e60f9d4c178ff898732a4d59cbc688bf6fa09c00
1 parent ab4deb4 commit ef35c1a

File tree

768 files changed

+8864
-7948
lines changed

Some content is hidden

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

768 files changed

+8864
-7948
lines changed

sdk/storage/azure-mgmt-storage/_meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "43f10d3b8bacd5fc6b01254b5050c613f26c3573",
2+
"commit": "ec9c838b461bf144ca50701539af3bbe225322b4",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.19",
6+
"@autorest/python@6.15.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/storage/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.13.19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/storage/resource-manager/readme.md --generate-sample=True --generate-test=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.15.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/storage/resource-manager/readme.md",
1111
"package-2023-01": "2023-07-20 11:56:40 -0700 3e6b4ddca225530c27273d0f816466a905c0151b Microsoft.Storage/stable/2023-01-01/table.json",
1212
"package-2022-09": "2022-11-13 19:43:16 -0800 da0cfefaa0e6c237e1e3819f1cb2e11d7606878d Microsoft.Storage/stable/2022-09-01/table.json",
@@ -29,5 +29,5 @@
2929
"package-2016-12": "2020-05-21 10:20:08 +0200 db0f437ba79086e20570d648fe932c4266e7a7ed Microsoft.Storage/stable/2016-12-01/storage.json",
3030
"package-2016-01": "2019-06-26 12:38:19 -0400 26df0a691d94445b2c96d348f5ecc31f6f9a2099 Microsoft.Storage/stable/2016-01-01/storage.json",
3131
"package-2015-06": "2019-06-26 12:38:19 -0400 26df0a691d94445b2c96d348f5ecc31f6f9a2099 Microsoft.Storage/stable/2015-06-15/storage.json",
32-
"package-2023-05": "2024-06-26 09:32:01 -0700 db377f47cf7bf53bf077aa42967112a9783980d5 Microsoft.Storage/stable/2023-05-01/storageTaskAssignments.json"
32+
"package-2023-05": "2024-07-15 15:46:10 +0530 1269d77727f88f5e293bd2691eba5b9ccdf26779 Microsoft.Storage/stable/2023-05-01/blob.json"
3333
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def _json_attemp(data):
144144
# context otherwise.
145145
_LOGGER.critical("Wasn't XML not JSON, failing")
146146
raise DeserializationError("XML is invalid") from err
147+
elif content_type.startswith("text/"):
148+
return data_as_str
147149
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
148150

149151
@classmethod

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/_storage_management_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from typing import Any, Optional, TYPE_CHECKING
13+
from typing_extensions import Self
1314

1415
from azure.core.pipeline import policies
1516
from azure.mgmt.core import ARMPipelineClient

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/aio/_storage_management_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from typing import Any, Optional, TYPE_CHECKING
13+
from typing_extensions import Self
1314

1415
from azure.core.pipeline import policies
1516
from azure.mgmt.core import AsyncARMPipelineClient

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"azure_arm": true,
1111
"has_public_lro_operations": true,
1212
"client_side_validation": false,
13-
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
14-
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
13+
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
14+
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"sdkcore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"AsyncARMAutoResourceProviderRegistrationPolicy\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}, \"stdlib\": {\"typing_extensions\": [\"Self\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
1515
},
1616
"global_parameters": {
1717
"sync": {

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_storage_management.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
@@ -107,7 +108,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
107108
def close(self) -> None:
108109
self._client.close()
109110

110-
def __enter__(self) -> "StorageManagement":
111+
def __enter__(self) -> Self:
111112
self._client.__enter__()
112113
return self
113114

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_vendor.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/_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 = "21.2.1"
9+
VERSION = "1.0.0b1"

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/_storage_management.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, Awaitable, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import AsyncHttpResponse, HttpRequest
@@ -110,7 +111,7 @@ def _send_request(
110111
async def close(self) -> None:
111112
await self._client.close()
112113

113-
async def __aenter__(self) -> "StorageManagement":
114+
async def __aenter__(self) -> Self:
114115
await self._client.__aenter__()
115116
return self
116117

sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2015_06_15/aio/operations/_storage_accounts_operations.py

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# --------------------------------------------------------------------------
99
from io import IOBase
1010
import sys
11-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
11+
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1212
import urllib.parse
1313

1414
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -21,17 +21,15 @@
2121
map_error,
2222
)
2323
from azure.core.pipeline import PipelineResponse
24-
from azure.core.pipeline.transport import AsyncHttpResponse
2524
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
26-
from azure.core.rest import HttpRequest
25+
from azure.core.rest import AsyncHttpResponse, HttpRequest
2726
from azure.core.tracing.decorator import distributed_trace
2827
from azure.core.tracing.decorator_async import distributed_trace_async
2928
from azure.core.utils import case_insensitive_dict
3029
from azure.mgmt.core.exceptions import ARMErrorFormat
3130
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
3231

3332
from ... import models as _models
34-
from ..._vendor import _convert_request
3533
from ...operations._storage_accounts_operations import (
3634
build_check_name_availability_request,
3735
build_create_request,
@@ -162,7 +160,6 @@ async def check_name_availability(
162160
headers=_headers,
163161
params=_params,
164162
)
165-
_request = _convert_request(_request)
166163
_request.url = self._client.format_url(_request.url)
167164

168165
_stream = False
@@ -176,7 +173,7 @@ async def check_name_availability(
176173
map_error(status_code=response.status_code, response=response, error_map=error_map)
177174
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
178175

179-
deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response)
176+
deserialized = self._deserialize("CheckNameAvailabilityResult", pipeline_response.http_response)
180177

181178
if cls:
182179
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -189,7 +186,7 @@ async def _create_initial(
189186
account_name: str,
190187
parameters: Union[_models.StorageAccountCreateParameters, IO[bytes]],
191188
**kwargs: Any
192-
) -> Optional[_models.StorageAccount]:
189+
) -> AsyncIterator[bytes]:
193190
error_map: MutableMapping[int, Type[HttpResponseError]] = {
194191
401: ClientAuthenticationError,
195192
404: ResourceNotFoundError,
@@ -203,7 +200,7 @@ async def _create_initial(
203200

204201
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-06-15"))
205202
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
206-
cls: ClsType[Optional[_models.StorageAccount]] = kwargs.pop("cls", None)
203+
cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
207204

208205
content_type = content_type or "application/json"
209206
_json = None
@@ -224,23 +221,25 @@ async def _create_initial(
224221
headers=_headers,
225222
params=_params,
226223
)
227-
_request = _convert_request(_request)
228224
_request.url = self._client.format_url(_request.url)
229225

230-
_stream = False
226+
_stream = True
231227
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
232228
_request, stream=_stream, **kwargs
233229
)
234230

235231
response = pipeline_response.http_response
236232

237233
if response.status_code not in [200, 202]:
234+
await response.read() # Load the body in memory and close the socket
238235
map_error(status_code=response.status_code, response=response, error_map=error_map)
239236
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
240237

241-
deserialized = None
242238
if response.status_code == 200:
243-
deserialized = self._deserialize("StorageAccount", pipeline_response)
239+
deserialized = response.stream_download(self._client._pipeline)
240+
241+
if response.status_code == 202:
242+
deserialized = response.stream_download(self._client._pipeline)
244243

245244
if cls:
246245
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -366,10 +365,11 @@ async def begin_create(
366365
params=_params,
367366
**kwargs
368367
)
368+
await raw_result.http_response.read() # type: ignore
369369
kwargs.pop("error_map", None)
370370

371371
def get_long_running_output(pipeline_response):
372-
deserialized = self._deserialize("StorageAccount", pipeline_response)
372+
deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
373373
if cls:
374374
return cls(pipeline_response, deserialized, {}) # type: ignore
375375
return deserialized
@@ -430,7 +430,6 @@ async def delete( # pylint: disable=inconsistent-return-statements
430430
headers=_headers,
431431
params=_params,
432432
)
433-
_request = _convert_request(_request)
434433
_request.url = self._client.format_url(_request.url)
435434

436435
_stream = False
@@ -488,7 +487,6 @@ async def get_properties(
488487
headers=_headers,
489488
params=_params,
490489
)
491-
_request = _convert_request(_request)
492490
_request.url = self._client.format_url(_request.url)
493491

494492
_stream = False
@@ -502,7 +500,7 @@ async def get_properties(
502500
map_error(status_code=response.status_code, response=response, error_map=error_map)
503501
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
504502

505-
deserialized = self._deserialize("StorageAccount", pipeline_response)
503+
deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
506504

507505
if cls:
508506
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -647,7 +645,6 @@ async def update(
647645
headers=_headers,
648646
params=_params,
649647
)
650-
_request = _convert_request(_request)
651648
_request.url = self._client.format_url(_request.url)
652649

653650
_stream = False
@@ -661,7 +658,7 @@ async def update(
661658
map_error(status_code=response.status_code, response=response, error_map=error_map)
662659
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
663660

664-
deserialized = self._deserialize("StorageAccount", pipeline_response)
661+
deserialized = self._deserialize("StorageAccount", pipeline_response.http_response)
665662

666663
if cls:
667664
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -701,7 +698,6 @@ def prepare_request(next_link=None):
701698
headers=_headers,
702699
params=_params,
703700
)
704-
_request = _convert_request(_request)
705701
_request.url = self._client.format_url(_request.url)
706702

707703
else:
@@ -717,7 +713,6 @@ def prepare_request(next_link=None):
717713
_request = HttpRequest(
718714
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
719715
)
720-
_request = _convert_request(_request)
721716
_request.url = self._client.format_url(_request.url)
722717
_request.method = "GET"
723718
return _request
@@ -785,7 +780,6 @@ def prepare_request(next_link=None):
785780
headers=_headers,
786781
params=_params,
787782
)
788-
_request = _convert_request(_request)
789783
_request.url = self._client.format_url(_request.url)
790784

791785
else:
@@ -801,7 +795,6 @@ def prepare_request(next_link=None):
801795
_request = HttpRequest(
802796
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
803797
)
804-
_request = _convert_request(_request)
805798
_request.url = self._client.format_url(_request.url)
806799
_request.method = "GET"
807800
return _request
@@ -867,7 +860,6 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs:
867860
headers=_headers,
868861
params=_params,
869862
)
870-
_request = _convert_request(_request)
871863
_request.url = self._client.format_url(_request.url)
872864

873865
_stream = False
@@ -881,7 +873,7 @@ async def list_keys(self, resource_group_name: str, account_name: str, **kwargs:
881873
map_error(status_code=response.status_code, response=response, error_map=error_map)
882874
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
883875

884-
deserialized = self._deserialize("StorageAccountKeys", pipeline_response)
876+
deserialized = self._deserialize("StorageAccountKeys", pipeline_response.http_response)
885877

886878
if cls:
887879
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1008,7 +1000,6 @@ async def regenerate_key(
10081000
headers=_headers,
10091001
params=_params,
10101002
)
1011-
_request = _convert_request(_request)
10121003
_request.url = self._client.format_url(_request.url)
10131004

10141005
_stream = False
@@ -1022,7 +1013,7 @@ async def regenerate_key(
10221013
map_error(status_code=response.status_code, response=response, error_map=error_map)
10231014
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
10241015

1025-
deserialized = self._deserialize("StorageAccountKeys", pipeline_response)
1016+
deserialized = self._deserialize("StorageAccountKeys", pipeline_response.http_response)
10261017

10271018
if cls:
10281019
return cls(pipeline_response, deserialized, {}) # type: ignore

0 commit comments

Comments
 (0)