Skip to content

Commit 76e753e

Browse files
author
SDKAuto
committed
CodeGen from PR 30980 in Azure/azure-rest-api-specs
Merge af08f354112856471cfb773eb9584a223720f282 into fcee3edac78a8afb8a402e4920c395998caf12fb
1 parent aa94cbe commit 76e753e

File tree

122 files changed

+1542
-1418
lines changed

Some content is hidden

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

122 files changed

+1542
-1418
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"commit": "b8bf9af0df9b688bf2de1eb0972810ac0e0b6185",
2+
"commit": "ae1d5690b2d8331c7a085d3452cfda2e9ea2e908",
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/eventhub/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/eventhub/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/eventhub/resource-manager/readme.md",
1111
"package-2024-01": "2024-04-17 10:03:55 -0700 bcb917a6cf4a1e47544a3acd36779cfbd58a9899 Microsoft.EventHub/stable/2024-01-01/eventhubs.json",
1212
"package-2021-11": "2022-11-29 14:20:04 +0530 d85953a9cb1b464824fae7c1fd300a99d086c8e4 Microsoft.EventHub/stable/2021-11-01/namespaces-preview.json",

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_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 = "11.1.0"
9+
VERSION = "1.0.0b1"

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/aio/operations/_namespaces_operations.py

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -374,6 +376,7 @@ async def _create_or_update_initial(
374376
)
375377
_request.url = self._client.format_url(_request.url)
376378

