Skip to content

Commit ee2b8af

Browse files
committed
Merge main into benching-allof-support
1 parent bc5faa3 commit ee2b8af

File tree

8 files changed

+200
-152
lines changed

8 files changed

+200
-152
lines changed

end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_model.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
class AModelModel:
1414
""" """
1515

16-
a_property: Union[Unset, AnEnum, AnIntEnum] = UNSET
16+
a_property: Union[AnEnum, AnIntEnum, Unset] = UNSET
1717
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
1818

1919
def to_dict(self) -> Dict[str, Any]:
20-
a_property: Union[Unset, AnEnum, AnIntEnum]
20+
a_property: Union[Unset, int, str]
2121
if isinstance(self.a_property, Unset):
2222
a_property = UNSET
2323
elif isinstance(self.a_property, AnEnum):
2424
a_property = UNSET
2525
if not isinstance(self.a_property, Unset):
26-
a_property = self.a_property
26+
a_property = self.a_property.value
2727

2828
else:
2929
a_property = UNSET
3030
if not isinstance(self.a_property, Unset):
31-
a_property = self.a_property
31+
a_property = self.a_property.value
3232

3333
field_dict: Dict[str, Any] = {}
3434
field_dict.update(self.additional_properties)
@@ -42,24 +42,30 @@ def to_dict(self) -> Dict[str, Any]:
4242
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
d = src_dict.copy()
4444

45-
def _parse_a_property(data: Any) -> Union[Unset, AnEnum, AnIntEnum]:
46-
data = None if isinstance(data, Unset) else data
47-
a_property: Union[Unset, AnEnum, AnIntEnum]
45+
def _parse_a_property(data: object) -> Union[AnEnum, AnIntEnum, Unset]:
46+
if isinstance(data, Unset):
47+
return data
4848
try:
49-
a_property = UNSET
50-
_a_property = data
51-
if not isinstance(_a_property, Unset):
52-
a_property = AnEnum(_a_property)
53-
54-
return a_property
49+
a_property_type0: Union[Unset, AnEnum]
50+
if not isinstance(data, str):
51+
raise TypeError()
52+
a_property_type0 = UNSET
53+
_a_property_type0 = data
54+
if not isinstance(_a_property_type0, Unset):
55+
a_property_type0 = AnEnum(_a_property_type0)
56+
57+
return a_property_type0
5558
except: # noqa: E722
5659
pass
57-
a_property = UNSET
58-
_a_property = data
59-
if not isinstance(_a_property, Unset):
60-
a_property = AnIntEnum(_a_property)
61-
62-
return a_property
60+
if not isinstance(data, int):
61+
raise TypeError()
62+
a_property_type1: Union[Unset, AnIntEnum]
63+
a_property_type1 = UNSET
64+
_a_property_type1 = data
65+
if not isinstance(_a_property_type1, Unset):
66+
a_property_type1 = AnIntEnum(_a_property_type1)
67+
68+
return a_property_type1
6369

6470
a_property = _parse_a_property(d.pop("a_property", UNSET))
6571

end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_not_required_model.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
class AModelNotRequiredModel:
1414
""" """
1515

16-
a_property: Union[Unset, AnEnum, AnIntEnum] = UNSET
16+
a_property: Union[AnEnum, AnIntEnum, Unset] = UNSET
1717
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
1818

1919
def to_dict(self) -> Dict[str, Any]:
20-
a_property: Union[Unset, AnEnum, AnIntEnum]
20+
a_property: Union[Unset, int, str]
2121
if isinstance(self.a_property, Unset):
2222
a_property = UNSET
2323
elif isinstance(self.a_property, AnEnum):
2424
a_property = UNSET
2525
if not isinstance(self.a_property, Unset):
26-
a_property = self.a_property
26+
a_property = self.a_property.value
2727

2828
else:
2929
a_property = UNSET
3030
if not isinstance(self.a_property, Unset):
31-
a_property = self.a_property
31+
a_property = self.a_property.value
3232

3333
field_dict: Dict[str, Any] = {}
3434
field_dict.update(self.additional_properties)
@@ -42,24 +42,30 @@ def to_dict(self) -> Dict[str, Any]:
4242
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
d = src_dict.copy()
4444

