Skip to content

Commit 67bce41

Browse files
Regen
1 parent 97063d5 commit 67bce41

File tree

8 files changed

+54
-36
lines changed

8 files changed

+54
-36
lines changed

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/defaults_tests_defaults_post.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,32 +122,38 @@ def httpx_request(
122122
params: Dict[str, Any] = {
123123
"required_not_nullable_datetime_prop": json_required_not_nullable_datetime_prop,
124124
}
125-
if string_prop is not UNSET and string_prop is not None:
125+
if not isinstance(string_prop, Unset) and string_prop is not None:
126126
params["string_prop"] = string_prop
127-
if not_required_not_nullable_datetime_prop is not UNSET and not_required_not_nullable_datetime_prop is not None:
127+
if (
128+
not isinstance(json_not_required_not_nullable_datetime_prop, Unset)
129+
and json_not_required_not_nullable_datetime_prop is not None
130+
):
128131
params["not_required_not_nullable_datetime_prop"] = json_not_required_not_nullable_datetime_prop
129-
if not_required_nullable_datetime_prop is not UNSET and not_required_nullable_datetime_prop is not None:
132+
if (
133+
not isinstance(json_not_required_nullable_datetime_prop, Unset)
134+
and json_not_required_nullable_datetime_prop is not None
135+
):
130136
params["not_required_nullable_datetime_prop"] = json_not_required_nullable_datetime_prop
131-
if required_nullable_datetime_prop is not None:
137+
if json_required_nullable_datetime_prop is not None:
132138
params["required_nullable_datetime_prop"] = json_required_nullable_datetime_prop
133-
if date_prop is not UNSET and date_prop is not None:
139+
if not isinstance(json_date_prop, Unset) and json_date_prop is not None:
134140
params["date_prop"] = json_date_prop
135-
if float_prop is not UNSET and float_prop is not None:
141+
if not isinstance(float_prop, Unset) and float_prop is not None:
136142
params["float_prop"] = float_prop
137-
if int_prop is not UNSET and int_prop is not None:
143+
if not isinstance(int_prop, Unset) and int_prop is not None:
138144
params["int_prop"] = int_prop
139-
if boolean_prop is not UNSET and boolean_prop is not None:
145+
if not isinstance(boolean_prop, Unset) and boolean_prop is not None:
140146
params["boolean_prop"] = boolean_prop
141-
if list_prop is not UNSET and list_prop is not None:
147+
if not isinstance(json_list_prop, Unset) and json_list_prop is not None:
142148
params["list_prop"] = json_list_prop
143-
if union_prop is not UNSET and union_prop is not None:
149+
if not isinstance(json_union_prop, Unset) and json_union_prop is not None:
144150
params["union_prop"] = json_union_prop
145-
if union_prop_with_ref is not UNSET and union_prop_with_ref is not None:
151+
if not isinstance(json_union_prop_with_ref, Unset) and json_union_prop_with_ref is not None:
146152
params["union_prop_with_ref"] = json_union_prop_with_ref
147-
if enum_prop is not UNSET and enum_prop is not None:
153+
if not isinstance(json_enum_prop, Unset) and json_enum_prop is not None:
148154
params["enum_prop"] = json_enum_prop
149-
if model_prop is not UNSET and model_prop is not None:
150-
params["model_prop"] = json_model_prop
155+
if not isinstance(json_model_prop, Unset) and json_model_prop is not None:
156+
params.update(json_model_prop)
151157

152158
response = client.request(
153159
"post",

end_to_end_tests/golden-record-custom/custom_e2e/api/tests/optional_value_tests_optional_query_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def httpx_request(
4747
json_query_param = query_param
4848

4949
params: Dict[str, Any] = {}
50-
if query_param is not UNSET and query_param is not None:
50+
if not isinstance(json_query_param, Unset) and json_query_param is not None:
5151
params["query_param"] = json_query_param
5252

5353
response = client.request(

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,14 @@ def _parse_a_camel_date_time(data: Any) -> Union[datetime.datetime, datetime.dat
153153

154154
not_required_not_nullable = d.pop("not_required_not_nullable", UNSET)
155155

156-
nullable_model = AModelNullableModel.from_dict(d.pop("nullable_model"))
156+
nullable_model = None
157+
_nullable_model = d.pop("nullable_model")
158+
if _nullable_model is not None:
159+
nullable_model = AModelNullableModel.from_dict(cast(Dict[str, Any], _nullable_model))
157160

158161
not_required_model: Union[Unset, AModelNotRequiredModel] = UNSET
159162
_not_required_model = d.pop("not_required_model", UNSET)
160-
if _not_required_model is not None and not isinstance(_not_required_model, Unset):
163+
if not isinstance(_not_required_model, Unset):
161164
not_required_model = AModelNotRequiredModel.from_dict(cast(Dict[str, Any], _not_required_model))
162165

163166
not_required_nullable_model = None

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_dict(src_dict: Dict[str, Any]) -> "ModelWithPrimitiveAdditionalProperti
3333
d = src_dict.copy()
3434
a_date_holder: Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder] = UNSET
3535
_a_date_holder = d.pop("a_date_holder", UNSET)
36-
if _a_date_holder is not None and not isinstance(_a_date_holder, Unset):
36+
if not isinstance(_a_date_holder, Unset):
3737
a_date_holder = ModelWithPrimitiveAdditionalPropertiesADateHolder.from_dict(
3838
cast(Dict[str, Any], _a_date_holder)
3939
)

end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,32 +98,38 @@ def _get_kwargs(
9898
params: Dict[str, Any] = {
9999
"required_not_nullable_datetime_prop": json_required_not_nullable_datetime_prop,
100100
}
101-
if string_prop is not UNSET and string_prop is not None:
101+
if not isinstance(string_prop, Unset) and string_prop is not None:
102102
params["string_prop"] = string_prop
103-
if not_required_not_nullable_datetime_prop is not UNSET and not_required_not_nullable_datetime_prop is not None:
103+
if (
104+
not isinstance(json_not_required_not_nullable_datetime_prop, Unset)
105+
and json_not_required_not_nullable_datetime_prop is not None
106+
):
104107
params["not_required_not_nullable_datetime_prop"] = json_not_required_not_nullable_datetime_prop
105-
if not_required_nullable_datetime_prop is not UNSET and not_required_nullable_datetime_prop is not None:
108+
if (
109+
not isinstance(json_not_required_nullable_datetime_prop, Unset)
110+
and json_not_required_nullable_datetime_prop is not None
111+
):
106112
params["not_required_nullable_datetime_prop"] = json_not_required_nullable_datetime_prop
107-
if required_nullable_datetime_prop is not None:
113+
if json_required_nullable_datetime_prop is not None:
108114
params["required_nullable_datetime_prop"] = json_required_nullable_datetime_prop
109-
if date_prop is not UNSET and date_prop is not None:
115+
if not isinstance(json_date_prop, Unset) and json_date_prop is not None:
110116
params["date_prop"] = json_date_prop
111-
if float_prop is not UNSET and float_prop is not None:
117+
if not isinstance(float_prop, Unset) and float_prop is not None:
112118
params["float_prop"] = float_prop
113-
if int_prop is not UNSET and int_prop is not None:
119+
if not isinstance(int_prop, Unset) and int_prop is not None:
114120
params["int_prop"] = int_prop
115-
if boolean_prop is not UNSET and boolean_prop is not None:
121+
if not isinstance(boolean_prop, Unset) and boolean_prop is not None:
116122
params["boolean_prop"] = boolean_prop
117-
if list_prop is not UNSET and list_prop is not None:
123+
if not isinstance(json_list_prop, Unset) and json_list_prop is not None:
118124
params["list_prop"] = json_list_prop
119-
if union_prop is not UNSET and union_prop is not None:
125+
if not isinstance(json_union_prop, Unset) and json_union_prop is not None:
120126
params["union_prop"] = json_union_prop
121-
if union_prop_with_ref is not UNSET and union_prop_with_ref is not None:
127+
if not isinstance(json_union_prop_with_ref, Unset) and json_union_prop_with_ref is not None:
122128
params["union_prop_with_ref"] = json_union_prop_with_ref
123-
if enum_prop is not UNSET and enum_prop is not None:
129+
if not isinstance(json_enum_prop, Unset) and json_enum_prop is not None:
124130
params["enum_prop"] = json_enum_prop
125-
if model_prop is not UNSET and model_prop is not None:
126-
params["model_prop"] = json_model_prop
131+
if not isinstance(json_model_prop, Unset) and json_model_prop is not None:
132+
params.update(json_model_prop)
127133

128134
return {
129135
"url": url,

end_to_end_tests/golden-record/my_test_api_client/api/tests/optional_value_tests_optional_query_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get_kwargs(
2424
json_query_param = query_param
2525

2626
params: Dict[str, Any] = {}
27-
if query_param is not UNSET and query_param is not None:
27+
if not isinstance(json_query_param, Unset) and json_query_param is not None:
2828
params["query_param"] = json_query_param
2929

3030
return {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,14 @@ def _parse_a_camel_date_time(data: Any) -> Union[datetime.datetime, datetime.dat
153153

154154
not_required_not_nullable = d.pop("not_required_not_nullable", UNSET)
155155

156-
nullable_model = AModelNullableModel.from_dict(d.pop("nullable_model"))
156+
nullable_model = None
157+
_nullable_model = d.pop("nullable_model")
158+
if _nullable_model is not None:
159+
nullable_model = AModelNullableModel.from_dict(cast(Dict[str, Any], _nullable_model))
157160

158161
not_required_model: Union[Unset, AModelNotRequiredModel] = UNSET
159162
_not_required_model = d.pop("not_required_model", UNSET)
160-
if _not_required_model is not None and not isinstance(_not_required_model, Unset):
163+
if not isinstance(_not_required_model, Unset):
161164
not_required_model = AModelNotRequiredModel.from_dict(cast(Dict[str, Any], _not_required_model))
162165

163166
not_required_nullable_model = None

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def from_dict(src_dict: Dict[str, Any]) -> "ModelWithPrimitiveAdditionalProperti
3333
d = src_dict.copy()
3434
a_date_holder: Union[Unset, ModelWithPrimitiveAdditionalPropertiesADateHolder] = UNSET
3535
_a_date_holder = d.pop("a_date_holder", UNSET)
36-
if _a_date_holder is not None and not isinstance(_a_date_holder, Unset):
36+
if not isinstance(_a_date_holder, Unset):
3737
a_date_holder = ModelWithPrimitiveAdditionalPropertiesADateHolder.from_dict(
3838
cast(Dict[str, Any], _a_date_holder)
3939
)

0 commit comments

Comments
 (0)