azure-storage-blob 12.23.0__py3-none-any.whl → 12.23.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. azure/storage/blob/_container_client.py +0 -6
  2. azure/storage/blob/_container_client_helpers.py +2 -7
  3. azure/storage/blob/_generated/_azure_blob_storage.py +1 -2
  4. azure/storage/blob/_generated/_serialization.py +0 -2
  5. azure/storage/blob/_generated/_vendor.py +16 -0
  6. azure/storage/blob/_generated/aio/_azure_blob_storage.py +1 -2
  7. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +7 -1
  8. azure/storage/blob/_generated/aio/operations/_blob_operations.py +47 -21
  9. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +10 -2
  10. azure/storage/blob/_generated/aio/operations/_container_operations.py +26 -13
  11. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +14 -3
  12. azure/storage/blob/_generated/aio/operations/_service_operations.py +17 -14
  13. azure/storage/blob/_generated/operations/_append_blob_operations.py +7 -1
  14. azure/storage/blob/_generated/operations/_blob_operations.py +47 -21
  15. azure/storage/blob/_generated/operations/_block_blob_operations.py +10 -2
  16. azure/storage/blob/_generated/operations/_container_operations.py +26 -13
  17. azure/storage/blob/_generated/operations/_page_blob_operations.py +14 -3
  18. azure/storage/blob/_generated/operations/_service_operations.py +17 -14
  19. azure/storage/blob/_shared/base_client.py +0 -2
  20. azure/storage/blob/_shared/policies.py +9 -8
  21. azure/storage/blob/_shared/policies_async.py +5 -18
  22. azure/storage/blob/_version.py +1 -1
  23. azure/storage/blob/aio/_container_client_async.py +0 -6
  24. azure/storage/blob/aio/_download_async.py +71 -94
  25. {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/METADATA +2 -2
  26. {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/RECORD +29 -28
  27. {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/WHEEL +1 -1
  28. {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/LICENSE +0 -0
  29. {azure_storage_blob-12.23.0.dist-info → azure_storage_blob-12.23.0b1.dist-info}/top_level.txt +0 -0
@@ -16,17 +16,17 @@ from azure.core.exceptions import (
16
16
  ResourceExistsError,
17
17
  ResourceNotFoundError,
18
18
  ResourceNotModifiedError,
19
- StreamClosedError,
20
- StreamConsumedError,
21
19
  map_error,
22
20
  )
23
21
  from azure.core.pipeline import PipelineResponse
24
- from azure.core.rest import HttpRequest, HttpResponse
22
+ from azure.core.pipeline.transport import HttpResponse
23
+ from azure.core.rest import HttpRequest
25
24
  from azure.core.tracing.decorator import distributed_trace
26
25
  from azure.core.utils import case_insensitive_dict
27
26
 
28
27
  from .. import models as _models
29
28
  from .._serialization import Serializer
29
+ from .._vendor import _convert_request
30
30
 
31
31
  if sys.version_info >= (3, 9):
32
32
  from collections.abc import MutableMapping
@@ -1601,9 +1601,9 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1601
1601
  headers=_headers,
1602
1602
  params=_params,
1603
1603
  )
1604
+ _request = _convert_request(_request)
1604
1605
  _request.url = self._client.format_url(_request.url)
1605
1606
 
1606
- _decompress = kwargs.pop("decompress", True)
1607
1607
  _stream = True
1608
1608
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1609
1609
  _request, stream=_stream, **kwargs
@@ -1612,10 +1612,6 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1612
1612
  response = pipeline_response.http_response
1613
1613
 
1614
1614
  if response.status_code not in [200, 206]:
1615
- try:
1616
- response.read() # Load the body in memory and close the socket
1617
- except (StreamConsumedError, StreamClosedError):
1618
- pass
1619
1615
  map_error(status_code=response.status_code, response=response, error_map=error_map)
1620
1616
  error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
1621
1617
  raise HttpResponseError(response=response, model=error)
@@ -1700,6 +1696,8 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1700
1696
  )
1701
1697
  response_headers["x-ms-legal-hold"] = self._deserialize("bool", response.headers.get("x-ms-legal-hold"))
1702
1698
 
1699
+ deserialized = response.stream_download(self._client._pipeline)
1700
+
1703
1701
  if response.status_code == 206:
1704
1702
  response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
1705
1703
  response_headers["x-ms-creation-time"] = self._deserialize(
@@ -1782,7 +1780,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1782
1780
  )
1783
1781
  response_headers["x-ms-legal-hold"] = self._deserialize("bool", response.headers.get("x-ms-legal-hold"))
1784
1782
 
1785
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
1783
+ deserialized = response.stream_download(self._client._pipeline)
1786
1784
 
1787
1785
  if cls:
1788
1786
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1887,6 +1885,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1887
1885
  headers=_headers,
1888
1886
  params=_params,
1889
1887
  )
1888
+ _request = _convert_request(_request)
1890
1889
  _request.url = self._client.format_url(_request.url)
1891
1890
 
1892
1891
  _stream = False
@@ -2099,6 +2098,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2099
2098
  headers=_headers,
2100
2099
  params=_params,
2101
2100
  )