379+
_decompress = kwargs.pop("decompress", True)
377380
_stream = True
378381
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
379382
_request, stream=_stream, **kwargs
@@ -382,18 +385,14 @@ async def _create_or_update_initial(
382385
response = pipeline_response.http_response
383386

384387
if response.status_code not in [200, 201, 202]:
385-
await response.read() # Load the body in memory and close the socket
388+
try:
389+
await response.read() # Load the body in memory and close the socket
390+
except (StreamConsumedError, StreamClosedError):
391+
pass
386392
map_error(status_code=response.status_code, response=response, error_map=error_map)
387393
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
388394

389-
if response.status_code == 200:
390-
deserialized = response.stream_download(self._client._pipeline)
391-
392-
if response.status_code == 201:
393-
deserialized = response.stream_download(self._client._pipeline)
394-
395-
if response.status_code == 202:
396-
deserialized = response.stream_download(self._client._pipeline)
395+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
397396

398397
if cls:
399398
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -557,6 +556,7 @@ async def _delete_initial(
557556
)
558557
_request.url = self._client.format_url(_request.url)
559558

559+
_decompress = kwargs.pop("decompress", True)
560560
_stream = True
561561
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
562562
_request, stream=_stream, **kwargs
@@ -565,18 +565,14 @@ async def _delete_initial(
565565
response = pipeline_response.http_response
566566

567567
if response.status_code not in [200, 202, 204]:
568-
await response.read() # Load the body in memory and close the socket
568+
try:
569+
await response.read() # Load the body in memory and close the socket
570+
except (StreamConsumedError, StreamClosedError):
571+
pass
569572
map_error(status_code=response.status_code, response=response, error_map=error_map)
570573
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
571574

572-
if response.status_code == 200:
573-
deserialized = response.stream_download(self._client._pipeline)
574-
575-
if response.status_code == 202:
576-
deserialized = response.stream_download(self._client._pipeline)
577-
578-
if response.status_code == 204:
579-
deserialized = response.stream_download(self._client._pipeline)
575+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
580576

581577
if cls:
582578
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -683,11 +679,7 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any
683679
map_error(status_code=response.status_code, response=response, error_map=error_map)
684680
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
685681

686-
if response.status_code == 200:
687-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
688-
689-
if response.status_code == 201:
690-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
682+
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
691683

692684
if cls:
693685
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -818,11 +810,7 @@ async def update(
818810
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
819811

820812
deserialized = None
821-
if response.status_code == 200:
822-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
823-
824-
if response.status_code == 201:
825-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
813+
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
826814

827815
if cls:
828816
return cls(pipeline_response, deserialized, {}) # type: ignore

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2015_08_01/operations/_namespaces_operations.py

Lines changed: 16 additions & 28 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
@@ -786,6 +788,7 @@ def _create_or_update_initial(
786788
)
787789
_request.url = self._client.format_url(_request.url)
788790

791+
_decompress = kwargs.pop("decompress", True)
789792
_stream = True
790793
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
791794
_request, stream=_stream, **kwargs
@@ -794,18 +797,14 @@ def _create_or_update_initial(
794797
response = pipeline_response.http_response
795798

796799
if response.status_code not in [200, 201, 202]:
797-
response.read() # Load the body in memory and close the socket
800+
try:
801+
response.read() # Load the body in memory and close the socket
802+
except (StreamConsumedError, StreamClosedError):
803+
pass
798804
map_error(status_code=response.status_code, response=response, error_map=error_map)
799805
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
800806

801-
if response.status_code == 200:
802-
deserialized = response.stream_download(self._client._pipeline)
803-
804-
if response.status_code == 201:
805-
deserialized = response.stream_download(self._client._pipeline)
806-
807-
if response.status_code == 202:
808-
deserialized = response.stream_download(self._client._pipeline)
807+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
809808

810809
if cls:
811810
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -967,6 +966,7 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg
967966
)
968967
_request.url = self._client.format_url(_request.url)
969968

969+
_decompress = kwargs.pop("decompress", True)
970970
_stream = True
971971
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
972972
_request, stream=_stream, **kwargs
@@ -975,18 +975,14 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg
975975
response = pipeline_response.http_response
976976

977977
if response.status_code not in [200, 202, 204]:
978-
response.read() # Load the body in memory and close the socket
978+
try:
979+
response.read() # Load the body in memory and close the socket
980+
except (StreamConsumedError, StreamClosedError):
981+
pass
979982
map_error(status_code=response.status_code, response=response, error_map=error_map)
980983
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
981984

982-
if response.status_code == 200:
983-
deserialized = response.stream_download(self._client._pipeline)
984-
985-
if response.status_code == 202:
986-
deserialized = response.stream_download(self._client._pipeline)
987-
988-
if response.status_code == 204:
989-
deserialized = response.stream_download(self._client._pipeline)
985+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
990986

991987
if cls:
992988
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1093,11 +1089,7 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _
10931089
map_error(status_code=response.status_code, response=response, error_map=error_map)
10941090
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
10951091

1096-
if response.status_code == 200:
1097-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
1098-
1099-
if response.status_code == 201:
1100-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
1092+
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
11011093

11021094
if cls:
11031095
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1228,11 +1220,7 @@ def update(
12281220
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
12291221

12301222
deserialized = None
1231-
if response.status_code == 200:
1232-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
1233-
1234-
if response.status_code == 201:
1235-
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
1223+
deserialized = self._deserialize("NamespaceResource", pipeline_response.http_response)
12361224

12371225
if cls:
12381226
return cls(pipeline_response, deserialized, {}) # type: ignore

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_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 = "11.1.0"
9+
VERSION = "1.0.0b1"

sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/aio/operations/_namespaces_operations.py

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ResourceExistsError,
1919
ResourceNotFoundError,
2020
ResourceNotModifiedError,
21+
StreamClosedError,
22+
StreamConsumedError,
2123
map_error,
2224
)
2325
from azure.core.pipeline import PipelineResponse
@@ -916,6 +918,7 @@ async def _create_or_update_initial(
916918
)
917919
_request.url = self._client.format_url(_request.url)
918920

921+
_decompress = kwargs.pop("decompress", True)
919922
_stream = True
920923
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
921924
_request, stream=_stream, **kwargs
@@ -924,19 +927,15 @@ async def _create_or_update_initial(
924927
response = pipeline_response.http_response
925928

926929
if response.status_code not in [200, 201, 202]:
927-
await response.read() # Load the body in memory and close the socket
930+
try:
931+
await response.read() # Load the body in memory and close the socket
932+
except (StreamConsumedError, StreamClosedError):
933+
pass
928934
map_error(status_code=response.status_code, response=response, error_map=error_map)
929935
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
930936
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
931937

932-
if response.status_code == 200:
933-
deserialized = response.stream_download(self._client._pipeline)
934-
935-
if response.status_code == 201:
936-
deserialized = response.stream_download(self._client._pipeline)
937-
938-
if response.status_code == 202:
939-
deserialized = response.stream_download(self._client._pipeline)
938+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
940939

941940
if cls:
942941
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1096,6 +1095,7 @@ async def _delete_initial(
10961095
)
10971096
_request.url = self._client.format_url(_request.url)
10981097

1098+
_decompress = kwargs.pop("decompress", True)
10991099
_stream = True
11001100
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
11011101
_request, stream=_stream, **kwargs
@@ -1104,19 +1104,15 @@ async def _delete_initial(
11041104
response = pipeline_response.http_response
11051105

11061106
if response.status_code not in [200, 202, 204]:
1107-
await response.read() # Load the body in memory and close the socket
1107+
try:
1108+
await response.read() # Load the body in memory and close the socket
1109+
except (StreamConsumedError, StreamClosedError):
1110+
pass
11081111
map_error(status_code=response.status_code, response=response, error_map=error_map)
11091112
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
11101113
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
11111114

1112-
if response.status_code == 200:
1113-
deserialized = response.stream_download(self._client._pipeline)
1114-
1115-
if response.status_code == 202:
1116-
deserialized = response.stream_download(self._client._pipeline)
1117-
1118-
if response.status_code == 204:
1119-
deserialized = response.stream_download(self._client._pipeline)
1115+
deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
11201116

11211117
if cls:
11221118
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1224,11 +1220,7 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any
12241220
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
12251221
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
12261222

1227-
if response.status_code == 200:
1228-
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
1229-
1230-
if response.status_code == 201:
1231-
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
1223+
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
12321224

12331225
if cls:
12341226
return cls(pipeline_response, deserialized, {}) # type: ignore
@@ -1360,11 +1352,7 @@ async def update(
13601352
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
13611353

13621354
deserialized = None
1363-
if response.status_code == 200:
1364-
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
1365-
1366-
if response.status_code == 201:
1367-
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
1355+
deserialized = self._deserialize("EHNamespace", pipeline_response.http_response)
13681356

13691357
if cls:
13701358
return cls(pipeline_response, deserialized, {}) # type: ignore

0 commit comments

Comments
 (0)