@autorest/python 6.13.1 → 6.13.2
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.
|
@@ -132,7 +132,8 @@ TYPE_TO_OBJECT = {
|
|
|
132
132
|
"enumvalue": EnumValue,
|
|
133
133
|
"binary": BinaryType,
|
|
134
134
|
"any": AnyType,
|
|
135
|
-
"
|
|
135
|
+
"utcDateTime": DatetimeType,
|
|
136
|
+
"offsetDateTime": DatetimeType,
|
|
136
137
|
"plainTime": TimeType,
|
|
137
138
|
"duration": DurationType,
|
|
138
139
|
"plainDate": DateType,
|
|
@@ -1112,16 +1112,18 @@ class _OperationSerializer(
|
|
|
1112
1112
|
if response.headers:
|
|
1113
1113
|
retval.append("")
|
|
1114
1114
|
deserialize_code: List[str] = []
|
|
1115
|
+
no_stream_logic = False
|
|
1115
1116
|
if builder.has_stream_response:
|
|
1116
1117
|
if isinstance(response.type, ByteArraySchema):
|
|
1117
|
-
|
|
1118
|
-
deserialized = "response.content"
|
|
1118
|
+
deserialized = f"{'await ' if self.async_mode else ''}response.read()"
|
|
1119
1119
|
else:
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1120
|
+
no_stream_logic = True
|
|
1121
|
+
if self.code_model.options["version_tolerant"]:
|
|
1122
|
+
deserialized = "response.iter_bytes()"
|
|
1123
|
+
else:
|
|
1124
|
+
deserialized = (
|
|
1125
|
+
f"response.stream_download(self._client.{self.pipeline_name})"
|
|
1126
|
+
)
|
|
1125
1127
|
deserialize_code.append(f"deserialized = {deserialized}")
|
|
1126
1128
|
elif response.type:
|
|
1127
1129
|
pylint_disable = ""
|
|
@@ -1169,7 +1171,7 @@ class _OperationSerializer(
|
|
|
1169
1171
|
deserialize_code.append("else:")
|
|
1170
1172
|
deserialize_code.append(" deserialized = None")
|
|
1171
1173
|
if len(deserialize_code) > 0:
|
|
1172
|
-
if builder.expose_stream_keyword and not
|
|
1174
|
+
if builder.expose_stream_keyword and not no_stream_logic:
|
|
1173
1175
|
retval.append("if _stream:")
|
|
1174
1176
|
retval.append(" deserialized = response.iter_bytes()")
|
|
1175
1177
|
retval.append("else:")
|
|
@@ -233,7 +233,7 @@ def update_primitive( # pylint: disable=too-many-return-statements
|
|
|
233
233
|
if type_group == "binary":
|
|
234
234
|
return KNOWN_TYPES["binary"]
|
|
235
235
|
if type_group == "date-time":
|
|
236
|
-
base = _update_type_base("
|
|
236
|
+
base = _update_type_base("utcDateTime", yaml_data)
|
|
237
237
|
base["encode"] = yaml_data["format"]
|
|
238
238
|
return base
|
|
239
239
|
if type_group == "byte-array":
|