2101
+ _request = _convert_request(_request)
2102
2102
  _request.url = self._client.format_url(_request.url)
2103
2103
 
2104
2104
  _stream = False
@@ -2166,6 +2166,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2166
2166
  headers=_headers,
2167
2167
  params=_params,
2168
2168
  )
2169
+ _request = _convert_request(_request)
2169
2170
  _request.url = self._client.format_url(_request.url)
2170
2171
 
2171
2172
  _stream = False
@@ -2245,6 +2246,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2245
2246
  headers=_headers,
2246
2247
  params=_params,
2247
2248
  )
2249
+ _request = _convert_request(_request)
2248
2250
  _request.url = self._client.format_url(_request.url)
2249
2251
 
2250
2252
  _stream = False
@@ -2366,6 +2368,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2366
2368
  headers=_headers,
2367
2369
  params=_params,
2368
2370
  )
2371
+ _request = _convert_request(_request)
2369
2372
  _request.url = self._client.format_url(_request.url)
2370
2373
 
2371
2374
  _stream = False
@@ -2459,6 +2462,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2459
2462
  headers=_headers,
2460
2463
  params=_params,
2461
2464
  )
2465
+ _request = _convert_request(_request)
2462
2466
  _request.url = self._client.format_url(_request.url)
2463
2467
 
2464
2468
  _stream = False
@@ -2532,6 +2536,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2532
2536
  headers=_headers,
2533
2537
  params=_params,
2534
2538
  )
2539
+ _request = _convert_request(_request)
2535
2540
  _request.url = self._client.format_url(_request.url)
2536
2541
 
2537
2542
  _stream = False
@@ -2602,6 +2607,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2602
2607
  headers=_headers,
2603
2608
  params=_params,
2604
2609
  )
2610
+ _request = _convert_request(_request)
2605
2611
  _request.url = self._client.format_url(_request.url)
2606
2612
 
2607
2613
  _stream = False
@@ -2731,6 +2737,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2731
2737
  headers=_headers,
2732
2738
  params=_params,
2733
2739
  )
2740
+ _request = _convert_request(_request)
2734
2741
  _request.url = self._client.format_url(_request.url)
2735
2742
 
2736
2743
  _stream = False
@@ -2848,6 +2855,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2848
2855
  headers=_headers,
2849
2856
  params=_params,
2850
2857
  )
2858
+ _request = _convert_request(_request)
2851
2859
  _request.url = self._client.format_url(_request.url)
2852
2860
 
2853
2861
  _stream = False
@@ -2948,6 +2956,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2948
2956
  headers=_headers,
2949
2957
  params=_params,
