77from ...client import Client
88from ...models .an_enum import AnEnum
99from ...models .http_validation_error import HTTPValidationError
10+ from ...models .model_with_union_property import ModelWithUnionProperty
1011from ...types import UNSET , Response , Unset
1112
1213
@@ -23,6 +24,7 @@ def _get_kwargs(
2324 union_prop : Union [Unset , float , str ] = "not a float" ,
2425 union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
2526 enum_prop : Union [Unset , AnEnum ] = UNSET ,
27+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
2628) -> Dict [str , Any ]:
2729 url = "{}/tests/defaults" .format (client .base_url )
2830
@@ -65,27 +67,33 @@ def _get_kwargs(
6567 if not isinstance (enum_prop , Unset ):
6668 json_enum_prop = enum_prop
6769
70+ json_model_prop : Union [Unset , Dict [str , Any ]] = UNSET
71+ if not isinstance (model_prop , Unset ):
72+ json_model_prop = model_prop .to_dict ()
73+
6874 params : Dict [str , Any ] = {}
69- if string_prop is not UNSET :
75+ if not isinstance ( string_prop , Unset ) and string_prop is not None :
7076 params ["string_prop" ] = string_prop
71- if datetime_prop is not UNSET :
77+ if not isinstance ( json_datetime_prop , Unset ) and json_datetime_prop is not None :
7278 params ["datetime_prop" ] = json_datetime_prop
73- if date_prop is not UNSET :
79+ if not isinstance ( json_date_prop , Unset ) and json_date_prop is not None :
7480 params ["date_prop" ] = json_date_prop
75- if float_prop is not UNSET :
81+ if not isinstance ( float_prop , Unset ) and float_prop is not None :
7682 params ["float_prop" ] = float_prop
77- if int_prop is not UNSET :
83+ if not isinstance ( int_prop , Unset ) and int_prop is not None :
7884 params ["int_prop" ] = int_prop
79- if boolean_prop is not UNSET :
85+ if not isinstance ( boolean_prop , Unset ) and boolean_prop is not None :
8086 params ["boolean_prop" ] = boolean_prop
81- if list_prop is not UNSET :
87+ if not isinstance ( json_list_prop , Unset ) and json_list_prop is not None :
8288 params ["list_prop" ] = json_list_prop
83- if union_prop is not UNSET :
89+ if not isinstance ( json_union_prop , Unset ) and json_union_prop is not None :
8490 params ["union_prop" ] = json_union_prop
85- if union_prop_with_ref is not UNSET :
91+ if not isinstance ( json_union_prop_with_ref , Unset ) and json_union_prop_with_ref is not None :
8692 params ["union_prop_with_ref" ] = json_union_prop_with_ref
87- if enum_prop is not UNSET :
93+ if not isinstance ( json_enum_prop , Unset ) and json_enum_prop is not None :
8894 params ["enum_prop" ] = json_enum_prop
95+ if not isinstance (json_model_prop , Unset ) and json_model_prop is not None :
96+ params .update (json_model_prop )
8997
9098 return {
9199 "url" : url ,
@@ -130,6 +138,7 @@ def sync_detailed(
130138 union_prop : Union [Unset , float , str ] = "not a float" ,
131139 union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
132140 enum_prop : Union [Unset , AnEnum ] = UNSET ,
141+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
133142) -> Response [Union [None , HTTPValidationError ]]:
134143 kwargs = _get_kwargs (
135144 client = client ,
@@ -143,6 +152,7 @@ def sync_detailed(
143152 union_prop = union_prop ,
144153 union_prop_with_ref = union_prop_with_ref ,
145154 enum_prop = enum_prop ,
155+ model_prop = model_prop ,
146156 )
147157
148158 response = httpx .post (
@@ -165,6 +175,7 @@ def sync(
165175 union_prop : Union [Unset , float , str ] = "not a float" ,
166176 union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
167177 enum_prop : Union [Unset , AnEnum ] = UNSET ,
178+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
168179) -> Optional [Union [None , HTTPValidationError ]]:
169180 """ """
170181
@@ -180,6 +191,7 @@ def sync(
180191 union_prop = union_prop ,
181192 union_prop_with_ref = union_prop_with_ref ,
182193 enum_prop = enum_prop ,
194+ model_prop = model_prop ,
183195 ).parsed
184196
185197
@@ -196,6 +208,7 @@ async def asyncio_detailed(
196208 union_prop : Union [Unset , float , str ] = "not a float" ,
197209 union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
198210 enum_prop : Union [Unset , AnEnum ] = UNSET ,
211+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
199212) -> Response [Union [None , HTTPValidationError ]]:
200213 kwargs = _get_kwargs (
201214 client = client ,
@@ -209,6 +222,7 @@ async def asyncio_detailed(
209222 union_prop = union_prop ,
210223 union_prop_with_ref = union_prop_with_ref ,
211224 enum_prop = enum_prop ,
225+ model_prop = model_prop ,
212226 )
213227
214228 async with httpx .AsyncClient () as _client :
@@ -230,6 +244,7 @@ async def asyncio(
230244 union_prop : Union [Unset , float , str ] = "not a float" ,
231245 union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
232246 enum_prop : Union [Unset , AnEnum ] = UNSET ,
247+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
233248) -> Optional [Union [None , HTTPValidationError ]]:
234249 """ """
235250
@@ -246,5 +261,6 @@ async def asyncio(
246261 union_prop = union_prop ,
247262 union_prop_with_ref = union_prop_with_ref ,
248263 enum_prop = enum_prop ,
264+ model_prop = model_prop ,
249265 )
250266 ).parsed
0 commit comments