azure-storage-blob 12.23.0b1__py3-none-any.whl → 12.24.0__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 (54) hide show
  1. azure/storage/blob/_blob_client.py +34 -10
  2. azure/storage/blob/_blob_client_helpers.py +7 -3
  3. azure/storage/blob/_blob_service_client.py +1 -1
  4. azure/storage/blob/_container_client.py +8 -2
  5. azure/storage/blob/_container_client_helpers.py +11 -6
  6. azure/storage/blob/_deserialize.py +2 -2
  7. azure/storage/blob/_encryption.py +15 -10
  8. azure/storage/blob/_generated/_azure_blob_storage.py +3 -2
  9. azure/storage/blob/_generated/_configuration.py +2 -2
  10. azure/storage/blob/_generated/_serialization.py +267 -150
  11. azure/storage/blob/_generated/aio/_azure_blob_storage.py +3 -2
  12. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  13. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +23 -11
  14. azure/storage/blob/_generated/aio/operations/_blob_operations.py +137 -73
  15. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +42 -16
  16. azure/storage/blob/_generated/aio/operations/_container_operations.py +49 -44
  17. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +35 -23
  18. azure/storage/blob/_generated/aio/operations/_service_operations.py +30 -25
  19. azure/storage/blob/_generated/models/_azure_blob_storage_enums.py +1 -0
  20. azure/storage/blob/_generated/operations/_append_blob_operations.py +35 -15
  21. azure/storage/blob/_generated/operations/_blob_operations.py +187 -98
  22. azure/storage/blob/_generated/operations/_block_blob_operations.py +64 -22
  23. azure/storage/blob/_generated/operations/_container_operations.py +67 -62
  24. azure/storage/blob/_generated/operations/_page_blob_operations.py +52 -32
  25. azure/storage/blob/_generated/operations/_service_operations.py +38 -33
  26. azure/storage/blob/_list_blobs_helper.py +1 -1
  27. azure/storage/blob/_models.py +4 -3
  28. azure/storage/blob/_serialize.py +1 -0
  29. azure/storage/blob/_shared/avro/schema.py +1 -0
  30. azure/storage/blob/_shared/base_client.py +10 -8
  31. azure/storage/blob/_shared/base_client_async.py +5 -5
  32. azure/storage/blob/_shared/models.py +5 -2
  33. azure/storage/blob/_shared/policies.py +14 -16
  34. azure/storage/blob/_shared/policies_async.py +19 -6
  35. azure/storage/blob/_shared/request_handlers.py +2 -3
  36. azure/storage/blob/_shared/response_handlers.py +2 -2
  37. azure/storage/blob/_shared/uploads.py +4 -4
  38. azure/storage/blob/_shared/uploads_async.py +4 -4
  39. azure/storage/blob/_shared_access_signature.py +0 -1
  40. azure/storage/blob/_version.py +1 -1
  41. azure/storage/blob/aio/_blob_client_async.py +36 -13
  42. azure/storage/blob/aio/_blob_service_client_async.py +7 -3
  43. azure/storage/blob/aio/_container_client_async.py +10 -4
  44. azure/storage/blob/aio/_download_async.py +94 -71
  45. azure/storage/blob/aio/_lease_async.py +1 -1
  46. azure/storage/blob/aio/_list_blobs_helper.py +1 -2
  47. azure/storage/blob/aio/_models.py +1 -2
  48. {azure_storage_blob-12.23.0b1.dist-info → azure_storage_blob-12.24.0.dist-info}/METADATA +10 -10
  49. azure_storage_blob-12.24.0.dist-info/RECORD +84 -0
  50. {azure_storage_blob-12.23.0b1.dist-info → azure_storage_blob-12.24.0.dist-info}/WHEEL +1 -1
  51. azure/storage/blob/_generated/_vendor.py +0 -16
  52. azure_storage_blob-12.23.0b1.dist-info/RECORD +0 -85
  53. {azure_storage_blob-12.23.0b1.dist-info → azure_storage_blob-12.24.0.dist-info}/LICENSE +0 -0
  54. {azure_storage_blob-12.23.0b1.dist-info → azure_storage_blob-12.24.0.dist-info}/top_level.txt +0 -0
