Skip to content

Commit 07e7bb0

Browse files
author
SDKAuto
committed
CodeGen from PR 30935 in Azure/azure-rest-api-specs
Merge f8dd5ca62b523a170387c4254e268e2e39e5127d into 59f7381be37e16ae2777339cdaf3fa2f88a6411d
1 parent 3a2303a commit 07e7bb0

File tree

123 files changed

+1002
-1195
lines changed

Some content is hidden

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

123 files changed

+1002
-1195
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "2608e811fafd18657b224a0d59e1c3924a534adb",
2+
"commit": "18eb4e3fc32b8a4ca3c2ff8a2dee72e179bdb6c2",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.15.0",
6+
"@autorest/python@6.19.0",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/keyvault/resource-manager/readme.md --generate-sample=True --generate-test=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.15.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/keyvault/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.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/keyvault/resource-manager/readme.md",
1111
"package-2019-09": "2021-07-15 01:23:27 -0700 4fe5435a25386ee460ba89817465c7deba818284 Microsoft.KeyVault/stable/2019-09-01/keyvault.json",
1212
"package-2018-02": "2020-11-03 15:27:00 -0500 111dab2fbec96b208a78b36bb8dcefd958036476 Microsoft.KeyVault/preview/2018-02-14-preview/keyvault.json",
@@ -17,5 +17,5 @@
1717
"package-2021-10": "2023-04-10 18:34:42 -0700 33f06ff82a4c751bcbc842b7ed4da2e81b0717b6 Microsoft.KeyVault/stable/2021-10-01/managedHsm.json",
1818
"package-2022-07": "2023-09-13 16:38:17 -0700 5dd1107d5f2be8d600325d795450e1d854fbe7e8 Microsoft.KeyVault/stable/2022-07-01/keys.json",
1919
"package-2023-02": "2023-09-13 16:38:17 -0700 5dd1107d5f2be8d600325d795450e1d854fbe7e8 Microsoft.KeyVault/stable/2023-02-01/keysManagedHsm.json",
20-
"package-2023-07": "2023-10-12 19:27:13 +0100 b594fd4145904c9bbd018f4a2ddea75c7134aee7 Microsoft.KeyVault/stable/2023-07-01/secrets.json"
20+
"package-2023-07": "2024-10-09 18:02:39 +0000 f8dd5ca62b523a170387c4254e268e2e39e5127d Microsoft.KeyVault/stable/2023-07-01/keys.json"
2121
}

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_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 = "10.3.1"
9+
VERSION = "1.0.0b1"

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
else:
3939
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4040

41+
4142
class VaultsOperations(_VaultsOperations):
4243

4344
@distributed_trace
@@ -57,9 +58,7 @@ def list(self, top: Optional[int] = None, **kwargs: Any) -> AsyncIterable["_mode
5758
filter: Literal["resourceType eq 'Microsoft.KeyVault/vaults'"] = kwargs.pop(
5859
"filter", _params.pop("$filter", "resourceType eq 'Microsoft.KeyVault/vaults'")
5960
)
60-
api_version: Literal["2015-11-01"] = kwargs.pop(
61-
"api_version", _params.pop("api-version", "2015-11-01")
62-
)
61+
api_version: Literal["2015-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-11-01"))
6362
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
6463

6564
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -124,6 +123,7 @@ async def get_next(next_link=None):
124123

125124
return AsyncItemPaged(get_next, extract_data)
126125

126+
127127
__all__: List[str] = ["VaultsOperations"] # Add all objects you want publicly available to users at this package level
128128

