azure-storage-blob 12.20.0__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 (44) hide show
  1. azure/storage/blob/_blob_client.py +53 -48
  2. azure/storage/blob/_blob_service_client.py +11 -11
  3. azure/storage/blob/_container_client.py +22 -20
  4. azure/storage/blob/_download.py +277 -167
  5. azure/storage/blob/_generated/_azure_blob_storage.py +1 -1
  6. azure/storage/blob/_generated/_configuration.py +2 -2
  7. azure/storage/blob/_generated/_patch.py +2 -0
  8. azure/storage/blob/_generated/_serialization.py +1 -1
  9. azure/storage/blob/_generated/aio/_azure_blob_storage.py +1 -1
  10. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  11. azure/storage/blob/_generated/aio/_patch.py +2 -0
  12. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +10 -5
  13. azure/storage/blob/_generated/aio/operations/_blob_operations.py +45 -26
  14. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +12 -7
  15. azure/storage/blob/_generated/aio/operations/_container_operations.py +39 -20
  16. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +15 -10
  17. azure/storage/blob/_generated/aio/operations/_patch.py +3 -0
  18. azure/storage/blob/_generated/aio/operations/_service_operations.py +28 -10
  19. azure/storage/blob/_generated/models/_patch.py +3 -0
  20. azure/storage/blob/_generated/operations/_append_blob_operations.py +14 -9
  21. azure/storage/blob/_generated/operations/_blob_operations.py +76 -51
  22. azure/storage/blob/_generated/operations/_block_blob_operations.py +18 -13
  23. azure/storage/blob/_generated/operations/_container_operations.py +64 -39
  24. azure/storage/blob/_generated/operations/_page_blob_operations.py +24 -19
  25. azure/storage/blob/_generated/operations/_patch.py +3 -0
  26. azure/storage/blob/_generated/operations/_service_operations.py +43 -19
  27. azure/storage/blob/_generated/py.typed +1 -0
  28. azure/storage/blob/_lease.py +5 -5
  29. azure/storage/blob/_models.py +1 -1
  30. azure/storage/blob/_serialize.py +1 -0
  31. azure/storage/blob/_shared/authentication.py +62 -4
  32. azure/storage/blob/_shared/base_client.py +1 -1
  33. azure/storage/blob/_shared/base_client_async.py +3 -2
  34. azure/storage/blob/_version.py +1 -1
  35. azure/storage/blob/aio/_blob_client_async.py +49 -46
  36. azure/storage/blob/aio/_blob_service_client_async.py +10 -10
  37. azure/storage/blob/aio/_container_client_async.py +22 -19
  38. azure/storage/blob/aio/_download_async.py +317 -209
  39. azure/storage/blob/aio/_lease_async.py +5 -5
  40. {azure_storage_blob-12.20.0.dist-info → azure_storage_blob-12.21.0.dist-info}/METADATA +6 -6
  41. {azure_storage_blob-12.20.0.dist-info → azure_storage_blob-12.21.0.dist-info}/RECORD +44 -43
  42. {azure_storage_blob-12.20.0.dist-info → azure_storage_blob-12.21.0.dist-info}/WHEEL +1 -1
  43. {azure_storage_blob-12.20.0.dist-info → azure_storage_blob-12.21.0.dist-info}/LICENSE +0 -0
  44. {azure_storage_blob-12.20.0.dist-info → azure_storage_blob-12.21.0.dist-info}/top_level.txt +0 -0
@@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
23
23
  desired operation. Required.
24
24
  :type url: str
25
25
  :keyword version: Specifies the version of the operation to use for this request. Default value
26
- is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
26
+ is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
27
27
  :paramtype version: str
28
28
  """
29
29
 
30
30
  def __init__(self, url: str, **kwargs: Any) -> None:
31
- version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02")
31
+ version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04")
32
32
 
33
33
  if url is None:
34
34
  raise ValueError("Parameter 'url' must not be None.")
@@ -27,5 +27,7 @@
27
27
 
28
28
  # This file is used for handwritten extensions to the generated code. Example:
29
29
  # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
30
+
31
+
30
32
  def patch_sdk():
31
33
  pass
@@ -1441,7 +1441,7 @@ class Deserializer(object):
1441
1441
  elif isinstance(response, type) and issubclass(response, Enum):
1442
1442
  return self.deserialize_enum(data, response)
1443
1443
 
1444
- if data is None:
1444
+ if data is None or data is CoreNull:
1445
1445
  return data
1446
1446
  try:
1447
1447
  attributes = response._attribute_map # type: ignore
@@ -47,7 +47,7 @@ class AzureBlobStorage: # pylint: disable=client-accepts-api-version-keyword
47
47
  :param base_url: Service URL. Required. Default value is "".
48
48
  :type base_url: str
49
49
  :keyword version: Specifies the version of the operation to use for this request. Default value
50
- is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
50
+ is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
51
51
  :paramtype version: str
52
52
  """