@@ -19,13 +19,11 @@ from azure.core.exceptions import (
19
19
  map_error,
20
20
  )
21
21
  from azure.core.pipeline import PipelineResponse
22
- from azure.core.pipeline.transport import AsyncHttpResponse
23
- from azure.core.rest import HttpRequest
22
+ from azure.core.rest import AsyncHttpResponse, HttpRequest
24
23
  from azure.core.tracing.decorator_async import distributed_trace_async
25
24
  from azure.core.utils import case_insensitive_dict
26
25
 
27
26
  from ... import models as _models
28
- from ..._vendor import _convert_request
29
27
  from ...operations._block_blob_operations import (
30
28
  build_commit_block_list_request,
31
29
  build_get_block_list_request,
@@ -77,6 +75,8 @@ class BlockBlobOperations:
77
75
  immutability_policy_mode: Optional[Union[str, _models.BlobImmutabilityPolicyMode]] = None,
78
76
  legal_hold: Optional[bool] = None,
79
77
  transactional_content_crc64: Optional[bytes] = None,
78
+ structured_body_type: Optional[str] = None,
79
+ structured_content_length: Optional[int] = None,
80
80
  blob_http_headers: Optional[_models.BlobHTTPHeaders] = None,
81
81
  lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
82
82
  cpk_info: Optional[_models.CpkInfo] = None,
@@ -84,6 +84,7 @@ class BlockBlobOperations:
84
84
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
85
85
  **kwargs: Any
86
86
  ) -> None:
87
+ # pylint: disable=line-too-long
87
88
  """The Upload Block Blob operation updates the content of an existing block blob. Updating an
88
89
  existing block blob overwrites any existing metadata on the blob. Partial updates are not
89
90
  supported with Put Blob; the content of the existing blob is overwritten with the content of
@@ -132,6 +133,13 @@ class BlockBlobOperations:
132
133
  :param transactional_content_crc64: Specify the transactional crc64 for the body, to be
133
134
  validated by the service. Default value is None.
134
135
  :type transactional_content_crc64: bytes
136
+ :param structured_body_type: Required if the request body is a structured message. Specifies
137
+ the message schema version and properties. Default value is None.
138
+ :type structured_body_type: str
139
+ :param structured_content_length: Required if the request body is a structured message.
140
+ Specifies the length of the blob/file content inside the message body. Will always be smaller
141
+ than Content-Length. Default value is None.
142
+ :type structured_content_length: int
135
143
  :param blob_http_headers: Parameter group. Default value is None.
136
144
  :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders
137
145
  :param lease_access_conditions: Parameter group. Default value is None.
@@ -146,7 +154,7 @@ class BlockBlobOperations:
146
154
  :rtype: None
147
155
  :raises ~azure.core.exceptions.HttpResponseError:
148
156
  """
149
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
157
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
150
158
  401: ClientAuthenticationError,
151
159
  404: ResourceNotFoundError,
152
160
  409: ResourceExistsError,
@@ -229,6 +237,8 @@ class BlockBlobOperations:
229
237
  immutability_policy_mode=immutability_policy_mode,
230
238
  legal_hold=legal_hold,
231
239
  transactional_content_crc64=transactional_content_crc64,
240
+ structured_body_type=structured_body_type,
241
+ structured_content_length=structured_content_length,
232
242
  blob_type=blob_type,
233
243
  content_type=content_type,
234
244
  version=self._config.version,
@@ -236,7 +246,6 @@ class BlockBlobOperations:
236
246
  headers=_headers,
237
247
  params=_params,
238
248
  )
239
- _request = _convert_request(_request)
240
249
  _request.url = self._client.format_url(_request.url)
241
250
 
242
251
  _stream = False
@@ -271,6 +280,9 @@ class BlockBlobOperations:
271
280
  response_headers["x-ms-encryption-scope"] = self._deserialize(
272
281
  "str", response.headers.get("x-ms-encryption-scope")
273
282
  )