45-
def _parse_a_property(data: Any) -> Union[Unset, AnEnum, AnIntEnum]:
46-
data = None if isinstance(data, Unset) else data
47-
a_property: Union[Unset, AnEnum, AnIntEnum]
45+
def _parse_a_property(data: object) -> Union[AnEnum, AnIntEnum, Unset]:
46+
if isinstance(data, Unset):
47+
return data
4848
try:
49-
a_property = UNSET
50-
_a_property = data
51-
if not isinstance(_a_property, Unset):
52-
a_property = AnEnum(_a_property)
53-
54-
return a_property
49+
a_property_type0: Union[Unset, AnEnum]
50+
if not isinstance(data, str):
51+
raise TypeError()
52+
a_property_type0 = UNSET
53+
_a_property_type0 = data
54+
if not isinstance(_a_property_type0, Unset):
55+
a_property_type0 = AnEnum(_a_property_type0)
56+
57+
return a_property_type0
5558
except: # noqa: E722
5659
pass
57-
a_property = UNSET
58-
_a_property = data
59-
if not isinstance(_a_property, Unset):
60-
a_property = AnIntEnum(_a_property)
61-
62-
return a_property
60+
if not isinstance(data, int):
61+
raise TypeError()
62+
a_property_type1: Union[Unset, AnIntEnum]
63+
a_property_type1 = UNSET
64+
_a_property_type1 = data
65+
if not isinstance(_a_property_type1, Unset):
66+
a_property_type1 = AnIntEnum(_a_property_type1)
67+
68+
return a_property_type1
6369

6470
a_property = _parse_a_property(d.pop("a_property", UNSET))
6571

end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_not_required_nullable_model.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
class AModelNotRequiredNullableModel:
1414
""" """
1515

16-
a_property: Union[Unset, AnEnum, AnIntEnum] = UNSET
16+
a_property: Union[AnEnum, AnIntEnum, Unset] = UNSET
1717
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
1818

1919
def to_dict(self) -> Dict[str, Any]:
20-
a_property: Union[Unset, AnEnum, AnIntEnum]
20+
a_property: Union[Unset, int, str]
2121
if isinstance(self.a_property, Unset):
2222
a_property = UNSET
2323
elif isinstance(self.a_property, AnEnum):
2424
a_property = UNSET
2525
if not isinstance(self.a_property, Unset):
26-
a_property = self.a_property
26+
a_property = self.a_property.value
2727

2828
else:
2929
a_property = UNSET
3030
if not isinstance(self.a_property, Unset):
31-
a_property = self.a_property
31+
a_property = self.a_property.value
3232

3333
field_dict: Dict[str, Any] = {}
3434
field_dict.update(self.additional_properties)
@@ -42,24 +42,30 @@ def to_dict(self) -> Dict[str, Any]:
4242
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
d = src_dict.copy()
4444

45-
def _parse_a_property(data: Any) -> Union[Unset, AnEnum, AnIntEnum]:
46-
data = None if isinstance(data, Unset) else data
47-
a_property: Union[Unset, AnEnum, AnIntEnum]
45+
def _parse_a_property(data: object) -> Union[AnEnum, AnIntEnum, Unset]:
46+
if isinstance(data, Unset):
47+
return data
4848
try:
49-
a_property = UNSET
50-
_a_property = data
51-
if not isinstance(_a_property, Unset):
52-
a_property = AnEnum(_a_property)
53-
54-
return a_property
49+
a_property_type0: Union[Unset, AnEnum]
50+
if not isinstance(data, str):
51+
raise TypeError()
52+
a_property_type0 = UNSET
53+
_a_property_type0 = data
54+
if not isinstance(_a_property_type0, Unset):
55+
a_property_type0 = AnEnum(_a_property_type0)
56+
57+
return a_property_type0
5558
except: # noqa: E722
5659
pass
57-
a_property = UNSET
58-
_a_property = data
59-
if not isinstance(_a_property, Unset):
60-
a_property = AnIntEnum(_a_property)
61-
62-
return a_property
60+
if not isinstance(data, int):
61+
raise TypeError()
62+
a_property_type1: Union[Unset, AnIntEnum]
63+
a_property_type1 = UNSET
64+
_a_property_type1 = data
65+
if not isinstance(_a_property_type1, Unset):
66+
a_property_type1 = AnIntEnum(_a_property_type1)
67+
68+
return a_property_type1
6369

6470
a_property = _parse_a_property(d.pop("a_property", UNSET))
6571

end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_nullable_model.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
class AModelNullableModel:
1414
""" """
1515

16-
a_property: Union[Unset, AnEnum, AnIntEnum] = UNSET
16+
a_property: Union[AnEnum, AnIntEnum, Unset] = UNSET
1717
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
1818

1919
def to_dict(self) -> Dict[str, Any]:
20-
a_property: Union[Unset, AnEnum, AnIntEnum]
20+
a_property: Union[Unset, int, str]
2121
if isinstance(self.a_property, Unset):
2222
a_property = UNSET
2323
elif isinstance(self.a_property, AnEnum):
2424
a_property = UNSET
2525
if not isinstance(self.a_property, Unset):
26-
a_property = self.a_property
26+
a_property = self.a_property.value
2727

2828
else:
2929
a_property = UNSET
3030
if not isinstance(self.a_property, Unset):
31-
a_property = self.a_property
31+
a_property = self.a_property.value
3232