53
53
 
@@ -23,12 +23,12 @@ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attrib
23
23
  desired operation. Required.
24
24
  :type url: str
25
25
  :keyword version: Specifies the version of the operation to use for this request. Default value
26
- is "2021-12-02". Note that overriding this default value may result in unsupported behavior.
26
+ is "2024-08-04". Note that overriding this default value may result in unsupported behavior.
27
27
  :paramtype version: str
28
28
  """
29
29
 
30
30
  def __init__(self, url: str, **kwargs: Any) -> None:
31
- version: Literal["2021-12-02"] = kwargs.pop("version", "2021-12-02")
31
+ version: Literal["2024-08-04"] = kwargs.pop("version", "2024-08-04")
32
32
 
33
33
  if url is None:
34
34
  raise ValueError("Parameter 'url' must not be None.")
@@ -27,5 +27,7 @@
27
27
 
28
28
  # This file is used for handwritten extensions to the generated code. Example:
29
29
  # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
30
+
31
+
30
32
  def patch_sdk():
31
33
  pass
@@ -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,
@@ -32,6 +33,10 @@ from ...operations._append_blob_operations import (
32
33
  build_seal_request,
33
34
  )
34
35
 
36
+ if sys.version_info >= (3, 9):
37
+ from collections.abc import MutableMapping
38
+ else:
39
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
35
40
  T = TypeVar("T")
36
41
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
37
42
 
@@ -119,7 +124,7 @@ class AppendBlobOperations:
119
124
  :rtype: None
120
125
  :raises ~azure.core.exceptions.HttpResponseError:
121
126
  """
