Skip to content

Commit 817a79e

Browse files
committed
chore: Update e2e record after merge with main
1 parent 94f5678 commit 817a79e

File tree

8 files changed

+360
-16
lines changed

8 files changed

+360
-16
lines changed

Diff for: end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_model.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
from typing import Any, Dict, List, Type, TypeVar
1+
from typing import Any, Dict, List, Type, TypeVar, Union
22

33
import attr
44

5+
from ..models.an_enum import AnEnum
6+
from ..models.an_int_enum import AnIntEnum
7+
from ..types import UNSET, Unset
8+
59
T = TypeVar("T", bound="AModelModel")
610

711

812
@attr.s(auto_attribs=True)
913
class AModelModel:
1014
""" """
1115

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

1419
def to_dict(self) -> Dict[str, Any]:
20+
a_property: Union[Unset, AnEnum, AnIntEnum]
21+
if isinstance(self.a_property, Unset):
22+
a_property = UNSET
23+
elif isinstance(self.a_property, AnEnum):
24+
a_property = UNSET
25+
if not isinstance(self.a_property, Unset):
26+
a_property = self.a_property
27+
28+
else:
29+
a_property = UNSET
30+
if not isinstance(self.a_property, Unset):
31+
a_property = self.a_property
1532

1633
field_dict: Dict[str, Any] = {}
1734
field_dict.update(self.additional_properties)
1835
field_dict.update({})
36+
if a_property is not UNSET:
37+
field_dict["a_property"] = a_property
1938

2039
return field_dict
2140

2241
@classmethod
2342
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
2443
d = src_dict.copy()
25-
a_model_model = cls()
44+
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]
48+
try:
49+
a_property = UNSET
50+
_a_property = data
51+
if _a_property is not None and _a_property is not UNSET:
52+
a_property = AnEnum(_a_property)
53+
54+
return a_property
55+
except: # noqa: E722
56+
pass
57+
a_property = UNSET
58+
_a_property = data
59+
if _a_property is not None and _a_property is not UNSET:
60+
a_property = AnIntEnum(_a_property)
61+
62+
return a_property
63+
64+
a_property = _parse_a_property(d.pop("a_property", UNSET))
65+
66+
a_model_model = cls(
67+
a_property=a_property,
68+
)
2669

2770
a_model_model.additional_properties = d
2871
return a_model_model

Diff for: end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_not_required_model.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
from typing import Any, Dict, List, Type, TypeVar
1+
from typing import Any, Dict, List, Type, TypeVar, Union
22

33
import attr
44

5+
from ..models.an_enum import AnEnum
6+
from ..models.an_int_enum import AnIntEnum
7+
from ..types import UNSET, Unset
8+
59
T = TypeVar("T", bound="AModelNotRequiredModel")
610

711

812
@attr.s(auto_attribs=True)
913
class AModelNotRequiredModel:
1014
""" """
1115

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

1419
def to_dict(self) -> Dict[str, Any]:
20+
a_property: Union[Unset, AnEnum, AnIntEnum]
21+
if isinstance(self.a_property, Unset):
22+
a_property = UNSET
23+
elif isinstance(self.a_property, AnEnum):
24+
a_property = UNSET
25+
if not isinstance(self.a_property, Unset):
26+
a_property = self.a_property
27+
28+
else:
29+
a_property = UNSET
30+
if not isinstance(self.a_property, Unset):
31+
a_property = self.a_property
1532

1633
field_dict: Dict[str, Any] = {}
1734
field_dict.update(self.additional_properties)
1835
field_dict.update({})
36+
if a_property is not UNSET:
37+
field_dict["a_property"] = a_property
1938

2039
return field_dict
2140

2241
@classmethod
2342
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
2443
d = src_dict.copy()
25-
a_model_not_required_model = cls()
44+
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]
48+
try:
49+
a_property = UNSET
50+
_a_property = data
51+
if _a_property is not None and _a_property is not UNSET:
52+
a_property = AnEnum(_a_property)
53+
54+
return a_property
55+
except: # noqa: E722
56+
pass
57+
a_property = UNSET
58+
_a_property = data
59+
if _a_property is not None and _a_property is not UNSET:
60+
a_property = AnIntEnum(_a_property)
61+
62+
return a_property
63+
64+
a_property = _parse_a_property(d.pop("a_property", UNSET))
65+
66+
a_model_not_required_model = cls(
67+
a_property=a_property,
68+
)
2669

2770
a_model_not_required_model.additional_properties = d
2871
return a_model_not_required_model

Diff for: end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_not_required_nullable_model.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
from typing import Any, Dict, List, Type, TypeVar
1+
from typing import Any, Dict, List, Type, TypeVar, Union
22

33
import attr
44

5+
from ..models.an_enum import AnEnum
6+
from ..models.an_int_enum import AnIntEnum
7+
from ..types import UNSET, Unset
8+
59
T = TypeVar("T", bound="AModelNotRequiredNullableModel")
610

711

812
@attr.s(auto_attribs=True)
913
class AModelNotRequiredNullableModel:
1014
""" """
1115

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

1419
def to_dict(self) -> Dict[str, Any]:
20+
a_property: Union[Unset, AnEnum, AnIntEnum]
21+
if isinstance(self.a_property, Unset):
22+
a_property = UNSET
23+
elif isinstance(self.a_property, AnEnum):
24+
a_property = UNSET
25+
if not isinstance(self.a_property, Unset):
26+
a_property = self.a_property
27+
28+
else:
29+
a_property = UNSET
30+
if not isinstance(self.a_property, Unset):
31+
a_property = self.a_property
1532

