4
4
import attr
5
5
from dateutil .parser import isoparse
6
6
7
+ from ..models .an_all_of_enum import AnAllOfEnum
7
8
from ..models .an_enum import AnEnum
8
9
from ..models .different_enum import DifferentEnum
9
10
from ..models .free_form_model import FreeFormModel
@@ -27,6 +28,8 @@ class AModel:
27
28
required_nullable : Optional [str ]
28
29
nullable_one_of_models : Union [FreeFormModel , ModelWithUnionProperty , None ]
29
30
nullable_model : Optional [ModelWithUnionProperty ]
31
+ an_allof_enum_with_overridden_default : AnAllOfEnum = AnAllOfEnum .OVERRIDDEN_DEFAULT
32
+ an_optional_allof_enum : Union [Unset , AnAllOfEnum ] = UNSET
30
33
nested_list_of_enums : Union [Unset , List [List [DifferentEnum ]]] = UNSET
31
34
a_not_required_date : Union [Unset , datetime .date ] = UNSET
32
35
attr_1_leading_digit : Union [Unset , str ] = UNSET
@@ -40,6 +43,8 @@ class AModel:
40
43
def to_dict (self ) -> Dict [str , Any ]:
41
44
an_enum_value = self .an_enum_value .value
42
45
46
+ an_allof_enum_with_overridden_default = self .an_allof_enum_with_overridden_default .value
47
+
43
48
if isinstance (self .a_camel_date_time , datetime .datetime ):
44
49
a_camel_date_time = self .a_camel_date_time .isoformat ()
45
50
@@ -56,6 +61,10 @@ def to_dict(self) -> Dict[str, Any]:
56
61
57
62
model = self .model .to_dict ()
58
63
64
+ an_optional_allof_enum : Union [Unset , str ] = UNSET
65
+ if not isinstance (self .an_optional_allof_enum , Unset ):
66
+ an_optional_allof_enum = self .an_optional_allof_enum .value
67
+
59
68
nested_list_of_enums : Union [Unset , List [List [str ]]] = UNSET
60
69
if not isinstance (self .nested_list_of_enums , Unset ):
61
70
nested_list_of_enums = []
@@ -133,6 +142,7 @@ def to_dict(self) -> Dict[str, Any]:
133
142
field_dict .update (
134
143
{
135
144
"an_enum_value" : an_enum_value ,
145
+ "an_allof_enum_with_overridden_default" : an_allof_enum_with_overridden_default ,
136
146
"aCamelDateTime" : a_camel_date_time ,
137
147
"a_date" : a_date ,
138
148
"required_not_nullable" : required_not_nullable ,
@@ -144,6 +154,8 @@ def to_dict(self) -> Dict[str, Any]:
144
154
"nullable_model" : nullable_model ,
145
155
}
146
156
)
157
+ if an_optional_allof_enum is not UNSET :
158
+ field_dict ["an_optional_allof_enum" ] = an_optional_allof_enum
147
159
if nested_list_of_enums is not UNSET :
148
160
field_dict ["nested_list_of_enums" ] = nested_list_of_enums
149
161
if a_not_required_date is not UNSET :
@@ -170,6 +182,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
170
182
d = src_dict .copy ()
171
183
an_enum_value = AnEnum (d .pop ("an_enum_value" ))
172
184
185
+ an_allof_enum_with_overridden_default = AnAllOfEnum (d .pop ("an_allof_enum_with_overridden_default" ))
186
+
173
187
def _parse_a_camel_date_time (data : object ) -> Union [datetime .date , datetime .datetime ]:
174
188
try :
175
189
a_camel_date_time_type0 : datetime .datetime
@@ -214,6 +228,11 @@ def _parse_one_of_models(data: object) -> Union[FreeFormModel, ModelWithUnionPro
214
228
215
229
model = ModelWithUnionProperty .from_dict (d .pop ("model" ))
216
230
231
+ an_optional_allof_enum : Union [Unset , AnAllOfEnum ] = UNSET
232
+ _an_optional_allof_enum = d .pop ("an_optional_allof_enum" , UNSET )
233
+ if not isinstance (_an_optional_allof_enum , Unset ):
234
+ an_optional_allof_enum = AnAllOfEnum (_an_optional_allof_enum )
235
+
217
236
nested_list_of_enums = []
218
237
_nested_list_of_enums = d .pop ("nested_list_of_enums" , UNSET )
219
238
for nested_list_of_enums_item_data in _nested_list_of_enums or []:
@@ -350,11 +369,13 @@ def _parse_not_required_nullable_one_of_models(
350
369
351
370
a_model = cls (
352
371
an_enum_value = an_enum_value ,
372
+ an_allof_enum_with_overridden_default = an_allof_enum_with_overridden_default ,
353
373
a_camel_date_time = a_camel_date_time ,
354
374
a_date = a_date ,
355
375
required_not_nullable = required_not_nullable ,
356
376
one_of_models = one_of_models ,
357
377
model = model ,
378
+ an_optional_allof_enum = an_optional_allof_enum ,
358
379
nested_list_of_enums = nested_list_of_enums ,
359
380
a_nullable_date = a_nullable_date ,
360
381
a_not_required_date = a_not_required_date ,
0 commit comments