azure-storage-blob 12.23.1__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 (52) 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 +2 -2
  5. azure/storage/blob/_container_client_helpers.py +4 -4
  6. azure/storage/blob/_deserialize.py +2 -2
  7. azure/storage/blob/_encryption.py +2 -0
  8. azure/storage/blob/_generated/_azure_blob_storage.py +1 -1
  9. azure/storage/blob/_generated/_configuration.py +2 -2
  10. azure/storage/blob/_generated/_serialization.py +265 -150
  11. azure/storage/blob/_generated/aio/_azure_blob_storage.py +1 -1
  12. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  13. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +22 -4
  14. azure/storage/blob/_generated/aio/operations/_blob_operations.py +116 -26
  15. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +40 -6
  16. azure/storage/blob/_generated/aio/operations/_container_operations.py +36 -18
  17. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +32 -9
  18. azure/storage/blob/_generated/aio/operations/_service_operations.py +16 -8
  19. azure/storage/blob/_generated/models/_azure_blob_storage_enums.py +1 -0
  20. azure/storage/blob/_generated/operations/_append_blob_operations.py +34 -8
  21. azure/storage/blob/_generated/operations/_blob_operations.py +166 -51
  22. azure/storage/blob/_generated/operations/_block_blob_operations.py +62 -12
  23. azure/storage/blob/_generated/operations/_container_operations.py +54 -36
  24. azure/storage/blob/_generated/operations/_page_blob_operations.py +49 -18
  25. azure/storage/blob/_generated/operations/_service_operations.py +24 -16
  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 +8 -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 +6 -7
  34. azure/storage/blob/_shared/policies_async.py +1 -1
  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 +4 -4
  44. azure/storage/blob/aio/_lease_async.py +1 -1
  45. azure/storage/blob/aio/_list_blobs_helper.py +1 -2
  46. azure/storage/blob/aio/_models.py +1 -2
  47. {azure_storage_blob-12.23.1.dist-info → azure_storage_blob-12.24.0.dist-info}/METADATA +9 -9
  48. azure_storage_blob-12.24.0.dist-info/RECORD +84 -0
  49. {azure_storage_blob-12.23.1.dist-info → azure_storage_blob-12.24.0.dist-info}/WHEEL +1 -1
  50. azure_storage_blob-12.23.1.dist-info/RECORD +0 -84
  51. {azure_storage_blob-12.23.1.dist-info → azure_storage_blob-12.24.0.dist-info}/LICENSE +0 -0
  52. {azure_storage_blob-12.23.1.dist-info → azure_storage_blob-12.24.0.dist-info}/top_level.txt +0 -0
@@ -68,6 +68,8 @@ def build_upload_request(
68
68
  immutability_policy_mode: Optional[Union[str, _models.BlobImmutabilityPolicyMode]] = None,
69
69
  legal_hold: Optional[bool] = None,
70
70
  transactional_content_crc64: Optional[bytes] = None,
71
+ structured_body_type: Optional[str] = None,
72
+ structured_content_length: Optional[int] = None,
71
73
  **kwargs: Any
72
74
  ) -> HttpRequest:
