|
29 | 29 | warnings.simplefilter("ignore", category=DeprecationWarning)
|
30 | 30 | from dateutil.parser import parse
|
31 | 31 |
|
32 |
| -from ._base import ApiClientBase, DeserializedType, ModelBase, PrimitiveType, SerializedType |
| 32 | +from ._base import ApiClientBase, DeserializedType, ModelBase, PrimitiveType, SerializedType, Unset |
33 | 33 | from ._exceptions import ApiException, UndefinedObjectWarning
|
34 | 34 | from ._util import SessionConfiguration, handle_response
|
35 | 35 |
|
@@ -137,7 +137,7 @@ def __call_api(
|
137 | 137 | collection_formats: Optional[Dict[str, str]] = None,
|
138 | 138 | _preload_content: bool = True,
|
139 | 139 | _request_timeout: Union[float, Tuple[float, float], None] = None,
|
140 |
| - response_type_map: Optional[Dict[int, Union[str, None]]] = None, |
| 140 | + response_type_map: Optional[Mapping[int, Union[str, None]]] = None, |
141 | 141 | ) -> Union[requests.Response, DeserializedType, None]:
|
142 | 142 | # header parameters
|
143 | 143 | header_params = header_params or {}
|
@@ -276,7 +276,7 @@ def sanitize_for_serialization(self, obj: Any) -> Any:
|
276 | 276 | obj_dict = {
|
277 | 277 | obj.attribute_map[attr]: getattr(obj, attr)
|
278 | 278 | for attr in obj.swagger_types
|
279 |
| - if getattr(obj, attr) is not None |
| 279 | + if getattr(obj, attr) is not Unset |
280 | 280 | }
|
281 | 281 |
|
282 | 282 | return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()}
|
@@ -411,7 +411,7 @@ def call_api(
|
411 | 411 | collection_formats: Optional[Dict[str, str]] = None,
|
412 | 412 | _preload_content: bool = True,
|
413 | 413 | _request_timeout: Union[float, Tuple[float, float], None] = None,
|
414 |
| - response_type_map: Optional[Dict[int, Union[str, None]]] = None, |
| 414 | + response_type_map: Optional[Mapping[int, Union[str, None]]] = None, |
415 | 415 | ) -> Union[requests.Response, DeserializedType, None]:
|
416 | 416 | """Make the HTTP request and return the deserialized data.
|
417 | 417 |
|
@@ -868,7 +868,7 @@ def __deserialize_model(
|
868 | 868 | if key not in klass.swagger_types:
|
869 | 869 | instance[key] = value
|
870 | 870 | try:
|
871 |
| - klass_name = instance.get_real_child_model(data) |
| 871 | + klass_name = instance.get_real_child_model(data) # type: ignore[arg-type] |
872 | 872 | if klass_name:
|
873 | 873 | instance = self.__deserialize(data, klass_name) # type: ignore[assignment]
|
874 | 874 | except NotImplementedError:
|
|
0 commit comments