2
2
# coding=utf-8
3
3
# --------------------------------------------------------------------------
4
4
# Copyright (c) Microsoft Corporation. All rights reserved.
5
- # Licensed under the MIT License. See License.txt in the project root for
6
- # license information.
5
+ # Licensed under the MIT License. See License.txt in the project root for license information.
6
+ # Code generated by Microsoft (R) Python Code Generator.
7
+ # Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
8
# --------------------------------------------------------------------------
8
9
# pylint: disable=protected-access, broad-except
9
10
21
22
from datetime import datetime , date , time , timedelta , timezone
22
23
from json import JSONEncoder
23
24
import xml .etree .ElementTree as ET
25
+ from collections .abc import MutableMapping
24
26
from typing_extensions import Self
25
27
import isodate
26
28
from azure .core .exceptions import DeserializationError
27
29
from azure .core import CaseInsensitiveEnumMeta
28
30
from azure .core .pipeline import PipelineResponse
29
31
from azure .core .serialization import _Null
30
32
31
- if sys .version_info >= (3 , 9 ):
32
- from collections .abc import MutableMapping
33
- else :
34
- from typing import MutableMapping
35
-
36
33
_LOGGER = logging .getLogger (__name__ )
37
34
38
35
__all__ = ["SdkJSONEncoder" , "Model" , "rest_field" , "rest_discriminator" ]
@@ -347,7 +344,7 @@ def _get_model(module_name: str, model_name: str):
347
344
_UNSET = object ()
348
345
349
346
350
- class _MyMutableMapping (MutableMapping [str , typing .Any ]): # pylint: disable=unsubscriptable-object
347
+ class _MyMutableMapping (MutableMapping [str , typing .Any ]):
351
348
def __init__ (self , data : typing .Dict [str , typing .Any ]) -> None :
352
349
self ._data = data
353
350
@@ -407,13 +404,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any:
407
404
return default
408
405
409
406
@typing .overload
410
- def pop (self , key : str ) -> typing .Any : ...
407
+ def pop (self , key : str ) -> typing .Any : ... # pylint: disable=arguments-differ
411
408
412
409
@typing .overload
413
- def pop (self , key : str , default : _T ) -> _T : ...
410
+ def pop (self , key : str , default : _T ) -> _T : ... # pylint: disable=signature-differs
414
411
415
412
@typing .overload
416
- def pop (self , key : str , default : typing .Any ) -> typing .Any : ...
413
+ def pop (self , key : str , default : typing .Any ) -> typing .Any : ... # pylint: disable=signature-differs
417
414
418
415
def pop (self , key : str , default : typing .Any = _UNSET ) -> typing .Any :
419
416
"""
@@ -443,7 +440,7 @@ def clear(self) -> None:
443
440
"""
444
441
self ._data .clear ()
445
442
446
- def update (self , * args : typing .Any , ** kwargs : typing .Any ) -> None :
443
+ def update (self , * args : typing .Any , ** kwargs : typing .Any ) -> None : # pylint: disable=arguments-differ
447
444
"""
448
445
Updates D from mapping/iterable E and F.
449
446
:param any args: Either a mapping object or an iterable of key-value pairs.
@@ -454,7 +451,7 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
454
451
def setdefault (self , key : str , default : None = None ) -> None : ...
455
452
456
453
@typing .overload
457
- def setdefault (self , key : str , default : typing .Any ) -> typing .Any : ...
454
+ def setdefault (self , key : str , default : typing .Any ) -> typing .Any : ... # pylint: disable=signature-differs
458
455
459
456
def setdefault (self , key : str , default : typing .Any = _UNSET ) -> typing .Any :
460
457
"""
@@ -644,7 +641,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
644
641
cls ._attr_to_rest_field : typing .Dict [str , _RestField ] = dict (attr_to_rest_field .items ())
645
642
cls ._calculated .add (f"{ cls .__module__ } .{ cls .__qualname__ } " )
646
643
647
- return super ().__new__ (cls ) # pylint: disable=no-value-for-parameter
644
+ return super ().__new__ (cls )
648
645
649
646
def __init_subclass__ (cls , discriminator : typing .Optional [str ] = None ) -> None :
650
647
for base in cls .__bases__ :
@@ -680,7 +677,7 @@ def _deserialize(cls, data, exist_discriminators):
680
677
discriminator_value = data .find (xml_name ).text # pyright: ignore
681
678
else :
682
679
discriminator_value = data .get (discriminator ._rest_name )
683
- mapped_cls = cls .__mapping__ .get (discriminator_value , cls ) # pyright: ignore
680
+ mapped_cls = cls .__mapping__ .get (discriminator_value , cls ) # pyright: ignore # pylint: disable=no-member
684
681
return mapped_cls ._deserialize (data , exist_discriminators )
685
682
686
683
def as_dict (self , * , exclude_readonly : bool = False ) -> typing .Dict [str , typing .Any ]:
0 commit comments