2950
2958
  )
2959
+ _request = _convert_request(_request)
2951
2960
  _request.url = self._client.format_url(_request.url)
2952
2961
 
2953
2962
  _stream = False
@@ -3047,6 +3056,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3047
3056
  headers=_headers,
3048
3057
  params=_params,
3049
3058
  )
3059
+ _request = _convert_request(_request)
3050
3060
  _request.url = self._client.format_url(_request.url)
3051
3061
 
3052
3062
  _stream = False
@@ -3153,6 +3163,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3153
3163
  headers=_headers,
3154
3164
  params=_params,
3155
3165
  )
3166
+ _request = _convert_request(_request)
3156
3167
  _request.url = self._client.format_url(_request.url)
3157
3168
 
3158
3169
  _stream = False
@@ -3259,6 +3270,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3259
3270
  headers=_headers,
3260
3271
  params=_params,
3261
3272
  )
3273
+ _request = _convert_request(_request)
3262
3274
  _request.url = self._client.format_url(_request.url)
3263
3275
 
3264
3276
  _stream = False
@@ -3389,6 +3401,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3389
3401
  headers=_headers,
3390
3402
  params=_params,
3391
3403
  )
3404
+ _request = _convert_request(_request)
3392
3405
  _request.url = self._client.format_url(_request.url)
3393
3406
 
3394
3407
  _stream = False
@@ -3563,6 +3576,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3563
3576
  headers=_headers,
3564
3577
  params=_params,
3565
3578
  )
3579
+ _request = _convert_request(_request)
3566
3580
  _request.url = self._client.format_url(_request.url)
3567
3581
 
3568
3582
  _stream = False
@@ -3750,6 +3764,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3750
3764
  headers=_headers,
3751
3765
  params=_params,
3752
3766
  )
3767
+ _request = _convert_request(_request)
3753
3768
  _request.url = self._client.format_url(_request.url)
3754
3769
 
3755
3770
  _stream = False
@@ -3850,6 +3865,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3850
3865
  headers=_headers,
3851
3866
  params=_params,
3852
3867
  )
3868
+ _request = _convert_request(_request)
3853
3869
  _request.url = self._client.format_url(_request.url)
3854
3870
 
3855
3871
  _stream = False
@@ -3964,6 +3980,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3964
3980
  headers=_headers,
3965
3981
  params=_params,
3966
3982
  )
3983
+ _request = _convert_request(_request)
3967
3984
  _request.url = self._client.format_url(_request.url)
3968
3985
 
3969
3986
  _stream = False
@@ -3979,11 +3996,19 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3979
3996
  raise HttpResponseError(response=response, model=error)
3980
3997
 
3981
3998
  response_headers = {}
3982
- response_headers["x-ms-client-request-id"] = self._deserialize(
3983
- "str", response.headers.get("x-ms-client-request-id")
3984
- )
3985
- response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
3986
- response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
3999
+ if response.status_code == 200:
4000
+ response_headers["x-ms-client-request-id"] = self._deserialize(
4001
+ "str", response.headers.get("x-ms-client-request-id")
4002
+ )
4003
+ response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
4004
+ response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
4005
+
4006
+ if response.status_code == 202:
4007
+ response_headers["x-ms-client-request-id"] = self._deserialize(
4008
+ "str", response.headers.get("x-ms-client-request-id")
4009
+ )
4010
+ response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
4011
+ response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
3987
4012
 
3988
4013
  if cls:
3989
4014
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -4032,6 +4057,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4032
4057
  headers=_headers,
4033
4058
  params=_params,
4034
4059
  )
4060
+ _request = _convert_request(_request)
4035
4061
  _request.url = self._client.format_url(_request.url)
4036
4062
 
4037
4063
  _stream = False
@@ -4164,9 +4190,9 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4164
4190
  headers=_headers,
4165
4191
  params=_params,
4166
4192
  )