129129

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/aio/operations/_vaults_operations.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
ResourceExistsError,
3333
ResourceNotFoundError,
3434
ResourceNotModifiedError,
35+
StreamClosedError,
36+
StreamConsumedError,
3537
map_error,
3638
)
3739
from azure.core.pipeline import PipelineResponse
@@ -211,11 +213,7 @@ async def create_or_update(
211213
map_error(status_code=response.status_code, response=response, error_map=error_map)
212214
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
213215

214-
if response.status_code == 200:
215-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
216-
217-
if response.status_code == 201:
218-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
216+
deserialized = self._deserialize("Vault", pipeline_response.http_response)
219217

220218
if cls:
221219
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -345,11 +343,7 @@ async def update(
345343
map_error(status_code=response.status_code, response=response, error_map=error_map)
346344
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
347345

348-
if response.status_code == 200:
349-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
350-
351-
if response.status_code == 201:
352-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
346+
deserialized = self._deserialize("Vault", pipeline_response.http_response)
353347

354348
if cls:
355349
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -601,11 +595,7 @@ async def update_access_policy(
601595
map_error(status_code=response.status_code, response=response, error_map=error_map)
602596
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
603597

604-
if response.status_code == 200:
605-
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
606-
607-
if response.status_code == 201:
608-
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
598+
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
609599

610600
if cls:
611601
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -927,6 +917,7 @@ async def _purge_deleted_initial(self, vault_name: str, location: str, **kwargs:
927917
)
928918
_request.url = self._client.format_url(_request.url)
929919

920+
_decompress = kwargs.pop("decompress", True)
930921
_stream = True
931922
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
932923
_request, stream=_stream, **kwargs
@@ -935,15 +926,14 @@ async def _purge_deleted_initial(self, vault_name: str, location: str, **kwargs:
935926
response = pipeline_response.http_response
936927

937928
if response.status_code not in [200, 202]:
938-
await response.read() # Load the body in memory and close the socket
929+
try:
930+
await response.read() # Load the body in memory and close the socket
931+
except (StreamConsumedError, StreamClosedError):
932+
pass
939933
map_error(status_code=response.status_code, response=response, error_map=error_map)
940934
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
941935

942-
if response.status_code == 200:
943-
deserialized = response.stream_download(self._client._pipeline)
944-
945-
if response.status_code == 202:
946-
deserialized = response.stream_download(self._client._pipeline)
936+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
947937

948938
if cls:
949939
return cls(pipeline_response, deserialized, {}) # type: ignore

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_patch.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
else:
3838
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
3939

40+
4041
class VaultsOperations(_VaultsOperations):
4142
@distributed_trace
4243
def list(self, top: Optional[int] = None, **kwargs: Any) -> Iterable["_models.Resource"]:
@@ -54,9 +55,7 @@ def list(self, top: Optional[int] = None, **kwargs: Any) -> Iterable["_models.Re
5455
filter: Literal["resourceType eq 'Microsoft.KeyVault/vaults'"] = kwargs.pop(
5556
"filter", _params.pop("$filter", "resourceType eq 'Microsoft.KeyVault/vaults'")
5657
)
57-
api_version: Literal["2015-11-01"] = kwargs.pop(
58-
"api_version", _params.pop("api-version", "2015-11-01")
59-
)
58+
api_version: Literal["2015-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-11-01"))
6059
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
6160

6261
error_map: MutableMapping[int, Type[HttpResponseError]] = {

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2016_10_01/operations/_vaults_operations.py

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
ResourceExistsError,
1818
ResourceNotFoundError,
1919
ResourceNotModifiedError,
20+
StreamClosedError,
21+
StreamConsumedError,
2022
map_error,
2123
)
2224
from azure.core.paging import ItemPaged
@@ -538,11 +540,7 @@ def create_or_update(
538540
map_error(status_code=response.status_code, response=response, error_map=error_map)
539541
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
540542

541-
if response.status_code == 200:
542-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
543-
544-
if response.status_code == 201:
545-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
543+
deserialized = self._deserialize("Vault", pipeline_response.http_response)
546544

547545
if cls:
548546
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -672,11 +670,7 @@ def update(
672670
map_error(status_code=response.status_code, response=response, error_map=error_map)
673671
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
674672

675-
if response.status_code == 200:
676-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
677-
678-
if response.status_code == 201:
679-
deserialized = self._deserialize("Vault", pipeline_response.http_response)
673+
deserialized = self._deserialize("Vault", pipeline_response.http_response)
680674

681675
if cls:
682676
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -928,11 +922,7 @@ def update_access_policy(
928922
map_error(status_code=response.status_code, response=response, error_map=error_map)
929923
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
930924

931-
if response.status_code == 200:
932-
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
933-
934-
if response.status_code == 201:
935-
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
925+
deserialized = self._deserialize("VaultAccessPolicyParameters", pipeline_response.http_response)
936926

937927
if cls:
938928
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1253,6 +1243,7 @@ def _purge_deleted_initial(self, vault_name: str, location: str, **kwargs: Any)
12531243
)
12541244
_request.url = self._client.format_url(_request.url)
12551245

1246+
_decompress = kwargs.pop("decompress", True)
12561247
_stream = True
12571248
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
12581249
_request, stream=_stream, **kwargs
@@ -1261,15 +1252,14 @@ def _purge_deleted_initial(self, vault_name: str, location: str, **kwargs: Any)
12611252
response = pipeline_response.http_response
12621253

12631254
if response.status_code not in [200, 202]:
1264-
response.read() # Load the body in memory and close the socket
1255+
try:
1256+
response.read() # Load the body in memory and close the socket
1257+
except (StreamConsumedError, StreamClosedError):
1258+
pass
12651259
map_error(status_code=response.status_code, response=response, error_map=error_map)
12661260
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
12671261

1268-
if response.status_code == 200:
1269-
deserialized = response.stream_download(self._client._pipeline)
1270-
1271-
if response.status_code == 202:
1272-
deserialized = response.stream_download(self._client._pipeline)
1262+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
12731263

12741264
if cls:
12751265
return cls(pipeline_response, deserialized, {}) # type: ignore

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/_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 = "10.3.1"
9+
VERSION = "1.0.0b1"

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/aio/operations/_patch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
else:
3939
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4040

41+
4142
class VaultsOperations(_VaultsOperations):
4243

4344
@distributed_trace
@@ -57,9 +58,7 @@ def list(self, top: Optional[int] = None, **kwargs: Any) -> AsyncIterable["_mode
5758
filter: Literal["resourceType eq 'Microsoft.KeyVault/vaults'"] = kwargs.pop(
5859
"filter", _params.pop("$filter", "resourceType eq 'Microsoft.KeyVault/vaults'")
5960
)
60-
api_version: Literal["2015-11-01"] = kwargs.pop(
61-
"api_version", _params.pop("api-version", "2015-11-01")
62-
)
61+
api_version: Literal["2015-11-01"] = kwargs.pop("api_version", _params.pop("api-version", "2015-11-01"))
6362
cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None)
6463

6564
error_map: MutableMapping[int, Type[HttpResponseError]] = {
@@ -124,6 +123,7 @@ async def get_next(next_link=None):
124123

125124
return AsyncItemPaged(get_next, extract_data)
126125

126+
127127
__all__: List[str] = ["VaultsOperations"] # Add all objects you want publicly available to users at this package level
128128

129129

sdk/keyvault/azure-mgmt-keyvault/azure/mgmt/keyvault/v2018_02_14/aio/operations/_private_endpoint_connections_operations.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
ResourceExistsError,
1717
ResourceNotFoundError,
1818
ResourceNotModifiedError,
19+
StreamClosedError,
20+
StreamConsumedError,
1921
map_error,
2022
)
2123
from azure.core.pipeline import PipelineResponse
@@ -296,6 +298,7 @@ async def _delete_initial(
296298
)
297299
_request.url = self._client.format_url(_request.url)
298300

301+
_decompress = kwargs.pop("decompress", True)
299302
_stream = True
300303
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
301304
_request, stream=_stream, **kwargs
@@ -304,22 +307,19 @@ async def _delete_initial(
304307
response = pipeline_response.http_response
305308

306309
if response.status_code not in [200, 202, 204]:
307-
await response.read() # Load the body in memory and close the socket
310+
try:
311+
await response.read() # Load the body in memory and close the socket
312+
except (StreamConsumedError, StreamClosedError):
313+
pass
308314
map_error(status_code=response.status_code, response=response, error_map=error_map)
309315
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
310316

311317
response_headers = {}
312-
if response.status_code == 200:
313-
deserialized = response.stream_download(self._client._pipeline)
314-
315318
if response.status_code == 202:
316319
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
317320
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
318321

319-
deserialized = response.stream_download(self._client._pipeline)
320-
321-
if response.status_code == 204:
322-
deserialized = response.stream_download(self._client._pipeline)
322+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
323323

324324
if cls:
325325
return cls(pipeline_response, deserialized, response_headers) # type: ignore

0 commit comments

Comments
 (0)