283
+ response_headers["x-ms-structured-body"] = self._deserialize(
284
+ "str", response.headers.get("x-ms-structured-body")
285
+ )
274
286
 
275
287
  if cls:
276
288
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -298,6 +310,7 @@ class BlockBlobOperations:
298
310
  source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
299
311
  **kwargs: Any
300
312
  ) -> None:
313
+ # pylint: disable=line-too-long
301
314
  """The Put Blob from URL operation creates a new Block Blob where the contents of the blob are
302
315
  read from a given URL. This API is supported beginning with the 2020-04-08 version. Partial
303
316
  updates are not supported with Put Blob from URL; the content of an existing blob is
@@ -368,7 +381,7 @@ class BlockBlobOperations:
368
381
  :rtype: None
369
382
  :raises ~azure.core.exceptions.HttpResponseError:
370
383
  """
371
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
384
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
372
385
  401: ClientAuthenticationError,
373
386
  404: ResourceNotFoundError,
374
387
  409: ResourceExistsError,
@@ -471,7 +484,6 @@ class BlockBlobOperations:
471
484
  headers=_headers,
472
485
  params=_params,
473
486
  )
474
- _request = _convert_request(_request)
475
487
  _request.url = self._client.format_url(_request.url)
476
488
 
477
489
  _stream = False
@@ -520,11 +532,14 @@ class BlockBlobOperations:
520
532
  transactional_content_crc64: Optional[bytes] = None,
521
533
  timeout: Optional[int] = None,
522
534
  request_id_parameter: Optional[str] = None,
535
+ structured_body_type: Optional[str] = None,
536
+ structured_content_length: Optional[int] = None,
523
537
  lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
524
538
  cpk_info: Optional[_models.CpkInfo] = None,
525
539
  cpk_scope_info: Optional[_models.CpkScopeInfo] = None,
526
540
  **kwargs: Any
527
541
  ) -> None:
542
+ # pylint: disable=line-too-long
528
543
  """The Stage Block operation creates a new block to be committed as part of a blob.
529
544
 
530
545
  :param block_id: A valid Base64 string value that identifies the block. Prior to encoding, the
@@ -550,6 +565,13 @@ class BlockBlobOperations:
550
565
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
551
566
  value is None.
552
567
  :type request_id_parameter: str
568
+ :param structured_body_type: Required if the request body is a structured message. Specifies
569
+ the message schema version and properties. Default value is None.
570
+ :type structured_body_type: str
571
+ :param structured_content_length: Required if the request body is a structured message.
572
+ Specifies the length of the blob/file content inside the message body. Will always be smaller
573
+ than Content-Length. Default value is None.
574
+ :type structured_content_length: int
553
575
  :param lease_access_conditions: Parameter group. Default value is None.
554
576
  :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
555
577
  :param cpk_info: Parameter group. Default value is None.
@@ -560,7 +582,7 @@ class BlockBlobOperations:
560
582
  :rtype: None
561
583
  :raises ~azure.core.exceptions.HttpResponseError:
562
584
  """
563
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
585
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
564
586
  401: ClientAuthenticationError,
565
587
  404: ResourceNotFoundError,
566
588
  409: ResourceExistsError,
@@ -603,6 +625,8 @@ class BlockBlobOperations:
603
625
  encryption_algorithm=_encryption_algorithm,
604
626
  encryption_scope=_encryption_scope,
605
627
  request_id_parameter=request_id_parameter,
628
+ structured_body_type=structured_body_type,
629
+ structured_content_length=structured_content_length,
606
630
  comp=comp,
607
631
  content_type=content_type,
608
632
  version=self._config.version,
@@ -610,7 +634,6 @@ class BlockBlobOperations:
610
634
  headers=_headers,
611
635
  params=_params,
612
636
  )
613
- _request = _convert_request(_request)
614
637
  _request.url = self._client.format_url(_request.url)
615
638
 
616
639
  _stream = False
@@ -645,6 +668,9 @@ class BlockBlobOperations:
645
668
  response_headers["x-ms-encryption-scope"] = self._deserialize(
646
669
  "str", response.headers.get("x-ms-encryption-scope")
647
670
  )