4193
+ _request = _convert_request(_request)
4167
4194
  _request.url = self._client.format_url(_request.url)
4168
4195
 
4169
- _decompress = kwargs.pop("decompress", True)
4170
4196
  _stream = True
4171
4197
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
4172
4198
  _request, stream=_stream, **kwargs
@@ -4175,10 +4201,6 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4175
4201
  response = pipeline_response.http_response
4176
4202
 
4177
4203
  if response.status_code not in [200, 206]:
4178
- try:
4179
- response.read() # Load the body in memory and close the socket
4180
- except (StreamConsumedError, StreamClosedError):
4181
- pass
4182
4204
  map_error(status_code=response.status_code, response=response, error_map=error_map)
4183
4205
  error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
4184
4206
  raise HttpResponseError(response=response, model=error)
@@ -4242,6 +4264,8 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4242
4264
  "bytearray", response.headers.get("x-ms-blob-content-md5")
4243
4265
  )
4244
4266
 
4267
+ deserialized = response.stream_download(self._client._pipeline)
4268
+
4245
4269
  if response.status_code == 206:
4246
4270
  response_headers["Last-Modified"] = self._deserialize("rfc-1123", response.headers.get("Last-Modified"))
4247
4271
  response_headers["x-ms-meta"] = self._deserialize("{str}", response.headers.get("x-ms-meta"))
@@ -4303,7 +4327,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4303
4327
  "bytearray", response.headers.get("x-ms-blob-content-md5")
4304
4328
  )
4305
4329
 
4306
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
4330
+ deserialized = response.stream_download(self._client._pipeline)
4307
4331
 
4308
4332
  if cls:
4309
4333
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -4384,6 +4408,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4384
4408
  headers=_headers,
4385
4409
  params=_params,
4386
4410
  )
4411
+ _request = _convert_request(_request)
4387
4412
  _request.url = self._client.format_url(_request.url)
4388
4413
 
4389
4414
  _stream = False
@@ -4406,7 +4431,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4406
4431
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
4407
4432
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
4408
4433
 
4409
- deserialized = self._deserialize("BlobTags", pipeline_response.http_response)
4434
+ deserialized = self._deserialize("BlobTags", pipeline_response)
4410
4435
 
4411
4436
  if cls:
4412
4437
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -4499,6 +4524,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4499
4524
  headers=_headers,
4500
4525
  params=_params,
4501
4526
  )
4527
+ _request = _convert_request(_request)
4502
4528
  _request.url = self._client.format_url(_request.url)
4503
4529
 
4504
4530
  _stream = False
@@ -19,12 +19,14 @@ from azure.core.exceptions import (
19
19
  map_error,
20
20
  )
21
21
  from azure.core.pipeline import PipelineResponse
22
- from azure.core.rest import HttpRequest, HttpResponse
22
+ from azure.core.pipeline.transport import HttpResponse
23
+ from azure.core.rest import HttpRequest
23
24
  from azure.core.tracing.decorator import distributed_trace
24
25
  from azure.core.utils import case_insensitive_dict
25
26
 
26
27
  from .. import models as _models
27
28
  from .._serialization import Serializer
29
+ from .._vendor import _convert_request
28
30
 
29
31
  if sys.version_info >= (3, 9):
30
32
  from collections.abc import MutableMapping
@@ -842,6 +844,7 @@ class BlockBlobOperations:
842
844
  headers=_headers,
843
845
  params=_params,
844
846
  )
847
+ _request = _convert_request(_request)
845
848
  _request.url = self._client.format_url(_request.url)
846
849
 
847
850
  _stream = False
@@ -1076,6 +1079,7 @@ class BlockBlobOperations:
1076
1079
  headers=_headers,
1077
1080
  params=_params,
1078
1081
  )
1082
+ _request = _convert_request(_request)
1079
1083
  _request.url = self._client.format_url(_request.url)
1080
1084
 
1081
1085
  _stream = False
