azure-storage-blob 12.20.0b1__py3-none-any.whl → 12.21.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 (50) hide show
  1. azure/storage/blob/__init__.py +12 -2
  2. azure/storage/blob/_blob_client.py +64 -51
  3. azure/storage/blob/_blob_service_client.py +17 -12
  4. azure/storage/blob/_container_client.py +33 -23
  5. azure/storage/blob/_download.py +277 -167
  6. azure/storage/blob/_generated/_azure_blob_storage.py +1 -1
  7. azure/storage/blob/_generated/_configuration.py +2 -2
  8. azure/storage/blob/_generated/_patch.py +2 -0
  9. azure/storage/blob/_generated/_serialization.py +1 -1
  10. azure/storage/blob/_generated/aio/_azure_blob_storage.py +1 -1
  11. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  12. azure/storage/blob/_generated/aio/_patch.py +2 -0
  13. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +10 -5
  14. azure/storage/blob/_generated/aio/operations/_blob_operations.py +45 -26
  15. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +12 -7
  16. azure/storage/blob/_generated/aio/operations/_container_operations.py +39 -20
  17. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +15 -10
  18. azure/storage/blob/_generated/aio/operations/_patch.py +3 -0
  19. azure/storage/blob/_generated/aio/operations/_service_operations.py +28 -10
  20. azure/storage/blob/_generated/models/_patch.py +3 -0
  21. azure/storage/blob/_generated/operations/_append_blob_operations.py +14 -9
  22. azure/storage/blob/_generated/operations/_blob_operations.py +76 -51
  23. azure/storage/blob/_generated/operations/_block_blob_operations.py +18 -13
  24. azure/storage/blob/_generated/operations/_container_operations.py +64 -39
  25. azure/storage/blob/_generated/operations/_page_blob_operations.py +24 -19
  26. azure/storage/blob/_generated/operations/_patch.py +3 -0
  27. azure/storage/blob/_generated/operations/_service_operations.py +43 -19
  28. azure/storage/blob/_generated/py.typed +1 -0
  29. azure/storage/blob/_lease.py +6 -5
  30. azure/storage/blob/_models.py +1 -1
  31. azure/storage/blob/_serialize.py +1 -0
  32. azure/storage/blob/_shared/authentication.py +62 -4
  33. azure/storage/blob/_shared/base_client.py +1 -1
  34. azure/storage/blob/_shared/base_client_async.py +3 -2
  35. azure/storage/blob/_shared/models.py +13 -12
  36. azure/storage/blob/_shared/shared_access_signature.py +1 -0
  37. azure/storage/blob/_shared_access_signature.py +1 -0
  38. azure/storage/blob/_version.py +1 -1
  39. azure/storage/blob/aio/__init__.py +13 -4
  40. azure/storage/blob/aio/_blob_client_async.py +50 -47
  41. azure/storage/blob/aio/_blob_service_client_async.py +11 -11
  42. azure/storage/blob/aio/_container_client_async.py +23 -20
  43. azure/storage/blob/aio/_download_async.py +317 -209
  44. azure/storage/blob/aio/_lease_async.py +6 -6
  45. {azure_storage_blob-12.20.0b1.dist-info → azure_storage_blob-12.21.0.dist-info}/METADATA +2 -2
  46. azure_storage_blob-12.21.0.dist-info/RECORD +82 -0
  47. azure_storage_blob-12.20.0b1.dist-info/RECORD +0 -81
  48. {azure_storage_blob-12.20.0b1.dist-info → azure_storage_blob-12.21.0.dist-info}/LICENSE +0 -0
  49. {azure_storage_blob-12.20.0b1.dist-info → azure_storage_blob-12.21.0.dist-info}/WHEEL +0 -0
  50. {azure_storage_blob-12.20.0b1.dist-info → azure_storage_blob-12.21.0.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,8 @@
7
7
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
8
  # --------------------------------------------------------------------------
9
9
  import datetime
10
- from typing import Any, Callable, Dict, Iterator, Literal, Optional, TypeVar, Union
10
+ import sys
11
+ from typing import Any, Callable, Dict, Iterator, Literal, Optional, Type, TypeVar, Union
11
12
 
12
13
  from azure.core.exceptions import (
13
14
  ClientAuthenticationError,
@@ -27,6 +28,10 @@ from .. import models as _models
27
28
  from .._serialization import Serializer
28
29
  from .._vendor import _convert_request
29
30
 
31
+ if sys.version_info >= (3, 9):
32
+ from collections.abc import MutableMapping
33
+ else:
34
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
30
35
  T = TypeVar("T")
31
36
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
32
37
 
@@ -58,7 +63,7 @@ def build_download_request(
58
63
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
59
64
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
60
65
 
61
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
66
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
62
67
  accept = _headers.pop("Accept", "application/xml")
63
68
 
64
69
  # Construct URL
@@ -137,7 +142,7 @@ def build_get_properties_request(
137
142
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
138
143
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
139
144
 
140
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
145
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
141
146
  accept = _headers.pop("Accept", "application/xml")
142
147
 
143
148
  # Construct URL
@@ -205,7 +210,7 @@ def build_delete_request(
205
210
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
206
211
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
207
212
 
208
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
213
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
209
214
  accept = _headers.pop("Accept", "application/xml")
210
215
 
211
216
  # Construct URL
@@ -256,7 +261,7 @@ def build_undelete_request(
256
261
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
257
262
 
258
263
  comp: Literal["undelete"] = kwargs.pop("comp", _params.pop("comp", "undelete"))
259
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
264
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
260
265
  accept = _headers.pop("Accept", "application/xml")
261
266
 
262
267
  # Construct URL
@@ -294,7 +299,7 @@ def build_set_expiry_request(
294
299
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
295
300
 
296
301
  comp: Literal["expiry"] = kwargs.pop("comp", _params.pop("comp", "expiry"))
297
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
302
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
298
303
  accept = _headers.pop("Accept", "application/xml")
299
304
 
300
305
  # Construct URL
@@ -345,7 +350,7 @@ def build_set_http_headers_request(
345
350
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
346
351
 
347
352
  comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties"))
348
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
353
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
349
354
  accept = _headers.pop("Accept", "application/xml")
350
355
 
351
356
  # Construct URL
@@ -414,7 +419,7 @@ def build_set_immutability_policy_request(
414
419
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
415
420
 
416
421
  comp: Literal["immutabilityPolicies"] = kwargs.pop("comp", _params.pop("comp", "immutabilityPolicies"))
417
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
422
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
418
423
  accept = _headers.pop("Accept", "application/xml")
419
424
 
420
425
  # Construct URL
@@ -456,7 +461,7 @@ def build_delete_immutability_policy_request(
456
461
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
457
462
 
458
463
  comp: Literal["immutabilityPolicies"] = kwargs.pop("comp", _params.pop("comp", "immutabilityPolicies"))
459
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
464
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
460
465
  accept = _headers.pop("Accept", "application/xml")
461
466
 
462
467
  # Construct URL
@@ -493,7 +498,7 @@ def build_set_legal_hold_request(
493
498
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
494
499
 
495
500
  comp: Literal["legalhold"] = kwargs.pop("comp", _params.pop("comp", "legalhold"))
496
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
501
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
497
502
  accept = _headers.pop("Accept", "application/xml")
498
503
 
499
504
  # Construct URL
@@ -541,7 +546,7 @@ def build_set_metadata_request(
541
546
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
542
547
 
543
548
  comp: Literal["metadata"] = kwargs.pop("comp", _params.pop("comp", "metadata"))
544
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
549
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
545
550
  accept = _headers.pop("Accept", "application/xml")
546
551
 
547
552
  # Construct URL
@@ -609,7 +614,7 @@ def build_acquire_lease_request(
609
614
 
610
615
  comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease"))
611
616
  action: Literal["acquire"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "acquire"))
612
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
617
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
613
618
  accept = _headers.pop("Accept", "application/xml")
614
619
 
615
620
  # Construct URL
@@ -667,7 +672,7 @@ def build_release_lease_request(
667
672
 
668
673
  comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease"))
669
674
  action: Literal["release"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "release"))
670
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
675
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
671
676
  accept = _headers.pop("Accept", "application/xml")
672
677
 
673
678
  # Construct URL
@@ -722,7 +727,7 @@ def build_renew_lease_request(
722
727
 
723
728
  comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease"))
724
729
  action: Literal["renew"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "renew"))
725
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
730
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
726
731
  accept = _headers.pop("Accept", "application/xml")
727
732
 
728
733
  # Construct URL
@@ -778,7 +783,7 @@ def build_change_lease_request(
778
783
 
779
784
  comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease"))
780
785
  action: Literal["change"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "change"))
781
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
786
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
782
787
  accept = _headers.pop("Accept", "application/xml")
783
788
 
784
789
  # Construct URL
@@ -834,7 +839,7 @@ def build_break_lease_request(
834
839
 
835
840
  comp: Literal["lease"] = kwargs.pop("comp", _params.pop("comp", "lease"))
836
841
  action: Literal["break"] = kwargs.pop("action", _headers.pop("x-ms-lease-action", "break"))
837
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
842
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
838
843
  accept = _headers.pop("Accept", "application/xml")
839
844
 
840
845
  # Construct URL
@@ -894,7 +899,7 @@ def build_create_snapshot_request(
894
899
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
895
900
 
896
901
  comp: Literal["snapshot"] = kwargs.pop("comp", _params.pop("comp", "snapshot"))
897
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
902
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
898
903
  accept = _headers.pop("Accept", "application/xml")
899
904
 
900
905
  # Construct URL
@@ -973,7 +978,7 @@ def build_start_copy_from_url_request(
973
978
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
974
979
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
975
980
 
976
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
981
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
977
982
  accept = _headers.pop("Accept", "application/xml")
978
983
 
979
984
  # Construct URL
@@ -1076,7 +1081,7 @@ def build_copy_from_url_request(
1076
1081
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1077
1082
 
1078
1083
  x_ms_requires_sync: Literal["true"] = kwargs.pop("x_ms_requires_sync", _headers.pop("x-ms-requires-sync", "true"))
1079
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1084
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1080
1085
  accept = _headers.pop("Accept", "application/xml")
1081
1086
 
1082
1087
  # Construct URL
@@ -1168,7 +1173,7 @@ def build_abort_copy_from_url_request(
1168
1173
  copy_action_abort_constant: Literal["abort"] = kwargs.pop(
1169
1174
  "copy_action_abort_constant", _headers.pop("x-ms-copy-action", "abort")
1170
1175
  )
1171
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1176
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1172
1177
  accept = _headers.pop("Accept", "application/xml")
1173
1178
 
1174
1179
  # Construct URL
@@ -1214,7 +1219,7 @@ def build_set_tier_request(
1214
1219
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1215
1220
 
1216
1221
  comp: Literal["tier"] = kwargs.pop("comp", _params.pop("comp", "tier"))
1217
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1222
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1218
1223
  accept = _headers.pop("Accept", "application/xml")
1219
1224
 
1220
1225
  # Construct URL
@@ -1250,13 +1255,15 @@ def build_set_tier_request(
1250
1255
  return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
1251
1256
 
1252
1257
 
1253
- def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
1258
+ def build_get_account_info_request(
1259
+ url: str, *, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
1260
+ ) -> HttpRequest:
1254
1261
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
1255
1262
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1256
1263
 
1257
1264
  restype: Literal["account"] = kwargs.pop("restype", _params.pop("restype", "account"))
1258
1265
  comp: Literal["properties"] = kwargs.pop("comp", _params.pop("comp", "properties"))
1259
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1266
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1260
1267
  accept = _headers.pop("Accept", "application/xml")
1261
1268
 
1262
1269
  # Construct URL
@@ -1270,9 +1277,13 @@ def build_get_account_info_request(url: str, **kwargs: Any) -> HttpRequest:
1270
1277
  # Construct parameters
1271
1278
  _params["restype"] = _SERIALIZER.query("restype", restype, "str")
1272
1279
  _params["comp"] = _SERIALIZER.query("comp", comp, "str")
1280
+ if timeout is not None:
1281
+ _params["timeout"] = _SERIALIZER.query("timeout", timeout, "int", minimum=0)
1273
1282
 
1274
1283
  # Construct headers
1275
1284
  _headers["x-ms-version"] = _SERIALIZER.header("version", version, "str")
1285
+ if request_id_parameter is not None:
1286
+ _headers["x-ms-client-request-id"] = _SERIALIZER.header("request_id_parameter", request_id_parameter, "str")
1276
1287
  _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
1277
1288
 
1278
1289
  return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
@@ -1301,7 +1312,7 @@ def build_query_request(
1301
1312
 
1302
1313
  comp: Literal["query"] = kwargs.pop("comp", _params.pop("comp", "query"))
1303
1314
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1304
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1315
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1305
1316
  accept = _headers.pop("Accept", "application/xml")
1306
1317
 
1307
1318
  # Construct URL
@@ -1365,7 +1376,7 @@ def build_get_tags_request(
1365
1376
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
1366
1377
 
1367
1378
  comp: Literal["tags"] = kwargs.pop("comp", _params.pop("comp", "tags"))
1368
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1379
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1369
1380
  accept = _headers.pop("Accept", "application/xml")
1370
1381
 
1371
1382
  # Construct URL
@@ -1416,7 +1427,7 @@ def build_set_tags_request(
1416
1427
 
1417
1428
  comp: Literal["tags"] = kwargs.pop("comp", _params.pop("comp", "tags"))
1418
1429
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
1419
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
1430
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
1420
1431
  accept = _headers.pop("Accept", "application/xml")
1421
1432
 
1422
1433
  # Construct URL
@@ -1533,7 +1544,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1533
1544
  :rtype: Iterator[bytes]
1534
1545
  :raises ~azure.core.exceptions.HttpResponseError:
1535
1546
  """
1536
- error_map = {
1547
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1537
1548
  401: ClientAuthenticationError,
1538
1549
  404: ResourceNotFoundError,
1539
1550
  409: ResourceExistsError,
@@ -1820,7 +1831,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1820
1831
  :rtype: None
1821
1832
  :raises ~azure.core.exceptions.HttpResponseError:
1822
1833
  """
1823
- error_map = {
1834
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1824
1835
  401: ClientAuthenticationError,
1825
1836
  404: ResourceNotFoundError,
1826
1837
  409: ResourceExistsError,
@@ -2041,7 +2052,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2041
2052
  :rtype: None
2042
2053
  :raises ~azure.core.exceptions.HttpResponseError:
2043
2054
  """
2044
- error_map = {
2055
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2045
2056
  401: ClientAuthenticationError,
2046
2057
  404: ResourceNotFoundError,
2047
2058
  409: ResourceExistsError,
@@ -2132,7 +2143,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2132
2143
  :rtype: None
2133
2144
  :raises ~azure.core.exceptions.HttpResponseError:
2134
2145
  """
2135
- error_map = {
2146
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2136
2147
  401: ClientAuthenticationError,
2137
2148
  404: ResourceNotFoundError,
2138
2149
  409: ResourceExistsError,
@@ -2210,7 +2221,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2210
2221
  :rtype: None
2211
2222
  :raises ~azure.core.exceptions.HttpResponseError:
2212
2223
  """
2213
- error_map = {
2224
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2214
2225
  401: ClientAuthenticationError,
2215
2226
  404: ResourceNotFoundError,
2216
2227
  409: ResourceExistsError,
@@ -2294,7 +2305,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2294
2305
  :rtype: None
2295
2306
  :raises ~azure.core.exceptions.HttpResponseError:
2296
2307
  """
2297
- error_map = {
2308
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2298
2309
  401: ClientAuthenticationError,
2299
2310
  404: ResourceNotFoundError,
2300
2311
  409: ResourceExistsError,
@@ -2421,7 +2432,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2421
2432
  :rtype: None
2422
2433
  :raises ~azure.core.exceptions.HttpResponseError:
2423
2434
  """
2424
- error_map = {
2435
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2425
2436
  401: ClientAuthenticationError,
2426
2437
  404: ResourceNotFoundError,
2427
2438
  409: ResourceExistsError,
@@ -2502,7 +2513,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2502
2513
  :rtype: None
2503
2514
  :raises ~azure.core.exceptions.HttpResponseError:
2504
2515
  """
2505
- error_map = {
2516
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2506
2517
  401: ClientAuthenticationError,
2507
2518
  404: ResourceNotFoundError,
2508
2519
  409: ResourceExistsError,
@@ -2572,7 +2583,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2572
2583
  :rtype: None
2573
2584
  :raises ~azure.core.exceptions.HttpResponseError:
2574
2585
  """
2575
- error_map = {
2586
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2576
2587
  401: ClientAuthenticationError,
2577
2588
  404: ResourceNotFoundError,
2578
2589
  409: ResourceExistsError,
@@ -2667,7 +2678,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2667
2678
  :rtype: None
2668
2679
  :raises ~azure.core.exceptions.HttpResponseError:
2669
2680
  """
2670
- error_map = {
2681
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2671
2682
  401: ClientAuthenticationError,
2672
2683
  404: ResourceNotFoundError,
2673
2684
  409: ResourceExistsError,
@@ -2800,7 +2811,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2800
2811
  :rtype: None
2801
2812
  :raises ~azure.core.exceptions.HttpResponseError:
2802
2813
  """
2803
- error_map = {
2814
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2804
2815
  401: ClientAuthenticationError,
2805
2816
  404: ResourceNotFoundError,
2806
2817
  409: ResourceExistsError,
@@ -2902,7 +2913,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2902
2913
  :rtype: None
2903
2914
  :raises ~azure.core.exceptions.HttpResponseError:
2904
2915
  """
2905
- error_map = {
2916
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2906
2917
  401: ClientAuthenticationError,
2907
2918
  404: ResourceNotFoundError,
2908
2919
  409: ResourceExistsError,
@@ -3002,7 +3013,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3002
3013
  :rtype: None
3003
3014
  :raises ~azure.core.exceptions.HttpResponseError:
3004
3015
  """
3005
- error_map = {
3016
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3006
3017
  401: ClientAuthenticationError,
3007
3018
  404: ResourceNotFoundError,
3008
3019
  409: ResourceExistsError,
@@ -3108,7 +3119,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3108
3119
  :rtype: None
3109
3120
  :raises ~azure.core.exceptions.HttpResponseError:
3110
3121
  """
3111
- error_map = {
3122
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3112
3123
  401: ClientAuthenticationError,
3113
3124
  404: ResourceNotFoundError,
3114
3125
  409: ResourceExistsError,
@@ -3216,7 +3227,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3216
3227
  :rtype: None
3217
3228
  :raises ~azure.core.exceptions.HttpResponseError:
3218
3229
  """
3219
- error_map = {
3230
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3220
3231
  401: ClientAuthenticationError,
3221
3232
  404: ResourceNotFoundError,
3222
3233
  409: ResourceExistsError,
@@ -3331,7 +3342,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3331
3342
  :rtype: None
3332
3343
  :raises ~azure.core.exceptions.HttpResponseError:
3333
3344
  """
3334
- error_map = {
3345
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3335
3346
  401: ClientAuthenticationError,
3336
3347
  404: ResourceNotFoundError,
3337
3348
  409: ResourceExistsError,
@@ -3498,7 +3509,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3498
3509
  :rtype: None
3499
3510
  :raises ~azure.core.exceptions.HttpResponseError:
3500
3511
  """
3501
- error_map = {
3512
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3502
3513
  401: ClientAuthenticationError,
3503
3514
  404: ResourceNotFoundError,
3504
3515
  409: ResourceExistsError,
@@ -3680,7 +3691,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3680
3691
  :rtype: None
3681
3692
  :raises ~azure.core.exceptions.HttpResponseError:
3682
3693
  """
3683
- error_map = {
3694
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3684
3695
  401: ClientAuthenticationError,
3685
3696
  404: ResourceNotFoundError,
3686
3697
  409: ResourceExistsError,
@@ -3821,7 +3832,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3821
3832
  :rtype: None
3822
3833
  :raises ~azure.core.exceptions.HttpResponseError:
3823
3834
  """
3824
- error_map = {
3835
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3825
3836
  401: ClientAuthenticationError,
3826
3837
  404: ResourceNotFoundError,
3827
3838
  409: ResourceExistsError,
@@ -3933,7 +3944,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3933
3944
  :rtype: None
3934
3945
  :raises ~azure.core.exceptions.HttpResponseError:
3935
3946
  """
3936
- error_map = {
3947
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3937
3948
  401: ClientAuthenticationError,
3938
3949
  404: ResourceNotFoundError,
3939
3950
  409: ResourceExistsError,
@@ -4003,14 +4014,25 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4003
4014
  return cls(pipeline_response, None, response_headers) # type: ignore
4004
4015
 
4005
4016
  @distributed_trace
4006
- def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
4017
+ def get_account_info( # pylint: disable=inconsistent-return-statements
4018
+ self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
4019
+ ) -> None:
4007
4020
  """Returns the sku name and account kind.
4008
4021
 
4022
+ :param timeout: The timeout parameter is expressed in seconds. For more information, see
4023
+ :code:`<a
4024
+ href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
4025
+ Timeouts for Blob Service Operations.</a>`. Default value is None.
4026
+ :type timeout: int
4027
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
4028
+ limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
4029
+ value is None.
4030
+ :type request_id_parameter: str
4009
4031
  :return: None or the result of cls(response)
4010
4032
  :rtype: None
4011
4033
  :raises ~azure.core.exceptions.HttpResponseError:
4012
4034
  """
4013
- error_map = {
4035
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
4014
4036
  401: ClientAuthenticationError,
4015
4037
  404: ResourceNotFoundError,
4016
4038
  409: ResourceExistsError,
@@ -4027,6 +4049,8 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4027
4049
 
4028
4050
  _request = build_get_account_info_request(
4029
4051
  url=self._config.url,
4052
+ timeout=timeout,
4053
+ request_id_parameter=request_id_parameter,
4030
4054
  restype=restype,
4031
4055
  comp=comp,
4032
4056
  version=self._config.version,
@@ -4057,6 +4081,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4057
4081
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
4058
4082
  response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
4059
4083
  response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
4084
+ response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))
4060
4085
 
4061
4086
  if cls:
4062
4087
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -4103,7 +4128,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4103
4128
  :rtype: Iterator[bytes]
4104
4129
  :raises ~azure.core.exceptions.HttpResponseError:
4105
4130
  """
4106
- error_map = {
4131
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
4107
4132
  401: ClientAuthenticationError,
4108
4133
  404: ResourceNotFoundError,
4109
4134
  409: ResourceExistsError,
@@ -4349,7 +4374,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4349
4374
  :rtype: ~azure.storage.blob.models.BlobTags
4350
4375
  :raises ~azure.core.exceptions.HttpResponseError:
4351
4376
  """
4352
- error_map = {
4377
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
4353
4378
  401: ClientAuthenticationError,
4354
4379
  404: ResourceNotFoundError,
4355
4380
  409: ResourceExistsError,
@@ -4457,7 +4482,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
4457
4482
  :rtype: None
4458
4483
  :raises ~azure.core.exceptions.HttpResponseError:
4459
4484
  """
4460
- error_map = {
4485
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
4461
4486
  401: ClientAuthenticationError,
4462
4487
  404: ResourceNotFoundError,
4463
4488
  409: ResourceExistsError,
@@ -7,7 +7,8 @@
7
7
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
8
  # --------------------------------------------------------------------------
9
9
  import datetime
10
- from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union
10
+ import sys
11
+ from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union
11
12
 
12
13
  from azure.core.exceptions import (
13
14
  ClientAuthenticationError,
@@ -27,6 +28,10 @@ from .. import models as _models
27
28
  from .._serialization import Serializer
28
29
  from .._vendor import _convert_request
29
30
 
31
+ if sys.version_info >= (3, 9):
32
+ from collections.abc import MutableMapping
33
+ else:
34
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
30
35
  T = TypeVar("T")
31
36
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
32
37
 
@@ -72,7 +77,7 @@ def build_upload_request(
72
77
 
73
78
  blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob"))
74
79
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
75
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
80
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
76
81
  accept = _headers.pop("Accept", "application/xml")
77
82
 
78
83
  # Construct URL
@@ -206,7 +211,7 @@ def build_put_blob_from_url_request(
206
211
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
207
212
 
208
213
  blob_type: Literal["BlockBlob"] = kwargs.pop("blob_type", _headers.pop("x-ms-blob-type", "BlockBlob"))
209
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
214
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
210
215
  accept = _headers.pop("Accept", "application/xml")
211
216
 
212
217
  # Construct URL
@@ -331,7 +336,7 @@ def build_stage_block_request(
331
336
 
332
337
  comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block"))
333
338
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
334
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
339
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
335
340
  accept = _headers.pop("Accept", "application/xml")
336
341
 
337
342
  # Construct URL
@@ -407,7 +412,7 @@ def build_stage_block_from_url_request(
407
412
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
408
413
 
409
414
  comp: Literal["block"] = kwargs.pop("comp", _params.pop("comp", "block"))
410
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
415
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
411
416
  accept = _headers.pop("Accept", "application/xml")
412
417
 
413
418
  # Construct URL
@@ -508,7 +513,7 @@ def build_commit_block_list_request(
508
513
 
509
514
  comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist"))
510
515
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
511
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
516
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
512
517
  accept = _headers.pop("Accept", "application/xml")
513
518
 
514
519
  # Construct URL
@@ -614,7 +619,7 @@ def build_get_block_list_request(
614
619
  _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
615
620
 
616
621
  comp: Literal["blocklist"] = kwargs.pop("comp", _params.pop("comp", "blocklist"))
617
- version: Literal["2021-12-02"] = kwargs.pop("version", _headers.pop("x-ms-version", "2021-12-02"))
622
+ version: Literal["2024-08-04"] = kwargs.pop("version", _headers.pop("x-ms-version", "2024-08-04"))
618
623
  accept = _headers.pop("Accept", "application/xml")
619
624
 
620
625
  # Construct URL
@@ -749,7 +754,7 @@ class BlockBlobOperations:
749
754
  :rtype: None
750
755
  :raises ~azure.core.exceptions.HttpResponseError:
751
756
  """
752
- error_map = {
757
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
753
758
  401: ClientAuthenticationError,
754
759
  404: ResourceNotFoundError,
755
760
  409: ResourceExistsError,
@@ -971,7 +976,7 @@ class BlockBlobOperations:
971
976
  :rtype: None
972
977
  :raises ~azure.core.exceptions.HttpResponseError:
973
978
  """
974
- error_map = {
979
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
975
980
  401: ClientAuthenticationError,
976
981
  404: ResourceNotFoundError,
977
982
  409: ResourceExistsError,
@@ -1163,7 +1168,7 @@ class BlockBlobOperations:
1163
1168
  :rtype: None
1164
1169
  :raises ~azure.core.exceptions.HttpResponseError:
1165
1170
  """
1166
- error_map = {
1171
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1167
1172
  401: ClientAuthenticationError,
1168
1173
  404: ResourceNotFoundError,
1169
1174
  409: ResourceExistsError,
@@ -1314,7 +1319,7 @@ class BlockBlobOperations:
1314
1319
  :rtype: None
1315
1320
  :raises ~azure.core.exceptions.HttpResponseError:
1316
1321
  """
1317
- error_map = {
1322
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1318
1323
  401: ClientAuthenticationError,
1319
1324
  404: ResourceNotFoundError,
1320
1325
  409: ResourceExistsError,
@@ -1498,7 +1503,7 @@ class BlockBlobOperations:
1498
1503
  :rtype: None
1499
1504
  :raises ~azure.core.exceptions.HttpResponseError:
1500
1505
  """
1501
- error_map = {
1506
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1502
1507
  401: ClientAuthenticationError,
1503
1508
  404: ResourceNotFoundError,
1504
1509
  409: ResourceExistsError,
@@ -1670,7 +1675,7 @@ class BlockBlobOperations:
1670
1675
  :rtype: ~azure.storage.blob.models.BlockList
1671
1676
  :raises ~azure.core.exceptions.HttpResponseError:
1672
1677
  """
1673
- error_map = {
1678
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1674
1679
  401: ClientAuthenticationError,
1675
1680
  404: ResourceNotFoundError,
1676
1681
  409: ResourceExistsError,