671
+ response_headers["x-ms-structured-body"] = self._deserialize(
672
+ "str", response.headers.get("x-ms-structured-body")
673
+ )
648
674
 
649
675
  if cls:
650
676
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -667,6 +693,7 @@ class BlockBlobOperations:
667
693
  source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
668
694
  **kwargs: Any
669
695
  ) -> None:
696
+ # pylint: disable=line-too-long
670
697
  """The Stage Block operation creates a new block to be committed as part of a blob where the
671
698
  contents are read from a URL.
672
699
 
@@ -711,7 +738,7 @@ class BlockBlobOperations:
711
738
  :rtype: None
712
739
  :raises ~azure.core.exceptions.HttpResponseError:
713
740
  """
714
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
741
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
715
742
  401: ClientAuthenticationError,
716
743
  404: ResourceNotFoundError,
717
744
  409: ResourceExistsError,
@@ -773,7 +800,6 @@ class BlockBlobOperations:
773
800
  headers=_headers,
774
801
  params=_params,
775
802
  )
776
- _request = _convert_request(_request)
777
803
  _request.url = self._client.format_url(_request.url)
778
804
 
779
805
  _stream = False
@@ -833,6 +859,7 @@ class BlockBlobOperations:
833
859
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
834
860
  **kwargs: Any
835
861
  ) -> None:
862
+ # pylint: disable=line-too-long
836
863
  """The Commit Block List operation writes a blob by specifying the list of block IDs that make up
837
864
  the blob. In order to be written as part of a blob, a block must have been successfully written
838
865
  to the server in a prior Put Block operation. You can call Put Block List to update a blob by
@@ -895,7 +922,7 @@ class BlockBlobOperations:
895
922
  :rtype: None
896
923
  :raises ~azure.core.exceptions.HttpResponseError:
897
924
  """
898
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
925
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
899
926
  401: ClientAuthenticationError,
900
927
  404: ResourceNotFoundError,
901
928
  409: ResourceExistsError,
@@ -984,7 +1011,6 @@ class BlockBlobOperations:
984
1011
  headers=_headers,
985
1012
  params=_params,
986
1013
  )
987
- _request = _convert_request(_request)
988
1014
  _request.url = self._client.format_url(_request.url)
989
1015
 
990
1016
  _stream = False
@@ -1037,6 +1063,7 @@ class BlockBlobOperations:
1037
1063
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
1038
1064
  **kwargs: Any
1039
1065
  ) -> _models.BlockList:
1066
+ # pylint: disable=line-too-long
1040
1067
  """The Get Block List operation retrieves the list of blocks that have been uploaded as part of a
1041
1068
  block blob.
1042
1069
 
@@ -1067,7 +1094,7 @@ class BlockBlobOperations:
1067
1094
  :rtype: ~azure.storage.blob.models.BlockList
1068
1095
  :raises ~azure.core.exceptions.HttpResponseError:
1069
1096
  """
1070
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1097
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1071
1098
  401: ClientAuthenticationError,
1072
1099
  404: ResourceNotFoundError,
1073
1100
  409: ResourceExistsError,
@@ -1101,7 +1128,6 @@ class BlockBlobOperations:
1101
1128
  headers=_headers,
1102
1129
  params=_params,
1103
1130
  )
1104
- _request = _convert_request(_request)
1105
1131
  _request.url = self._client.format_url(_request.url)
1106
1132
 
1107
1133
  _stream = False
@@ -1130,7 +1156,7 @@ class BlockBlobOperations:
1130
1156
  response_headers["x-ms-version"] = self._deserialize("str", response.headers.get("x-ms-version"))
1131
1157
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
1132
1158
 
1133
- deserialized = self._deserialize("BlockList", pipeline_response)
1159
+ deserialized = self._deserialize("BlockList", pipeline_response.http_response)
1134
1160
 
1135
1161
  if cls:
1136
1162
  return cls(pipeline_response, deserialized, response_headers) # type: ignore