@@ -1214,6 +1218,7 @@ class BlockBlobOperations:
1214
1218
  headers=_headers,
1215
1219
  params=_params,
1216
1220
  )
1221
+ _request = _convert_request(_request)
1217
1222
  _request.url = self._client.format_url(_request.url)
1218
1223
 
1219
1224
  _stream = False
@@ -1376,6 +1381,7 @@ class BlockBlobOperations:
1376
1381
  headers=_headers,
1377
1382
  params=_params,
1378
1383
  )
1384
+ _request = _convert_request(_request)
1379
1385
  _request.url = self._client.format_url(_request.url)
1380
1386
 
1381
1387
  _stream = False
@@ -1586,6 +1592,7 @@ class BlockBlobOperations:
1586
1592
  headers=_headers,
1587
1593
  params=_params,
1588
1594
  )
1595
+ _request = _convert_request(_request)
1589
1596
  _request.url = self._client.format_url(_request.url)
1590
1597
 
1591
1598
  _stream = False
@@ -1702,6 +1709,7 @@ class BlockBlobOperations:
1702
1709
  headers=_headers,
1703
1710
  params=_params,
1704
1711
  )
1712
+ _request = _convert_request(_request)
1705
1713
  _request.url = self._client.format_url(_request.url)
1706
1714
 
1707
1715
  _stream = False
@@ -1730,7 +1738,7 @@ class BlockBlobOperations:
1730
1738
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1731
1739
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1732
1740
 
1733
- deserialized = self._deserialize("BlockList", pipeline_response.http_response)
1741
+ deserialized = self._deserialize("BlockList", pipeline_response)
1734
1742
 
1735
1743
  if cls:
1736
1744
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -16,17 +16,17 @@ from azure.core.exceptions import (
16
16
  ResourceExistsError,
17
17
  ResourceNotFoundError,
18
18
  ResourceNotModifiedError,
19
- StreamClosedError,
20
- StreamConsumedError,
21
19
  map_error,
22
20
  )
23
21
  from azure.core.pipeline import PipelineResponse
24
- from azure.core.rest import HttpRequest, HttpResponse
22
+ from azure.core.pipeline.transport import HttpResponse
23
+ from azure.core.rest import HttpRequest
25
24
  from azure.core.tracing.decorator import distributed_trace
26
25
  from azure.core.utils import case_insensitive_dict
27
26
 
28
27
  from .. import models as _models
29
28
  from .._serialization import Serializer
29
+ from .._vendor import _convert_request
30
30
 
31
31
  if sys.version_info >= (3, 9):
32
32
  from collections.abc import MutableMapping
@@ -976,6 +976,7 @@ class ContainerOperations:
976
976
  headers=_headers,
977
977
  params=_params,
978
978
  )
979
+ _request = _convert_request(_request)
979
980
  _request.url = self._client.format_url(_request.url)
980
981
 
981
982
  _stream = False
@@ -1057,6 +1058,7 @@ class ContainerOperations:
1057
1058
  headers=_headers,
1058
1059
  params=_params,
1059
1060
  )
1061
+ _request = _convert_request(_request)
1060
1062
  _request.url = self._client.format_url(_request.url)
1061
1063
 
1062
1064
  _stream = False
@@ -1168,6 +1170,7 @@ class ContainerOperations:
1168
1170
  headers=_headers,
1169
1171
  params=_params,
1170
1172
  )
1173
+ _request = _convert_request(_request)
1171
1174
  _request.url = self._client.format_url(_request.url)
1172
1175
 
1173
1176
  _stream = False
@@ -1265,6 +1268,7 @@ class ContainerOperations:
1265
1268
  headers=_headers,
1266
1269
  params=_params,
1267
1270
  )
1271
+ _request = _convert_request(_request)
1268
1272
  _request.url = self._client.format_url(_request.url)
1269
1273
 
1270
1274
  _stream = False
