azure-storage-blob 12.24.1__py3-none-any.whl → 12.25.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. azure/storage/blob/_generated/__init__.py +9 -3
  2. azure/storage/blob/_generated/_configuration.py +1 -1
  3. azure/storage/blob/_generated/_patch.py +16 -29
  4. azure/storage/blob/_generated/_serialization.py +52 -117
  5. azure/storage/blob/_generated/aio/__init__.py +9 -3
  6. azure/storage/blob/_generated/aio/_configuration.py +1 -1
  7. azure/storage/blob/_generated/aio/_patch.py +16 -29
  8. azure/storage/blob/_generated/aio/operations/__init__.py +14 -8
  9. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +21 -19
  10. azure/storage/blob/_generated/aio/operations/_blob_operations.py +88 -85
  11. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +28 -25
  12. azure/storage/blob/_generated/aio/operations/_container_operations.py +59 -56
  13. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +37 -34
  14. azure/storage/blob/_generated/aio/operations/_patch.py +2 -8
  15. azure/storage/blob/_generated/aio/operations/_service_operations.py +27 -25
  16. azure/storage/blob/_generated/models/__init__.py +91 -80
  17. azure/storage/blob/_generated/models/_models_py3.py +4 -5
  18. azure/storage/blob/_generated/models/_patch.py +2 -8
  19. azure/storage/blob/_generated/operations/__init__.py +14 -8
  20. azure/storage/blob/_generated/operations/_append_blob_operations.py +18 -16
  21. azure/storage/blob/_generated/operations/_blob_operations.py +67 -65
  22. azure/storage/blob/_generated/operations/_block_blob_operations.py +23 -21
  23. azure/storage/blob/_generated/operations/_container_operations.py +46 -44
  24. azure/storage/blob/_generated/operations/_page_blob_operations.py +30 -28
  25. azure/storage/blob/_generated/operations/_patch.py +2 -8
  26. azure/storage/blob/_generated/operations/_service_operations.py +26 -24
  27. azure/storage/blob/_serialize.py +1 -0
  28. azure/storage/blob/_version.py +1 -1
  29. {azure_storage_blob-12.24.1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/METADATA +1 -1
  30. {azure_storage_blob-12.24.1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/RECORD +33 -33
  31. {azure_storage_blob-12.24.1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/LICENSE +0 -0
  32. {azure_storage_blob-12.24.1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/WHEEL +0 -0
  33. {azure_storage_blob-12.24.1.dist-info → azure_storage_blob-12.25.0b1.dist-info}/top_level.txt +0 -0
@@ -5,12 +5,18 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ # pylint: disable=wrong-import-position
8
9
 
9
- from ._azure_blob_storage import AzureBlobStorage
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from ._patch import * # pylint: disable=unused-wildcard-import
14
+
15
+ from ._azure_blob_storage import AzureBlobStorage # type: ignore
10
16
 
11
17
  try:
12
18
  from ._patch import __all__ as _patch_all
13
- from ._patch import * # pylint: disable=unused-wildcard-import
19
+ from ._patch import *
14
20
  except ImportError:
15
21
  _patch_all = []
16
22
  from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@ from ._patch import patch_sdk as _patch_sdk
18
24
  __all__ = [
19
25
  "AzureBlobStorage",
20
26
  ]
21
- __all__.extend([p for p in _patch_all if p not in __all__])
27
+ __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
22
28
 
23
29
  _patch_sdk()
@@ -13,7 +13,7 @@ from azure.core.pipeline import policies
13
13
  VERSION = "unknown"
14
14
 
15
15
 
16
- class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
16
+ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attributes
17
17
  """Configuration for AzureBlobStorage.
18
18
 
19
19
  Note that all parameters used to create this instance are saved as instance
@@ -1,33 +1,20 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- #
4
- # Copyright (c) Microsoft Corporation. All rights reserved.
5
- #
6
- # The MIT License (MIT)
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the ""Software""), to
10
- # deal in the Software without restriction, including without limitation the
11
- # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
- # sell copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
- #
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
- #
18
- # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
- # IN THE SOFTWARE.
25
- #
26
- # --------------------------------------------------------------------------
1
+ # ------------------------------------
2
+ # Copyright (c) Microsoft Corporation.
3
+ # Licensed under the MIT License.
4
+ # ------------------------------------
5
+ """Customize generated code here.
27
6
 
28
- # This file is used for handwritten extensions to the generated code. Example:
29
- # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
7
+ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
+ """
9
+ from typing import List
10
+
11
+ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level
30
12
 
31
13
 
32
14
  def patch_sdk():
33
- pass
15
+ """Do not remove from this file.
16
+
17
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
18
+ you can't accomplish using the techniques described in
19
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
20
+ """
@@ -48,9 +48,7 @@ from typing import (
48
48
  IO,
49
49
  Mapping,
50
50
  Callable,
51
- TypeVar,
52
51
  MutableMapping,
53
- Type,
54
52
  List,
55
53
  )
56
54
 
@@ -61,13 +59,13 @@ except ImportError:
61
59
  import xml.etree.ElementTree as ET
62
60
 
63
61
  import isodate # type: ignore
62
+ from typing_extensions import Self
64
63
 
65
64
  from azure.core.exceptions import DeserializationError, SerializationError
66
65
  from azure.core.serialization import NULL as CoreNull
67
66
 
68
67
  _BOM = codecs.BOM_UTF8.decode(encoding="utf-8")
69
68
 
70
- ModelType = TypeVar("ModelType", bound="Model")
71
69
  JSON = MutableMapping[str, Any]
72
70
 
73
71
 
@@ -185,73 +183,7 @@ try:
185
183
  except NameError:
186
184
  _long_type = int
187
185
 
188
-
189
- class UTC(datetime.tzinfo):
190
- """Time Zone info for handling UTC"""
191
-
192
- def utcoffset(self, dt):
193
- """UTF offset for UTC is 0.
194
-
195
- :param datetime.datetime dt: The datetime
196
- :returns: The offset
197
- :rtype: datetime.timedelta
198
- """
199
- return datetime.timedelta(0)
200
-
201
- def tzname(self, dt):
202
- """Timestamp representation.
203
-
204
- :param datetime.datetime dt: The datetime
205
- :returns: The timestamp representation
206
- :rtype: str
207
- """
208
- return "Z"
209
-
210
- def dst(self, dt):
211
- """No daylight saving for UTC.
212
-
213
- :param datetime.datetime dt: The datetime
214
- :returns: The daylight saving time
215
- :rtype: datetime.timedelta
216
- """
217
- return datetime.timedelta(hours=1)
218
-
219
-
220
- try:
221
- from datetime import timezone as _FixedOffset # type: ignore
222
- except ImportError: # Python 2.7
223
-
224
- class _FixedOffset(datetime.tzinfo): # type: ignore
225
- """Fixed offset in minutes east from UTC.
226
- Copy/pasted from Python doc
227
- :param datetime.timedelta offset: offset in timedelta format
228
- """
229
-
230
- def __init__(self, offset):
231
- self.__offset = offset
232
-
233
- def utcoffset(self, dt):
234
- return self.__offset
235
-
236
- def tzname(self, dt):
237
- return str(self.__offset.total_seconds() / 3600)
238
-
239
- def __repr__(self):
240
- return "<FixedOffset {}>".format(self.tzname(None))
241
-
242
- def dst(self, dt):
243
- return datetime.timedelta(0)
244
-
245
- def __getinitargs__(self):
246
- return (self.__offset,)
247
-
248
-
249
- try:
250
- from datetime import timezone
251
-
252
- TZ_UTC = timezone.utc
253
- except ImportError:
254
- TZ_UTC = UTC() # type: ignore
186
+ TZ_UTC = datetime.timezone.utc
255
187
 
256
188
  _FLATTEN = re.compile(r"(?<!\\)\.")
257
189
 
@@ -310,7 +242,7 @@ def _create_xml_node(tag, prefix=None, ns=None):
310
242
  return ET.Element(tag)
311
243
 
312
244
 
313
- class Model(object):
245
+ class Model:
314
246
  """Mixin for all client request body/response body models to support
315
247
  serialization and deserialization.
316
248
  """
@@ -450,25 +382,25 @@ class Model(object):
450
382
  return client_models
451
383
 
452
384
  @classmethod
453
- def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType:
385
+ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self:
454
386
  """Parse a str using the RestAPI syntax and return a model.
455
387
 
456
388
  :param str data: A str using RestAPI structure. JSON by default.
457
389
  :param str content_type: JSON by default, set application/xml if XML.
458
390
  :returns: An instance of this model
459
- :raises: DeserializationError if something went wrong
460
- :rtype: ModelType
391
+ :raises DeserializationError: if something went wrong
392
+ :rtype: Self
461
393
  """
462
394
  deserializer = Deserializer(cls._infer_class_models())
463
395
  return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
464
396
 
465
397
  @classmethod
466
398
  def from_dict(
467
- cls: Type[ModelType],
399
+ cls,
468
400
  data: Any,
469
401
  key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
470
402
  content_type: Optional[str] = None,
471
- ) -> ModelType:
403
+ ) -> Self:
472
404
  """Parse a dict using given key extractor return a model.
473
405
 
474
406
  By default consider key
@@ -480,7 +412,7 @@ class Model(object):
480
412
  :param str content_type: JSON by default, set application/xml if XML.
481
413
  :returns: An instance of this model
482
414
  :raises: DeserializationError if something went wrong
483
- :rtype: ModelType
415
+ :rtype: Self
484
416
  """
485
417
  deserializer = Deserializer(cls._infer_class_models())
486
418
  deserializer.key_extractors = ( # type: ignore
@@ -507,7 +439,6 @@ class Model(object):
507
439
  def _classify(cls, response, objects):
508
440
  """Check the class _subtype_map for any child classes.
509
441
  We want to ignore any inherited _subtype_maps.
510
- Remove the polymorphic key from the initial data.
511
442
 
512
443
  :param dict response: The initial data
513
444
  :param dict objects: The class objects
@@ -519,7 +450,7 @@ class Model(object):
519
450
 
520
451
  if not isinstance(response, ET.Element):
521
452
  rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
522
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
453
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
523
454
  else:
524
455
  subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
525
456
  if subtype_value:
@@ -564,7 +495,7 @@ def _decode_attribute_map_key(key):
564
495
  return key.replace("\\.", ".")
565
496
 
566
497
 
567
- class Serializer(object): # pylint: disable=too-many-public-methods
498
+ class Serializer: # pylint: disable=too-many-public-methods
568
499
  """Request object model serializer."""
569
500
 
570
501
  basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -599,7 +530,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
599
530
  "multiple": lambda x, y: x % y != 0,
600
531
  }
601
532
 
602
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
533
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
603
534
  self.serialize_type = {
604
535
  "iso-8601": Serializer.serialize_iso,
605
536
  "rfc-1123": Serializer.serialize_rfc,
@@ -627,7 +558,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
627
558
  :param object target_obj: The data to be serialized.
628
559
  :param str data_type: The type to be serialized from.
629
560
  :rtype: str, dict
630
- :raises: SerializationError if serialization fails.
561
+ :raises SerializationError: if serialization fails.
631
562
  :returns: The serialized data.
632
563
  """
633
564
  key_transformer = kwargs.get("key_transformer", self.key_transformer)
@@ -737,8 +668,8 @@ class Serializer(object): # pylint: disable=too-many-public-methods
737
668
  :param object data: The data to be serialized.
738
669
  :param str data_type: The type to be serialized from.
739
670
  :rtype: dict
740
- :raises: SerializationError if serialization fails.
741
- :raises: ValueError if data is None
671
+ :raises SerializationError: if serialization fails.
672
+ :raises ValueError: if data is None
742
673
  :returns: The serialized request body
743
674
  """
744
675
 
@@ -782,8 +713,8 @@ class Serializer(object): # pylint: disable=too-many-public-methods
782
713
  :param str data_type: The type to be serialized from.
783
714
  :rtype: str
784
715
  :returns: The serialized URL path
785
- :raises: TypeError if serialization fails.
786
- :raises: ValueError if data is None
716
+ :raises TypeError: if serialization fails.
717
+ :raises ValueError: if data is None
787
718
  """
788
719
  try:
789
720
  output = self.serialize_data(data, data_type, **kwargs)
@@ -806,8 +737,8 @@ class Serializer(object): # pylint: disable=too-many-public-methods
806
737
  :param object data: The data to be serialized.
807
738
  :param str data_type: The type to be serialized from.
808
739
  :rtype: str, list
809
- :raises: TypeError if serialization fails.
810
- :raises: ValueError if data is None
740
+ :raises TypeError: if serialization fails.
741
+ :raises ValueError: if data is None
811
742
  :returns: The serialized query parameter
812
743
  """
813
744
  try:
@@ -836,8 +767,8 @@ class Serializer(object): # pylint: disable=too-many-public-methods
836
767
  :param object data: The data to be serialized.
837
768
  :param str data_type: The type to be serialized from.
838
769
  :rtype: str
839
- :raises: TypeError if serialization fails.
840
- :raises: ValueError if data is None
770
+ :raises TypeError: if serialization fails.
771
+ :raises ValueError: if data is None
841
772
  :returns: The serialized header
842
773
  """
843
774
  try:
@@ -856,9 +787,9 @@ class Serializer(object): # pylint: disable=too-many-public-methods
856
787
 
857
788
  :param object data: The data to be serialized.
858
789
  :param str data_type: The type to be serialized from.
859
- :raises: AttributeError if required data is None.
860
- :raises: ValueError if data is None
861
- :raises: SerializationError if serialization fails.
790
+ :raises AttributeError: if required data is None.
791
+ :raises ValueError: if data is None
792
+ :raises SerializationError: if serialization fails.
862
793
  :returns: The serialized data.
863
794
  :rtype: str, int, float, bool, dict, list
864
795
  """
@@ -1193,7 +1124,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
1193
1124
 
1194
1125
  :param Datetime attr: Object to be serialized.
1195
1126
  :rtype: str
1196
- :raises: TypeError if format invalid.
1127
+ :raises TypeError: if format invalid.
1197
1128
  :return: serialized rfc
1198
1129
  """
1199
1130
  try:
@@ -1219,7 +1150,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
1219
1150
 
1220
1151
  :param Datetime attr: Object to be serialized.
1221
1152
  :rtype: str
1222
- :raises: SerializationError if format invalid.
1153
+ :raises SerializationError: if format invalid.
1223
1154
  :return: serialized iso
1224
1155
  """
1225
1156
  if isinstance(attr, str):
@@ -1252,7 +1183,7 @@ class Serializer(object): # pylint: disable=too-many-public-methods
1252
1183
 
1253
1184
  :param Datetime attr: Object to be serialized.
1254
1185
  :rtype: int
1255
- :raises: SerializationError if format invalid
1186
+ :raises SerializationError: if format invalid
1256
1187
  :return: serialied unix
1257
1188
  """
1258
1189
  if isinstance(attr, int):
@@ -1442,7 +1373,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
1442
1373
  return children[0]
1443
1374
 
1444
1375
 
1445
- class Deserializer(object):
1376
+ class Deserializer:
1446
1377
  """Response object model deserializer.
1447
1378
 
1448
1379
  :param dict classes: Class type dictionary for deserializing complex types.
@@ -1453,7 +1384,7 @@ class Deserializer(object):
1453
1384
 
1454
1385
  valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
1455
1386
 
1456
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
1387
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
1457
1388
  self.deserialize_type = {
1458
1389
  "iso-8601": Deserializer.deserialize_iso,
1459
1390
  "rfc-1123": Deserializer.deserialize_rfc,
@@ -1489,7 +1420,7 @@ class Deserializer(object):
1489
1420
  :param str target_obj: Target data type to deserialize to.
1490
1421
  :param requests.Response response_data: REST response object.
1491
1422
  :param str content_type: Swagger "produces" if available.
1492
- :raises: DeserializationError if deserialization fails.
1423
+ :raises DeserializationError: if deserialization fails.
1493
1424
  :return: Deserialized object.
1494
1425
  :rtype: object
1495
1426
  """
@@ -1503,7 +1434,7 @@ class Deserializer(object):
1503
1434
 
1504
1435
  :param str target_obj: Target data type to deserialize to.
1505
1436
  :param object data: Object to deserialize.
1506
- :raises: DeserializationError if deserialization fails.
1437
+ :raises DeserializationError: if deserialization fails.
1507
1438
  :return: Deserialized object.
1508
1439
  :rtype: object
1509
1440
  """
@@ -1684,17 +1615,21 @@ class Deserializer(object):
1684
1615
  subtype = getattr(response, "_subtype_map", {})
1685
1616
  try:
1686
1617
  readonly = [
1687
- k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
1618
+ k
1619
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1620
+ if v.get("readonly")
1688
1621
  ]
1689
1622
  const = [
1690
- k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
1623
+ k
1624
+ for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore
1625
+ if v.get("constant")
1691
1626
  ]
1692
1627
  kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
1693
1628
  response_obj = response(**kwargs)
1694
1629
  for attr in readonly:
1695
1630
  setattr(response_obj, attr, attrs.get(attr))
1696
1631
  if additional_properties:
1697
- response_obj.additional_properties = additional_properties
1632
+ response_obj.additional_properties = additional_properties # type: ignore
1698
1633
  return response_obj
1699
1634
  except TypeError as err:
1700
1635
  msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
@@ -1714,7 +1649,7 @@ class Deserializer(object):
1714
1649
 
1715
1650
  :param str data: The response string to be deserialized.
1716
1651
  :param str data_type: The type to deserialize to.
1717
- :raises: DeserializationError if deserialization fails.
1652
+ :raises DeserializationError: if deserialization fails.
1718
1653
  :return: Deserialized object.
1719
1654
  :rtype: object
1720
1655
  """
@@ -1796,7 +1731,7 @@ class Deserializer(object):
1796
1731
  :param dict attr: Dictionary to be deserialized.
1797
1732
  :return: Deserialized object.
1798
1733
  :rtype: dict
1799
- :raises: TypeError if non-builtin datatype encountered.
1734
+ :raises TypeError: if non-builtin datatype encountered.
1800
1735
  """
1801
1736
  if attr is None:
1802
1737
  return None
@@ -1842,7 +1777,7 @@ class Deserializer(object):
1842
1777
  :param str data_type: deserialization data type.
1843
1778
  :return: Deserialized basic type.
1844
1779
  :rtype: str, int, float or bool
1845
- :raises: TypeError if string format is not valid.
1780
+ :raises TypeError: if string format is not valid.
1846
1781
  """
1847
1782
  # If we're here, data is supposed to be a basic type.
1848
1783
  # If it's still an XML node, take the text
@@ -1933,7 +1868,7 @@ class Deserializer(object):
1933
1868
  :param str attr: response string to be deserialized.
1934
1869
  :return: Deserialized bytearray
1935
1870
  :rtype: bytearray
1936
- :raises: TypeError if string format invalid.
1871
+ :raises TypeError: if string format invalid.
1937
1872
  """
1938
1873
  if isinstance(attr, ET.Element):
1939
1874
  attr = attr.text
@@ -1946,7 +1881,7 @@ class Deserializer(object):
1946
1881
  :param str attr: response string to be deserialized.
1947
1882
  :return: Deserialized base64 string
1948
1883
  :rtype: bytearray
1949
- :raises: TypeError if string format invalid.
1884
+ :raises TypeError: if string format invalid.
1950
1885
  """
1951
1886
  if isinstance(attr, ET.Element):
1952
1887
  attr = attr.text
@@ -1961,7 +1896,7 @@ class Deserializer(object):
1961
1896
 
1962
1897
  :param str attr: response string to be deserialized.
1963
1898
  :return: Deserialized decimal
1964
- :raises: DeserializationError if string format invalid.
1899
+ :raises DeserializationError: if string format invalid.
1965
1900
  :rtype: decimal
1966
1901
  """
1967
1902
  if isinstance(attr, ET.Element):
@@ -1979,7 +1914,7 @@ class Deserializer(object):
1979
1914
  :param str attr: response string to be deserialized.
1980
1915
  :return: Deserialized int
1981
1916
  :rtype: long or int
1982
- :raises: ValueError if string format invalid.
1917
+ :raises ValueError: if string format invalid.
1983
1918
  """
1984
1919
  if isinstance(attr, ET.Element):
1985
1920
  attr = attr.text
@@ -1992,7 +1927,7 @@ class Deserializer(object):
1992
1927
  :param str attr: response string to be deserialized.
1993
1928
  :return: Deserialized duration
1994
1929
  :rtype: TimeDelta
1995
- :raises: DeserializationError if string format invalid.
1930
+ :raises DeserializationError: if string format invalid.
1996
1931
  """
1997
1932
  if isinstance(attr, ET.Element):
1998
1933
  attr = attr.text
@@ -2010,7 +1945,7 @@ class Deserializer(object):
2010
1945
  :param str attr: response string to be deserialized.
2011
1946
  :return: Deserialized date
2012
1947
  :rtype: Date
2013
- :raises: DeserializationError if string format invalid.
1948
+ :raises DeserializationError: if string format invalid.
2014
1949
  """
2015
1950
  if isinstance(attr, ET.Element):
2016
1951
  attr = attr.text
@@ -2026,7 +1961,7 @@ class Deserializer(object):
2026
1961
  :param str attr: response string to be deserialized.
2027
1962
  :return: Deserialized time
2028
1963
  :rtype: datetime.time
2029
- :raises: DeserializationError if string format invalid.
1964
+ :raises DeserializationError: if string format invalid.
2030
1965
  """
2031
1966
  if isinstance(attr, ET.Element):
2032
1967
  attr = attr.text
@@ -2041,14 +1976,14 @@ class Deserializer(object):
2041
1976
  :param str attr: response string to be deserialized.
2042
1977
  :return: Deserialized RFC datetime
2043
1978
  :rtype: Datetime
2044
- :raises: DeserializationError if string format invalid.
1979
+ :raises DeserializationError: if string format invalid.
2045
1980
  """
2046
1981
  if isinstance(attr, ET.Element):
2047
1982
  attr = attr.text
2048
1983
  try:
2049
1984
  parsed_date = email.utils.parsedate_tz(attr) # type: ignore
2050
1985
  date_obj = datetime.datetime(
2051
- *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60))
1986
+ *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60))
2052
1987
  )
2053
1988
  if not date_obj.tzinfo:
2054
1989
  date_obj = date_obj.astimezone(tz=TZ_UTC)
@@ -2064,7 +1999,7 @@ class Deserializer(object):
2064
1999
  :param str attr: response string to be deserialized.
2065
2000
  :return: Deserialized ISO datetime
2066
2001
  :rtype: Datetime
2067
- :raises: DeserializationError if string format invalid.
2002
+ :raises DeserializationError: if string format invalid.
2068
2003
  """
2069
2004
  if isinstance(attr, ET.Element):
2070
2005
  attr = attr.text
@@ -2102,7 +2037,7 @@ class Deserializer(object):
2102
2037
  :param int attr: Object to be serialized.
2103
2038
  :return: Deserialized datetime
2104
2039
  :rtype: Datetime
2105
- :raises: DeserializationError if format invalid
2040
+ :raises DeserializationError: if format invalid
2106
2041
  """
2107
2042
  if isinstance(attr, ET.Element):
2108
2043
  attr = int(attr.text) # type: ignore
@@ -5,12 +5,18 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ # pylint: disable=wrong-import-position
8
9
 
9
- from ._azure_blob_storage import AzureBlobStorage
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from ._patch import * # pylint: disable=unused-wildcard-import
14
+
15
+ from ._azure_blob_storage import AzureBlobStorage # type: ignore
10
16
 
11
17
  try:
12
18
  from ._patch import __all__ as _patch_all
13
- from ._patch import * # pylint: disable=unused-wildcard-import
19
+ from ._patch import *
14
20
  except ImportError:
15
21
  _patch_all = []
16
22
  from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@ from ._patch import patch_sdk as _patch_sdk
18
24
  __all__ = [
19
25
  "AzureBlobStorage",
20
26
  ]
21
- __all__.extend([p for p in _patch_all if p not in __all__])
27
+ __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
22
28
 
23
29
  _patch_sdk()
@@ -13,7 +13,7 @@ from azure.core.pipeline import policies
13
13
  VERSION = "unknown"
14
14
 
15
15
 
16
- class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
16
+ class AzureBlobStorageConfiguration: # pylint: disable=too-many-instance-attributes
17
17
  """Configuration for AzureBlobStorage.
18
18
 
19
19
  Note that all parameters used to create this instance are saved as instance
@@ -1,33 +1,20 @@
1
- # coding=utf-8
2
- # --------------------------------------------------------------------------
3
- #
4
- # Copyright (c) Microsoft Corporation. All rights reserved.
5
- #
6
- # The MIT License (MIT)
7
- #
8
- # Permission is hereby granted, free of charge, to any person obtaining a copy
9
- # of this software and associated documentation files (the ""Software""), to
10
- # deal in the Software without restriction, including without limitation the
11
- # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
- # sell copies of the Software, and to permit persons to whom the Software is
13
- # furnished to do so, subject to the following conditions:
14
- #
15
- # The above copyright notice and this permission notice shall be included in
16
- # all copies or substantial portions of the Software.
17
- #
18
- # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
- # IN THE SOFTWARE.
25
- #
26
- # --------------------------------------------------------------------------
1
+ # ------------------------------------
2
+ # Copyright (c) Microsoft Corporation.
3
+ # Licensed under the MIT License.
4
+ # ------------------------------------
5
+ """Customize generated code here.
27
6
 
28
- # This file is used for handwritten extensions to the generated code. Example:
29
- # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
7
+ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8
+ """
9
+ from typing import List
10
+
11
+ __all__: List[str] = [] # Add all objects you want publicly available to users at this package level
30
12
 
31
13
 
32
14
  def patch_sdk():
33
- pass
15
+ """Do not remove from this file.
16
+
17
+ `patch_sdk` is a last resort escape hatch that allows you to do customizations
18
+ you can't accomplish using the techniques described in
19
+ https://aka.ms/azsdk/python/dpcodegen/python/customize
20
+ """
@@ -5,16 +5,22 @@
5
5
  # Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  # --------------------------------------------------------------------------
8
+ # pylint: disable=wrong-import-position
8
9
 
9
- from ._service_operations import ServiceOperations
10
- from ._container_operations import ContainerOperations
11
- from ._blob_operations import BlobOperations
12
- from ._page_blob_operations import PageBlobOperations
13
- from ._append_blob_operations import AppendBlobOperations
14
- from ._block_blob_operations import BlockBlobOperations
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from ._patch import * # pylint: disable=unused-wildcard-import
14
+
15
+ from ._service_operations import ServiceOperations # type: ignore
16
+ from ._container_operations import ContainerOperations # type: ignore
17
+ from ._blob_operations import BlobOperations # type: ignore
18
+ from ._page_blob_operations import PageBlobOperations # type: ignore
19
+ from ._append_blob_operations import AppendBlobOperations # type: ignore
20
+ from ._block_blob_operations import BlockBlobOperations # type: ignore
15
21
 
16
22
  from ._patch import __all__ as _patch_all
17
- from ._patch import * # pylint: disable=unused-wildcard-import
23
+ from ._patch import *
18
24
  from ._patch import patch_sdk as _patch_sdk
19
25
 
20
26
  __all__ = [
@@ -25,5 +31,5 @@ __all__ = [
25
31
  "AppendBlobOperations",
26
32
  "BlockBlobOperations",
27
33
  ]
28
- __all__.extend([p for p in _patch_all if p not in __all__])
34
+ __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
29
35
  _patch_sdk()