73
75
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -75,7 +77,7 @@ def build_upload_request(
75
77
 
76
78
  blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob"))
77
79
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
78
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
80
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
79
81
  accept = _headers.pop("Accept", "application/xml")
80
82
 
81
83
  # Construct URL
@@ -160,6 +162,12 @@ def build_upload_request(
160
162
  _headers["x-ms-content-crc64"] = _SERIALIZER.header(
161
163
  "transactional_content_crc64", transactional_content_crc64, "bytearray"
162
164
  )
165
+ if structured_body_type is not None:
166
+ _headers["x-ms-structured-body"] = _SERIALIZER.header("structured_body_type", structured_body_type, "str")
167
+ if structured_content_length is not None:
168
+ _headers["x-ms-structured-content-length"] = _SERIALIZER.header(
169
+ "structured_content_length", structured_content_length, "int"
170
+ )
163
171
  if content_type is not None:
164
172
  _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
165
173
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -209,7 +217,7 @@ def build_put_blob_from_url_request(
209
217
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
210
218
 
211
219
  blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob"))
212
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
220
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
213
221
  accept = _headers.pop("Accept", "application/xml")
214
222
 
215
223
  # Construct URL
@@ -327,6 +335,8 @@ def build_stage_block_request(
327
335
  encryption_algorithm: Optional[Union[str, _models.EncryptionAlgorithmType]] = None,
328
336
  encryption_scope: Optional[str] = None,
329
337
  request_id_parameter: Optional[str] = None,
338
+ structured_body_type: Optional[str] = None,
339
+ structured_content_length: Optional[int] = None,
330
340
  **kwargs: Any
331
341
  ) -> HttpRequest:
332
342
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
@@ -334,7 +344,7 @@ def build_stage_block_request(
334
344
 
335
345
  comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block"))
336
346
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
337
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
347
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
338
348
  accept = _headers.pop("Accept", "application/xml")
339
349
 
340
350
  # Construct URL
@@ -376,6 +386,12 @@ def build_stage_block_request(
376
386
  _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str")
377
387
  if request_id_parameter is not None:
378
388
  _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str")
389
+ if structured_body_type is not None:
390
+ _headers["x-ms-structured-body"] = _SERIALIZER.header("structured_body_type", structured_body_type, "str")
391
+ if structured_content_length is not None:
392
+ _headers["x-ms-structured-content-length"] = _SERIALIZER.header(
393
+ "structured_content_length", structured_content_length, "int"
394
+ )
379
395
  if content_type is not None:
380
396
  _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
381
397
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -410,7 +426,7 @@ def build_stage_block_from_url_request(
410
426
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
411
427
 
412
428
  comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block"))
413
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
429
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
414
430
  accept = _headers.pop("Accept", "application/xml")
415
431
 
416
432
  # Construct URL
@@ -511,7 +527,7 @@ def build_commit_block_list_request(
511
527
 
512
528
  comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist"))
513
529
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
514
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
530
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
515
531
  accept = _headers.pop("Accept", "application/xml")
516
532
 
517
533
  # Construct URL
@@ -617,7 +633,7 @@ def build_get_block_list_request(
617
633
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
618
634
 
619
635
  comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist"))
620
- version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
636
+ version: Literal["2025-01-05"] = kwargs.pop("version", _headers.pop("x-ms-version", "2025-01-05"))
621
637
  accept = _headers.pop("Accept", "application/xml")
622
638
 
623
639
  # Construct URL
@@ -683,6 +699,8 @@ class BlockBlobOperations:
683
699
  immutability_policy_mode: Optional[Union[str, _models.BlobImmutabilityPolicyMode]] = None,
684
700
  legal_hold: Optional[bool] = None,
685
701
  transactional_content_crc64: Optional[bytes] = None,
702
+ structured_body_type: Optional[str] = None,
703
+ structured_content_length: Optional[int] = None,
686
704
  blob_http_headers: Optional[_models.BlobHTTPHeaders] = None,
687
705
  lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
688
706
  cpk_info: Optional[_models.CpkInfo] = None,
@@ -690,6 +708,7 @@ class BlockBlobOperations:
690
708
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
691
709
  **kwargs: Any
692
710
  ) -> None:
711
+ # pylint: disable=line-too-long
693
712
  """The Upload Block Blob operation updates the content of an existing block blob. Updating an
694
713
  existing block blob overwrites any existing metadata on the blob. Partial updates are not
695
714
  supported with Put Blob; the content of the existing blob is overwritten with the content of
@@ -738,6 +757,13 @@ class BlockBlobOperations:
738
757
  :param transactional_content_crc64: Specify the transactional crc64 for the body, to be
739
758
  validated by the service. Default value is None.
740
759
  :type transactional_content_crc64: bytes
760
+ :param structured_body_type: Required if the request body is a structured message. Specifies
761
+ the message schema version and properties. Default value is None.
762
+ :type structured_body_type: str
763
+ :param structured_content_length: Required if the request body is a structured message.
764
+ Specifies the length of the blob/file content inside the message body. Will always be smaller
765
+ than Content-Length. Default value is None.
766
+ :type structured_content_length: int
741
767
  :param blob_http_headers: Parameter group. Default value is None.
742
768
  :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders
743
769
  :param lease_access_conditions: Parameter group. Default value is None.
@@ -752,7 +778,7 @@ class BlockBlobOperations:
752
778
  :rtype: None
753
779
  :raises ~azure.core.exceptions.HttpResponseError:
754
780
  """
755
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
781
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
756
782
  401: ClientAuthenticationError,
757
783
  404: ResourceNotFoundError,
758
784
  409: ResourceExistsError,
@@ -835,6 +861,8 @@ class BlockBlobOperations:
835
861
  immutability_policy_mode=immutability_policy_mode,
836
862
  legal_hold=legal_hold,
837
863
  transactional_content_crc64=transactional_content_crc64,
864
+ structured_body_type=structured_body_type,
865
+ structured_content_length=structured_content_length,
838
866
  blob_type=blob_type,
839
867
  content_type=content_type,
840
868
  version=self._config.version,
@@ -876,6 +904,9 @@ class BlockBlobOperations:
876
904
  response_headers["x-ms-encryption-scope"] = self._deserialize(
877
905
  "str", response.headers.get("x-ms-encryption-scope")
878
906
  )
907
+ response_headers["x-ms-structured-body"] = self._deserialize(
908
+ "str", response.headers.get("x-ms-structured-body")
909
+ )
879
910
 
880
911
  if cls:
881
912
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -903,6 +934,7 @@ class BlockBlobOperations:
903
934
  source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
904
935
  **kwargs: Any
905
936
  ) -> None:
937
+ # pylint: disable=line-too-long
906
938
  """The Put Blob from URL operation creates a new Block Blob where the contents of the blob are
907
939
  read from a given URL. This API is supported beginning with the 2020-04-08 version. Partial
908
940
  updates are not supported with Put Blob from URL; the content of an existing blob is
@@ -973,7 +1005,7 @@ class BlockBlobOperations:
973
1005
  :rtype: None
974
1006
  :raises ~azure.core.exceptions.HttpResponseError:
975
1007
  """
976
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1008
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
977
1009
  401: ClientAuthenticationError,
978
1010
  404: ResourceNotFoundError,
979
1011
  409: ResourceExistsError,
@@ -1124,11 +1156,14 @@ class BlockBlobOperations:
1124
1156
  transactional_content_crc64: Optional[bytes] = None,
1125
1157
  timeout: Optional[int] = None,
1126
1158
  request_id_parameter: Optional[str] = None,
1159
+ structured_body_type: Optional[str] = None,
1160
+ structured_content_length: Optional[int] = None,
1127
1161
  lease_access_conditions: Optional[_models.LeaseAccessConditions] = None,
1128
1162
  cpk_info: Optional[_models.CpkInfo] = None,
1129
1163
  cpk_scope_info: Optional[_models.CpkScopeInfo] = None,
1130
1164
  **kwargs: Any
1131
1165
  ) -> None:
1166
+ # pylint: disable=line-too-long
1132
1167
  """The Stage Block operation creates a new block to be committed as part of a blob.
1133
1168
 
1134
1169
  :param block_id: A valid Base64 string value that identifies the block. Prior to encoding, the
@@ -1154,6 +1189,13 @@ class BlockBlobOperations:
1154
1189
  limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
1155
1190
  value is None.
1156
1191
  :type request_id_parameter: str
1192
+ :param structured_body_type: Required if the request body is a structured message. Specifies
1193
+ the message schema version and properties. Default value is None.
1194
+ :type structured_body_type: str
1195
+ :param structured_content_length: Required if the request body is a structured message.
1196
+ Specifies the length of the blob/file content inside the message body. Will always be smaller
1197
+ than Content-Length. Default value is None.
1198
+ :type structured_content_length: int
1157
1199
  :param lease_access_conditions: Parameter group. Default value is None.
1158
1200
  :type lease_access_conditions: ~azure.storage.blob.models.LeaseAccessConditions
1159
1201
  :param cpk_info: Parameter group. Default value is None.
@@ -1164,7 +1206,7 @@ class BlockBlobOperations:
1164
1206
  :rtype: None
1165
1207
  :raises ~azure.core.exceptions.HttpResponseError:
1166
1208
  """
1167
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1209
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1168
1210
  401: ClientAuthenticationError,
1169
1211
  404: ResourceNotFoundError,
1170
1212
  409: ResourceExistsError,
@@ -1207,6 +1249,8 @@ class BlockBlobOperations:
1207
1249
  encryption_algorithm=_encryption_algorithm,
1208
1250
  encryption_scope=_encryption_scope,
1209
1251
  request_id_parameter=request_id_parameter,
1252
+ structured_body_type=structured_body_type,
1253
+ structured_content_length=structured_content_length,
1210
1254
  comp=comp,
1211
1255
  content_type=content_type,
1212
1256
  version=self._config.version,
@@ -1248,6 +1292,9 @@ class BlockBlobOperations:
1248
1292
  response_headers["x-ms-encryption-scope"] = self._deserialize(
1249
1293
  "str", response.headers.get("x-ms-encryption-scope")
1250
1294
  )
1295
+ response_headers["x-ms-structured-body"] = self._deserialize(
1296
+ "str", response.headers.get("x-ms-structured-body")
1297
+ )
1251
1298
 
1252
1299
  if cls:
1253
1300
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -1270,6 +1317,7 @@ class BlockBlobOperations:
1270
1317
  source_modified_access_conditions: Optional[_models.SourceModifiedAccessConditions] = None,
1271
1318
  **kwargs: Any
1272
1319
  ) -> None:
1320
+ # pylint: disable=line-too-long
1273
1321
  """The Stage Block operation creates a new block to be committed as part of a blob where the
1274
1322
  contents are read from a URL.
1275
1323
 
@@ -1314,7 +1362,7 @@ class BlockBlobOperations:
1314
1362
  :rtype: None
1315
1363
  :raises ~azure.core.exceptions.HttpResponseError:
1316
1364
  """
1317
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1365
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1318
1366
  401: ClientAuthenticationError,
1319
1367
  404: ResourceNotFoundError,
1320
1368
  409: ResourceExistsError,
@@ -1435,6 +1483,7 @@ class BlockBlobOperations:
1435
1483
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
1436
1484
  **kwargs: Any
1437
1485
  ) -> None:
1486
+ # pylint: disable=line-too-long
1438
1487
  """The Commit Block List operation writes a blob by specifying the list of block IDs that make up
1439
1488
  the blob. In order to be written as part of a blob, a block must have been successfully written
1440
1489
  to the server in a prior Put Block operation. You can call Put Block List to update a blob by
@@ -1497,7 +1546,7 @@ class BlockBlobOperations:
1497
1546
  :rtype: None
1498
1547
  :raises ~azure.core.exceptions.HttpResponseError:
1499
1548
  """
1500
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1549
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1501
1550
  401: ClientAuthenticationError,
1502
1551
  404: ResourceNotFoundError,
1503
1552
  409: ResourceExistsError,
@@ -1638,6 +1687,7 @@ class BlockBlobOperations:
1638
1687
  modified_access_conditions: Optional[_models.ModifiedAccessConditions] = None,
1639
1688
  **kwargs: Any
1640
1689
  ) -> _models.BlockList:
1690
+ # pylint: disable=line-too-long
1641
1691
  """The Get Block List operation retrieves the list of blocks that have been uploaded as part of a
1642
1692
  block blob.
1643
1693
 
@@ -1668,7 +1718,7 @@ class BlockBlobOperations:
1668
1718
  :rtype: ~azure.storage.blob.models.BlockList
1669
1719
  :raises ~azure.core.exceptions.HttpResponseError:
1670
1720
  """
1671
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
1721
+ error_map: MutableMapping[int, Type[HttpResponseError]] = { # pylint: disable=unsubscriptable-object
1672
1722
  401: ClientAuthenticationError,
1673
1723
  404: ResourceNotFoundError,
1674
1724
  409: ResourceExistsError,