@@ -1348,6 +1352,7 @@ class ContainerOperations:
1348
1352
  headers=_headers,
1349
1353
  params=_params,
1350
1354
  )
1355
+ _request = _convert_request(_request)
1351
1356
  _request.url = self._client.format_url(_request.url)
1352
1357
 
1353
1358
  _stream = False
@@ -1375,7 +1380,7 @@ class ContainerOperations:
1375
1380
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1376
1381
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1377
1382
 
1378
- deserialized = self._deserialize("[SignedIdentifier]", pipeline_response.http_response)
1383
+ deserialized = self._deserialize("[SignedIdentifier]", pipeline_response)
1379
1384
 
1380
1385
  if cls:
1381
1386
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1466,6 +1471,7 @@ class ContainerOperations:
1466
1471
  headers=_headers,
1467
1472
  params=_params,
1468
1473
  )
1474
+ _request = _convert_request(_request)
1469
1475
  _request.url = self._client.format_url(_request.url)
1470
1476
 
1471
1477
  _stream = False
@@ -1550,6 +1556,7 @@ class ContainerOperations:
1550
1556
  headers=_headers,
1551
1557
  params=_params,
1552
1558
  )
1559
+ _request = _convert_request(_request)
1553
1560
  _request.url = self._client.format_url(_request.url)
1554
1561
 
1555
1562
  _stream = False
@@ -1632,6 +1639,7 @@ class ContainerOperations:
1632
1639
  headers=_headers,
1633
1640
  params=_params,
1634
1641
  )
1642
+ _request = _convert_request(_request)
1635
1643
  _request.url = self._client.format_url(_request.url)
1636
1644
 
1637
1645
  _stream = False
@@ -1718,9 +1726,9 @@ class ContainerOperations:
1718
1726
  headers=_headers,
1719
1727
  params=_params,
1720
1728
  )
1729
+ _request = _convert_request(_request)
1721
1730
  _request.url = self._client.format_url(_request.url)
1722
1731
 
1723
- _decompress = kwargs.pop("decompress", True)
1724
1732
  _stream = True
1725
1733
  pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
1726
1734
  _request, stream=_stream, **kwargs
@@ -1729,10 +1737,6 @@ class ContainerOperations:
1729
1737
  response = pipeline_response.http_response
1730
1738
 
1731
1739
  if response.status_code not in [202]:
1732
- try:
1733
- response.read() # Load the body in memory and close the socket
1734
- except (StreamConsumedError, StreamClosedError):
1735
- pass
1736
1740
  map_error(status_code=response.status_code, response=response, error_map=error_map)
1737
1741
  error = self._deserialize.failsafe_deserialize(_models.StorageError, pipeline_response)
1738
1742
  raise HttpResponseError(response=response, model=error)
@@ -1742,7 +1746,7 @@ class ContainerOperations:
1742
1746
  response_headers["x-ms-request-id"] = self._deserialize("str", response.headers.get("x-ms-request-id"))
1743
1747
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1744
1748
 
1745
- deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
1749
+ deserialized = response.stream_download(self._client._pipeline)
1746
1750
 
1747
1751
  if cls:
1748
1752
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1825,6 +1829,7 @@ class ContainerOperations:
1825
1829
  headers=_headers,
1826
1830
  params=_params,
1827
1831
  )
1832
+ _request = _convert_request(_request)
1828
1833
  _request.url = self._client.format_url(_request.url)
1829
1834
 
1830
1835
  _stream = False
@@ -1847,7 +1852,7 @@ class ContainerOperations:
1847
1852
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1848
1853
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1849
1854
 
1850
- deserialized = self._deserialize("FilterBlobSegment", pipeline_response.http_response)
1855
+ deserialized = self._deserialize("FilterBlobSegment", pipeline_response)
1851
1856
 
1852
1857
  if cls:
1853
1858
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1927,6 +1932,7 @@ class ContainerOperations:
1927
1932
  headers=_headers,