3333
field_dict: Dict[str, Any] = {}
3434
field_dict.update(self.additional_properties)
@@ -42,24 +42,30 @@ def to_dict(self) -> Dict[str, Any]:
4242
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
d = src_dict.copy()
4444

45-
def _parse_a_property(data: Any) -> Union[Unset, AnEnum, AnIntEnum]:
46-
data = None if isinstance(data, Unset) else data
47-
a_property: Union[Unset, AnEnum, AnIntEnum]
45+
def _parse_a_property(data: object) -> Union[AnEnum, AnIntEnum, Unset]:
46+
if isinstance(data, Unset):
47+
return data
4848
try:
49-
a_property = UNSET
50-
_a_property = data
51-
if not isinstance(_a_property, Unset):
52-
a_property = AnEnum(_a_property)
53-
54-
return a_property
49+
a_property_type0: Union[Unset, AnEnum]
50+
if not isinstance(data, str):
51+
raise TypeError()
52+
a_property_type0 = UNSET
53+
_a_property_type0 = data
54+
if not isinstance(_a_property_type0, Unset):
55+
a_property_type0 = AnEnum(_a_property_type0)
56+
57+
return a_property_type0
5558
except: # noqa: E722
5659
pass
57-
a_property = UNSET
58-
_a_property = data
59-
if not isinstance(_a_property, Unset):
60-
a_property = AnIntEnum(_a_property)
61-
62-
return a_property
60+
if not isinstance(data, int):
61+
raise TypeError()
62+
a_property_type1: Union[Unset, AnIntEnum]
63+
a_property_type1 = UNSET
64+
_a_property_type1 = data
65+
if not isinstance(_a_property_type1, Unset):
66+
a_property_type1 = AnIntEnum(_a_property_type1)
67+
68+
return a_property_type1
6369

6470
a_property = _parse_a_property(d.pop("a_property", UNSET))
6571

end_to_end_tests/golden-record/my_test_api_client/models/a_model_model.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
class AModelModel:
1414
""" """
1515

16-
a_property: Union[Unset, AnEnum, AnIntEnum] = UNSET
16+
a_property: Union[AnEnum, AnIntEnum, Unset] = UNSET
1717
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
1818

1919
def to_dict(self) -> Dict[str, Any]:
20-
a_property: Union[Unset, AnEnum, AnIntEnum]
20+
a_property: Union[Unset, int, str]
2121
if isinstance(self.a_property, Unset):
2222
a_property = UNSET
2323
elif isinstance(self.a_property, AnEnum):
2424
a_property = UNSET
2525
if not isinstance(self.a_property, Unset):
26-
a_property = self.a_property
26+
a_property = self.a_property.value
2727

2828
else:
2929
a_property = UNSET
3030
if not isinstance(self.a_property, Unset):
31-
a_property = self.a_property
31+
a_property = self.a_property.value
3232

3333
field_dict: Dict[str, Any] = {}
3434
field_dict.update(self.additional_properties)
@@ -42,24 +42,30 @@ def to_dict(self) -> Dict[str, Any]:
4242
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
4343
d = src_dict.copy()
4444

45-
def _parse_a_property(data: Any) -> Union[Unset, AnEnum, AnIntEnum]:
46-
data = None if isinstance(data, Unset) else data
47-
a_property: Union[Unset, AnEnum, AnIntEnum]
45+
def _parse_a_property(data: object) -> Union[AnEnum, AnIntEnum, Unset]:
46+
if isinstance(data, Unset):
47+
return data
4848
try:
49-
a_property = UNSET
50-
_a_property = data
51-
if not isinstance(_a_property, Unset):
52-
a_property = AnEnum(_a_property)
53-
54-
return a_property
49+
a_property_type0: Union[Unset, AnEnum]
50+
if not isinstance(data, str):
51+
raise TypeError()
52+
a_property_type0 = UNSET
53+
_a_property_type0 = data
54+
if not isinstance(_a_property_type0, Unset):
55+
a_property_type0 = AnEnum(_a_property_type0)
56+
57+
return a_property_type0
5558
except: # noqa: E722
5659
pass
57-
a_property = UNSET
58-
_a_property = data
59-
if not isinstance(_a_property, Unset):
60-
a_property = AnIntEnum(_a_property)
61-
62-
return a_property
60+
if not isinstance(data, int):
61+
raise TypeError()
62+
a_property_type1: Union[Unset, AnIntEnum]
63+
a_property_type1 = UNSET
64+
_a_property_type1 = data
65+
if not isinstance(_a_property_type1, Unset):
66+
a_property_type1 = AnIntEnum(_a_property_type1)
67+
68+
return a_property_type1
6369

6470
a_property = _parse_a_property(d.pop("a_property", UNSET))
6571

0 commit comments

Comments
 (0)