1633
field_dict: Dict[str, Any] = {}
1734
field_dict.update(self.additional_properties)
1835
field_dict.update({})
36+
if a_property is not UNSET:
37+
field_dict["a_property"] = a_property
1938

2039
return field_dict
2140

2241
@classmethod
2342
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
2443
d = src_dict.copy()
25-
a_model_not_required_nullable_model = cls()
44+
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]
48+
try:
49+
a_property = UNSET
50+
_a_property = data
51+
if _a_property is not None and _a_property is not UNSET:
52+
a_property = AnEnum(_a_property)
53+
54+
return a_property
55+
except: # noqa: E722
56+
pass
57+
a_property = UNSET
58+
_a_property = data
59+
if _a_property is not None and _a_property is not UNSET:
60+
a_property = AnIntEnum(_a_property)
61+
62+
return a_property
63+
64+
a_property = _parse_a_property(d.pop("a_property", UNSET))
65+
66+
a_model_not_required_nullable_model = cls(
67+
a_property=a_property,
68+
)
2669

2770
a_model_not_required_nullable_model.additional_properties = d
2871
return a_model_not_required_nullable_model

Diff for: end_to_end_tests/golden-record-custom/custom_e2e/models/a_model_nullable_model.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
from typing import Any, Dict, List, Type, TypeVar
1+
from typing import Any, Dict, List, Type, TypeVar, Union
22

33
import attr
44

5+
from ..models.an_enum import AnEnum
6+
from ..models.an_int_enum import AnIntEnum
7+
from ..types import UNSET, Unset
8+
59
T = TypeVar("T", bound="AModelNullableModel")
610

711

812
@attr.s(auto_attribs=True)
913
class AModelNullableModel:
1014
""" """
1115

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

1419
def to_dict(self) -> Dict[str, Any]:
20+
a_property: Union[Unset, AnEnum, AnIntEnum]
21+
if isinstance(self.a_property, Unset):
22+
a_property = UNSET
23+
elif isinstance(self.a_property, AnEnum):
24+
a_property = UNSET
25+
if not isinstance(self.a_property, Unset):
26+
a_property = self.a_property
27+
28+
else:
29+
a_property = UNSET
30+
if not isinstance(self.a_property, Unset):
31+
a_property = self.a_property
1532

1633
field_dict: Dict[str, Any] = {}
1734
field_dict.update(self.additional_properties)
1835
field_dict.update({})
36+
if a_property is not UNSET:
37+
field_dict["a_property"] = a_property
1938

2039
return field_dict
2140

2241
@classmethod
2342
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
2443
d = src_dict.copy()
25-
a_model_nullable_model = cls()
44+
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]
48+
try:
49+
a_property = UNSET
50+
_a_property = data
51+
if _a_property is not None and _a_property is not UNSET:
52+
a_property = AnEnum(_a_property)
53+
54+
return a_property
55+
except: # noqa: E722
56+
pass
57+
a_property = UNSET
58+
_a_property = data
59+
if _a_property is not None and _a_property is not UNSET:
60+
a_property = AnIntEnum(_a_property)
61+
62+
return a_property
63+
64+
a_property = _parse_a_property(d.pop("a_property", UNSET))
65+
66+
a_model_nullable_model = cls(
67+
a_property=a_property,
68+
)
2669

2770
a_model_nullable_model.additional_properties = d
2871
return a_model_nullable_model

Diff for: end_to_end_tests/golden-record/my_test_api_client/models/a_model_model.py

+45-2
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,71 @@
1-
from typing import Any, Dict, List, Type, TypeVar
1+
from typing import Any, Dict, List, Type, TypeVar, Union
22

33
import attr
44

5+
from ..models.an_enum import AnEnum
6+
from ..models.an_int_enum import AnIntEnum
7+
from ..types import UNSET, Unset
8+
59
T = TypeVar("T", bound="AModelModel")
610

711

812
@attr.s(auto_attribs=True)
913
class AModelModel:
1014
""" """
1115

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

1419
def to_dict(self) -> Dict[str, Any]:
20+
a_property: Union[Unset, AnEnum, AnIntEnum]
21+
if isinstance(self.a_property, Unset):
22+
a_property = UNSET
23+
elif isinstance(self.a_property, AnEnum):
24+
a_property = UNSET
25+
if not isinstance(self.a_property, Unset):
26+
a_property = self.a_property
27+
28+
else:
29+
a_property = UNSET
30+
if not isinstance(self.a_property, Unset):
31+
a_property = self.a_property
1532

1633
field_dict: Dict[str, Any] = {}
1734
field_dict.update(self.additional_properties)
1835
field_dict.update({})
36+
if a_property is not UNSET:
37+
field_dict["a_property"] = a_property
1938

2039
return field_dict
2140

2241
@classmethod
2342
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
2443
d = src_dict.copy()
25-
a_model_model = cls()
44+
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]
48+
try:
49+
a_property = UNSET
50+
_a_property = data
51+
if _a_property is not None and _a_property is not UNSET:
52+
a_property = AnEnum(_a_property)
53+
54+
return a_property
55+
except: # noqa: E722
56+
pass
57+
a_property = UNSET
58+
_a_property = data
59+
if _a_property is not None and _a_property is not UNSET:
60+
a_property = AnIntEnum(_a_property)
61+
62+
return a_property
63+
64+
a_property = _parse_a_property(d.pop("a_property", UNSET))
65+
66+
a_model_model = cls(
67+
a_property=a_property,
68+
)
2669

2770
a_model_model.additional_properties = d
2871
return a_model_model

0 commit comments

Comments
 (0)