1928
1933
  params=_params,
1929
1934
  )
1935
+ _request = _convert_request(_request)
1930
1936
  _request.url = self._client.format_url(_request.url)
1931
1937
 
1932
1938
  _stream = False
@@ -2020,6 +2026,7 @@ class ContainerOperations:
2020
2026
  headers=_headers,
2021
2027
  params=_params,
2022
2028
  )
2029
+ _request = _convert_request(_request)
2023
2030
  _request.url = self._client.format_url(_request.url)
2024
2031
 
2025
2032
  _stream = False
@@ -2112,6 +2119,7 @@ class ContainerOperations:
2112
2119
  headers=_headers,
2113
2120
  params=_params,
2114
2121
  )
2122
+ _request = _convert_request(_request)
2115
2123
  _request.url = self._client.format_url(_request.url)
2116
2124
 
2117
2125
  _stream = False
@@ -2211,6 +2219,7 @@ class ContainerOperations:
2211
2219
  headers=_headers,
2212
2220
  params=_params,
2213
2221
  )
2222
+ _request = _convert_request(_request)
2214
2223
  _request.url = self._client.format_url(_request.url)
2215
2224
 
2216
2225
  _stream = False
@@ -2310,6 +2319,7 @@ class ContainerOperations:
2310
2319
  headers=_headers,
2311
2320
  params=_params,
2312
2321
  )
2322
+ _request = _convert_request(_request)
2313
2323
  _request.url = self._client.format_url(_request.url)
2314
2324
 
2315
2325
  _stream = False
@@ -2413,6 +2423,7 @@ class ContainerOperations:
2413
2423
  headers=_headers,
2414
2424
  params=_params,
2415
2425
  )
2426
+ _request = _convert_request(_request)
2416
2427
  _request.url = self._client.format_url(_request.url)
2417
2428
 
2418
2429
  _stream = False
@@ -2436,7 +2447,7 @@ class ContainerOperations:
2436
2447
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
2437
2448
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
2438
2449
 
2439
- deserialized = self._deserialize("ListBlobsFlatSegmentResponse", pipeline_response.http_response)
2450
+ deserialized = self._deserialize("ListBlobsFlatSegmentResponse", pipeline_response)
2440
2451
 
2441
2452
  if cls:
2442
2453
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -2525,6 +2536,7 @@ class ContainerOperations:
2525
2536
  headers=_headers,
2526
2537
  params=_params,
2527
2538
  )
2539
+ _request = _convert_request(_request)
2528
2540
  _request.url = self._client.format_url(_request.url)
2529
2541
 
2530
2542
  _stream = False
@@ -2548,7 +2560,7 @@ class ContainerOperations:
2548
2560
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
2549
2561
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
2550
2562
 
2551
- deserialized = self._deserialize("ListBlobsHierarchySegmentResponse", pipeline_response.http_response)
2563
+ deserialized = self._deserialize("ListBlobsHierarchySegmentResponse", pipeline_response)
2552
2564
 
2553
2565
  if cls:
2554
2566
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -2599,6 +2611,7 @@ class ContainerOperations:
2599
2611
  headers=_headers,
2600
2612
  params=_params,
2601
2613
  )
2614
+ _request = _convert_request(_request)
2602
2615
  _request.url = self._client.format_url(_request.url)
2603
2616
 
2604
2617
  _stream = False
@@ -19,12 +19,14 @@ from azure.core.exceptions import (
19
19
  map_error,
20
20
  )
21
21
  from azure.core.pipeline import PipelineResponse
22
- from azure.core.rest import HttpRequest, HttpResponse
22
+ from azure.core.pipeline.transport import HttpResponse
23
+ from azure.core.rest import HttpRequest
23
24
  from azure.core.tracing.decorator import distributed_trace
24
25
  from azure.core.utils import case_insensitive_dict
25
26
 
26
27
  from .. import models as _models