122
- error_map = {
127
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
123
128
  401: ClientAuthenticationError,
124
129
  404: ResourceNotFoundError,
125
130
  409: ResourceExistsError,
@@ -295,7 +300,7 @@ class AppendBlobOperations:
295
300
  :rtype: None
296
301
  :raises ~azure.core.exceptions.HttpResponseError:
297
302
  """
298
- error_map = {
303
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
299
304
  401: ClientAuthenticationError,
300
305
  404: ResourceNotFoundError,
301
306
  409: ResourceExistsError,
@@ -484,7 +489,7 @@ class AppendBlobOperations:
484
489
  :rtype: None
485
490
  :raises ~azure.core.exceptions.HttpResponseError:
486
491
  """
487
- error_map = {
492
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
488
493
  401: ClientAuthenticationError,
489
494
  404: ResourceNotFoundError,
490
495
  409: ResourceExistsError,
@@ -646,7 +651,7 @@ class AppendBlobOperations:
646
651
  :rtype: None
647
652
  :raises ~azure.core.exceptions.HttpResponseError:
648
653
  """
649
- error_map = {
654
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
650
655
  401: ClientAuthenticationError,
651
656
  404: ResourceNotFoundError,
652
657
  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, AsyncIterator, Callable, Dict, Literal, Optional, TypeVar, Union
10
+ import sys
11
+ from typing import Any, AsyncIterator, Callable, Dict, Literal, Optional, Type, TypeVar, Union
11
12
 
12
13
  from azure.core.exceptions import (
13
14
  ClientAuthenticationError,
@@ -52,6 +53,10 @@ from ...operations._blob_operations import (
52
53
  build_undelete_request,
53
54
  )
54
55
 
56
+ if sys.version_info >= (3, 9):
57
+ from collections.abc import MutableMapping
58
+ else:
59
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
55
60
  T = TypeVar("T")
56
61
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
57
62
 
@@ -132,7 +137,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
132
137
  :rtype: AsyncIterator[bytes]
133
138
  :raises ~azure.core.exceptions.HttpResponseError:
134
139
  """
135
- error_map = {
140
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
136
141
  401: ClientAuthenticationError,
137
142
  404: ResourceNotFoundError,
138
143
  409: ResourceExistsError,
@@ -419,7 +424,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
419
424
  :rtype: None
420
425
  :raises ~azure.core.exceptions.HttpResponseError:
421
426
  """
422
- error_map = {
427
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
423
428
  401: ClientAuthenticationError,
424
429
  404: ResourceNotFoundError,
425
430
  409: ResourceExistsError,
@@ -640,7 +645,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
640
645
  :rtype: None
641
646
  :raises ~azure.core.exceptions.HttpResponseError:
642
647
  """
643
- error_map = {
648
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
644
649
  401: ClientAuthenticationError,
645
650
  404: ResourceNotFoundError,
646
651
  409: ResourceExistsError,
@@ -731,7 +736,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
731
736
  :rtype: None
732
737
  :raises ~azure.core.exceptions.HttpResponseError:
733
738
  """
734
- error_map = {
739
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
735
740
  401: ClientAuthenticationError,
736
741
  404: ResourceNotFoundError,
737
742
  409: ResourceExistsError,
@@ -809,7 +814,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
809
814
  :rtype: None
810
815
  :raises ~azure.core.exceptions.HttpResponseError:
811
816
  """
812
- error_map = {
817
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
813
818
  401: ClientAuthenticationError,
814
819
  404: ResourceNotFoundError,
815
820
  409: ResourceExistsError,
@@ -893,7 +898,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
893
898
  :rtype: None
894
899
  :raises ~azure.core.exceptions.HttpResponseError:
895
900
  """
896
- error_map = {
901
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
897
902
  401: ClientAuthenticationError,
898
903
  404: ResourceNotFoundError,
899
904
  409: ResourceExistsError,
@@ -1020,7 +1025,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1020
1025
  :rtype: None
1021
1026
  :raises ~azure.core.exceptions.HttpResponseError:
1022
1027
  """
1023
- error_map = {
1028
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1024
1029
  401: ClientAuthenticationError,
1025
1030
  404: ResourceNotFoundError,
1026
1031
  409: ResourceExistsError,
@@ -1101,7 +1106,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1101
1106
  :rtype: None
1102
1107
  :raises ~azure.core.exceptions.HttpResponseError:
1103
1108
  """
1104
- error_map = {
1109
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1105
1110
  401: ClientAuthenticationError,
1106
1111
  404: ResourceNotFoundError,
1107
1112
  409: ResourceExistsError,
@@ -1171,7 +1176,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1171
1176
  :rtype: None
1172
1177
  :raises ~azure.core.exceptions.HttpResponseError:
1173
1178
  """
1174
- error_map = {
1179
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1175
1180
  401: ClientAuthenticationError,
1176
1181
  404: ResourceNotFoundError,
1177
1182
  409: ResourceExistsError,
@@ -1266,7 +1271,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1266
1271
  :rtype: None
1267
1272
  :raises ~azure.core.exceptions.HttpResponseError:
1268
1273
  """
1269
- error_map = {
1274
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1270
1275
  401: ClientAuthenticationError,
1271
1276
  404: ResourceNotFoundError,
1272
1277
  409: ResourceExistsError,
@@ -1399,7 +1404,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1399
1404
  :rtype: None
1400
1405
  :raises ~azure.core.exceptions.HttpResponseError:
1401
1406
  """
1402
- error_map = {
1407
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1403
1408
  401: ClientAuthenticationError,
1404
1409
  404: ResourceNotFoundError,
1405
1410
  409: ResourceExistsError,
@@ -1501,7 +1506,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1501
1506
  :rtype: None
1502
1507
  :raises ~azure.core.exceptions.HttpResponseError:
1503
1508
  """
1504
- error_map = {
1509
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1505
1510
  401: ClientAuthenticationError,
1506
1511
  404: ResourceNotFoundError,
1507
1512
  409: ResourceExistsError,
@@ -1601,7 +1606,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1601
1606
  :rtype: None
1602
1607
  :raises ~azure.core.exceptions.HttpResponseError:
1603
1608
  """
1604
- error_map = {
1609
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1605
1610
  401: ClientAuthenticationError,
1606
1611
  404: ResourceNotFoundError,
1607
1612
  409: ResourceExistsError,
@@ -1707,7 +1712,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1707
1712
  :rtype: None
1708
1713
  :raises ~azure.core.exceptions.HttpResponseError:
1709
1714
  """
1710
- error_map = {
1715
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1711
1716
  401: ClientAuthenticationError,
1712
1717
  404: ResourceNotFoundError,
1713
1718
  409: ResourceExistsError,
@@ -1815,7 +1820,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1815
1820
  :rtype: None
1816
1821
  :raises ~azure.core.exceptions.HttpResponseError:
1817
1822
  """
1818
- error_map = {
1823
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1819
1824
  401: ClientAuthenticationError,
1820
1825
  404: ResourceNotFoundError,
1821
1826
  409: ResourceExistsError,
@@ -1930,7 +1935,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
1930
1935
  :rtype: None
1931
1936
  :raises ~azure.core.exceptions.HttpResponseError:
1932
1937
  """
1933
- error_map = {
1938
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1934
1939
  401: ClientAuthenticationError,
1935
1940
  404: ResourceNotFoundError,
1936
1941
  409: ResourceExistsError,
@@ -2097,7 +2102,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2097
2102
  :rtype: None
2098
2103
  :raises ~azure.core.exceptions.HttpResponseError:
2099
2104
  """
2100
- error_map = {
2105
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2101
2106
  401: ClientAuthenticationError,
2102
2107
  404: ResourceNotFoundError,
2103
2108
  409: ResourceExistsError,
@@ -2279,7 +2284,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2279
2284
  :rtype: None
2280
2285
  :raises ~azure.core.exceptions.HttpResponseError:
2281
2286
  """
2282
- error_map = {
2287
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2283
2288
  401: ClientAuthenticationError,
2284
2289
  404: ResourceNotFoundError,
2285
2290
  409: ResourceExistsError,
@@ -2420,7 +2425,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2420
2425
  :rtype: None
2421
2426
  :raises ~azure.core.exceptions.HttpResponseError:
2422
2427
  """
2423
- error_map = {
2428
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2424
2429
  401: ClientAuthenticationError,
2425
2430
  404: ResourceNotFoundError,
2426
2431
  409: ResourceExistsError,
@@ -2532,7 +2537,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2532
2537
  :rtype: None
2533
2538
  :raises ~azure.core.exceptions.HttpResponseError:
2534
2539
  """
2535
- error_map = {
2540
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2536
2541
  401: ClientAuthenticationError,
2537
2542
  404: ResourceNotFoundError,
2538
2543
  409: ResourceExistsError,
@@ -2602,14 +2607,25 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2602
2607
  return cls(pipeline_response, None, response_headers) # type: ignore
2603
2608
 
2604
2609
  @distributed_trace_async
2605
- async def get_account_info(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements
2610
+ async def get_account_info( # pylint: disable=inconsistent-return-statements
2611
+ self, timeout: Optional[int] = None, request_id_parameter: Optional[str] = None, **kwargs: Any
2612
+ ) -> None:
2606
2613
  """Returns the sku name and account kind.
2607
2614
 
2615
+ :param timeout: The timeout parameter is expressed in seconds. For more information, see
2616
+ :code:`<a
2617
+ href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
2618
+ Timeouts for Blob Service Operations.</a>`. Default value is None.
2619
+ :type timeout: int
2620
+ :param request_id_parameter: Provides a client-generated, opaque value with a 1 KB character
2621
+ limit that is recorded in the analytics logs when storage analytics logging is enabled. Default
2622
+ value is None.
2623
+ :type request_id_parameter: str
2608
2624
  :return: None or the result of cls(response)
2609
2625
  :rtype: None
2610
2626
  :raises ~azure.core.exceptions.HttpResponseError:
2611
2627
  """
2612
- error_map = {
2628
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2613
2629
  401: ClientAuthenticationError,
2614
2630
  404: ResourceNotFoundError,
2615
2631
  409: ResourceExistsError,
@@ -2626,6 +2642,8 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2626
2642
 
2627
2643
  _request = build_get_account_info_request(
2628
2644
  url=self._config.url,
2645
+ timeout=timeout,
2646
+ request_id_parameter=request_id_parameter,
2629
2647
  restype=restype,
2630
2648
  comp=comp,
2631
2649
  version=self._config.version,
@@ -2656,6 +2674,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2656
2674
  response_headers["Date"] = self._deserialize("rfc-1123", response.headers.get("Date"))
2657
2675
  response_headers["x-ms-sku-name"] = self._deserialize("str", response.headers.get("x-ms-sku-name"))
2658
2676
  response_headers["x-ms-account-kind"] = self._deserialize("str", response.headers.get("x-ms-account-kind"))
2677
+ response_headers["x-ms-is-hns-enabled"] = self._deserialize("bool", response.headers.get("x-ms-is-hns-enabled"))
2659
2678
 
2660
2679
  if cls:
2661
2680
  return cls(pipeline_response, None, response_headers) # type: ignore
@@ -2702,7 +2721,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2702
2721
  :rtype: AsyncIterator[bytes]
2703
2722
  :raises ~azure.core.exceptions.HttpResponseError:
2704
2723
  """
2705
- error_map = {
2724
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2706
2725
  401: ClientAuthenticationError,
2707
2726
  404: ResourceNotFoundError,
2708
2727
  409: ResourceExistsError,
@@ -2948,7 +2967,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
2948
2967
  :rtype: ~azure.storage.blob.models.BlobTags
2949
2968
  :raises ~azure.core.exceptions.HttpResponseError:
2950
2969
  """
2951
- error_map = {
2970
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
2952
2971
  401: ClientAuthenticationError,
2953
2972
  404: ResourceNotFoundError,
2954
2973
  409: ResourceExistsError,
@@ -3056,7 +3075,7 @@ class BlobOperations: # pylint: disable=too-many-public-methods
3056
3075
  :rtype: None
3057
3076
  :raises ~azure.core.exceptions.HttpResponseError:
3058
3077
  """
3059
- error_map = {
3078
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
3060
3079
  401: ClientAuthenticationError,
3061
3080
  404: ResourceNotFoundError,
3062
3081
  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,
@@ -34,6 +35,10 @@ from ...operations._block_blob_operations import (
34
35
  build_upload_request,
35
36
  )
36
37
 
38
+ if sys.version_info >= (3, 9):
39
+ from collections.abc import MutableMapping
40
+ else:
41
+ from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
37
42
  T = TypeVar("T")
38
43
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
39
44
 
@@ -141,7 +146,7 @@ class BlockBlobOperations:
141
146
  :rtype: None
142
147
  :raises ~azure.core.exceptions.HttpResponseError:
143
148
  """
144
- error_map = {
149
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
145
150
  401: ClientAuthenticationError,
146
151
  404: ResourceNotFoundError,
147
152
  409: ResourceExistsError,
@@ -363,7 +368,7 @@ class BlockBlobOperations:
363
368
  :rtype: None
364
369
  :raises ~azure.core.exceptions.HttpResponseError:
365
370
  """
366
- error_map = {
371
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
367
372
  401: ClientAuthenticationError,
368
373
  404: ResourceNotFoundError,
369
374
  409: ResourceExistsError,
@@ -555,7 +560,7 @@ class BlockBlobOperations:
555
560
  :rtype: None
556
561
  :raises ~azure.core.exceptions.HttpResponseError:
557
562
  """
558
- error_map = {
563
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
559
564
  401: ClientAuthenticationError,
560
565
  404: ResourceNotFoundError,
561
566
  409: ResourceExistsError,
@@ -706,7 +711,7 @@ class BlockBlobOperations:
706
711
  :rtype: None
707
712
  :raises ~azure.core.exceptions.HttpResponseError:
708
713
  """
709
- error_map = {
714
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
710
715
  401: ClientAuthenticationError,
711
716
  404: ResourceNotFoundError,
712
717
  409: ResourceExistsError,
@@ -890,7 +895,7 @@ class BlockBlobOperations:
890
895
  :rtype: None
891
896
  :raises ~azure.core.exceptions.HttpResponseError:
892
897
  """
893
- error_map = {
898
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
894
899
  401: ClientAuthenticationError,
895
900
  404: ResourceNotFoundError,
896
901
  409: ResourceExistsError,
@@ -1062,7 +1067,7 @@ class BlockBlobOperations:
1062
1067
  :rtype: ~azure.storage.blob.models.BlockList
1063
1068
  :raises ~azure.core.exceptions.HttpResponseError:
1064
1069
  """
1065
- error_map = {
1070
+ error_map: MutableMapping[int, Type[HttpResponseError]] = {
1066
1071
  401: ClientAuthenticationError,
1067
1072
  404: ResourceNotFoundError,
1068
1073
  409: ResourceExistsError,