27
28
  from .._serialization import Serializer
29
+ from .._vendor import _convert_request
28
30
 
29
31
  if sys.version_info >= (3, 9):
30
32
  from collections.abc import MutableMapping
@@ -978,6 +980,7 @@ class PageBlobOperations:
978
980
  headers=_headers,
979
981
  params=_params,
980
982
  )
983
+ _request = _convert_request(_request)
981
984
  _request.url = self._client.format_url(_request.url)
982
985
 
983
986
  _stream = False
@@ -1151,6 +1154,7 @@ class PageBlobOperations:
1151
1154
  headers=_headers,
1152
1155
  params=_params,
1153
1156
  )
1157
+ _request = _convert_request(_request)
1154
1158
  _request.url = self._client.format_url(_request.url)
1155
1159
 
1156
1160
  _stream = False
@@ -1312,6 +1316,7 @@ class PageBlobOperations:
1312
1316
  headers=_headers,
1313
1317
  params=_params,
1314
1318
  )
1319
+ _request = _convert_request(_request)
1315
1320
  _request.url = self._client.format_url(_request.url)
1316
1321
 
1317
1322
  _stream = False
@@ -1507,6 +1512,7 @@ class PageBlobOperations:
1507
1512
  headers=_headers,
1508
1513
  params=_params,
1509
1514
  )
1515
+ _request = _convert_request(_request)
1510
1516
  _request.url = self._client.format_url(_request.url)
1511
1517
 
1512
1518
  _stream = False
@@ -1650,6 +1656,7 @@ class PageBlobOperations:
1650
1656
  headers=_headers,
1651
1657
  params=_params,
1652
1658
  )
1659
+ _request = _convert_request(_request)
1653
1660
  _request.url = self._client.format_url(_request.url)
1654
1661
 
1655
1662
  _stream = False
@@ -1677,7 +1684,7 @@ class PageBlobOperations:
1677
1684
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1678
1685
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1679
1686
 
1680
- deserialized = self._deserialize("PageList", pipeline_response.http_response)
1687
+ deserialized = self._deserialize("PageList", pipeline_response)
1681
1688
 
1682
1689
  if cls:
1683
1690
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1803,6 +1810,7 @@ class PageBlobOperations:
1803
1810
  headers=_headers,
1804
1811
  params=_params,
1805
1812
  )
1813
+ _request = _convert_request(_request)
1806
1814
  _request.url = self._client.format_url(_request.url)
1807
1815
 
1808
1816
  _stream = False
@@ -1830,7 +1838,7 @@ class PageBlobOperations:
1830
1838
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1831
1839
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1832
1840
 
1833
- deserialized = self._deserialize("PageList", pipeline_response.http_response)
1841
+ deserialized = self._deserialize("PageList", pipeline_response)
1834
1842
 
1835
1843
  if cls:
1836
1844
  return cls(pipeline_response, deserialized, response_headers) # type: ignore
@@ -1934,6 +1942,7 @@ class PageBlobOperations:
1934
1942
  headers=_headers,
1935
1943
  params=_params,
1936
1944
  )
1945
+ _request = _convert_request(_request)
1937
1946
  _request.url = self._client.format_url(_request.url)
1938
1947
 
1939
1948
  _stream = False
@@ -2049,6 +2058,7 @@ class PageBlobOperations:
2049
2058
  headers=_headers,
2050
2059
  params=_params,
2051
2060
  )
2061
+ _request = _convert_request(_request)
2052
2062
  _request.url = self._client.format_url(_request.url)
2053
2063
 
2054
2064
  _stream = False
@@ -2155,6 +2165,7 @@ class PageBlobOperations:
2155
2165
  headers=_headers,
2156
2166
  params=_params,
2157
2167
  )
2168
+ _request = _convert_request(_request)
2158
2169
  _request.url = self._client.format_url(_request.url)
2159
2170
 
2160
2171
  _stream = False