7
7
from ...client import Client
8
8
from ...models .an_enum import AnEnum
9
9
from ...models .http_validation_error import HTTPValidationError
10
+ from ...models .model_with_union_property import ModelWithUnionProperty
10
11
from ...types import UNSET , Response , Unset
11
12
12
13
@@ -26,6 +27,7 @@ def _get_kwargs(
26
27
union_prop : Union [Unset , None , float , str ] = "not a float" ,
27
28
union_prop_with_ref : Union [Unset , None , float , AnEnum ] = 0.6 ,
28
29
enum_prop : Union [Unset , None , AnEnum ] = UNSET ,
30
+ model_prop : Union [Unset , None , ModelWithUnionProperty ] = UNSET ,
29
31
) -> Dict [str , Any ]:
30
32
url = "{}/tests/defaults" .format (client .base_url )
31
33
@@ -89,6 +91,10 @@ def _get_kwargs(
89
91
if not isinstance (enum_prop , Unset ):
90
92
json_enum_prop = enum_prop .value if enum_prop else None
91
93
94
+ json_model_prop : Union [Unset , None , Dict [str , Any ]] = UNSET
95
+ if not isinstance (model_prop , Unset ):
96
+ json_model_prop = model_prop .to_dict () if model_prop else None
97
+
92
98
params : Dict [str , Any ] = {
93
99
"required_not_nullable_datetime_prop" : json_required_not_nullable_datetime_prop ,
94
100
}
@@ -116,6 +122,8 @@ def _get_kwargs(
116
122
params ["union_prop_with_ref" ] = json_union_prop_with_ref
117
123
if enum_prop is not UNSET and enum_prop is not None :
118
124
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
119
127
120
128
return {
121
129
"url" : url ,
@@ -163,6 +171,7 @@ def sync_detailed(
163
171
union_prop : Union [Unset , None , float , str ] = "not a float" ,
164
172
union_prop_with_ref : Union [Unset , None , float , AnEnum ] = 0.6 ,
165
173
enum_prop : Union [Unset , None , AnEnum ] = UNSET ,
174
+ model_prop : Union [Unset , None , ModelWithUnionProperty ] = UNSET ,
166
175
) -> Response [Union [None , HTTPValidationError ]]:
167
176
kwargs = _get_kwargs (
168
177
client = client ,
@@ -179,6 +188,7 @@ def sync_detailed(
179
188
union_prop = union_prop ,
180
189
union_prop_with_ref = union_prop_with_ref ,
181
190
enum_prop = enum_prop ,
191
+ model_prop = model_prop ,
182
192
)
183
193
184
194
response = httpx .post (
@@ -204,6 +214,7 @@ def sync(
204
214
union_prop : Union [Unset , None , float , str ] = "not a float" ,
205
215
union_prop_with_ref : Union [Unset , None , float , AnEnum ] = 0.6 ,
206
216
enum_prop : Union [Unset , None , AnEnum ] = UNSET ,
217
+ model_prop : Union [Unset , None , ModelWithUnionProperty ] = UNSET ,
207
218
) -> Optional [Union [None , HTTPValidationError ]]:
208
219
""" """
209
220
@@ -222,6 +233,7 @@ def sync(
222
233
union_prop = union_prop ,
223
234
union_prop_with_ref = union_prop_with_ref ,
224
235
enum_prop = enum_prop ,
236
+ model_prop = model_prop ,
225
237
).parsed
226
238
227
239
@@ -241,6 +253,7 @@ async def asyncio_detailed(
241
253
union_prop : Union [Unset , None , float , str ] = "not a float" ,
242
254
union_prop_with_ref : Union [Unset , None , float , AnEnum ] = 0.6 ,
243
255
enum_prop : Union [Unset , None , AnEnum ] = UNSET ,
256
+ model_prop : Union [Unset , None , ModelWithUnionProperty ] = UNSET ,
244
257
) -> Response [Union [None , HTTPValidationError ]]:
245
258
kwargs = _get_kwargs (
246
259
client = client ,
@@ -257,6 +270,7 @@ async def asyncio_detailed(
257
270
union_prop = union_prop ,
258
271
union_prop_with_ref = union_prop_with_ref ,
259
272
enum_prop = enum_prop ,
273
+ model_prop = model_prop ,
260
274
)
261
275
262
276
async with httpx .AsyncClient () as _client :
@@ -281,6 +295,7 @@ async def asyncio(
281
295
union_prop : Union [Unset , None , float , str ] = "not a float" ,
282
296
union_prop_with_ref : Union [Unset , None , float , AnEnum ] = 0.6 ,
283
297
enum_prop : Union [Unset , None , AnEnum ] = UNSET ,
298
+ model_prop : Union [Unset , None , ModelWithUnionProperty ] = UNSET ,
284
299
) -> Optional [Union [None , HTTPValidationError ]]:
285
300
""" """
286
301
@@ -300,5 +315,6 @@ async def asyncio(
300
315
union_prop = union_prop ,
301
316
union_prop_with_ref = union_prop_with_ref ,
302
317
enum_prop = enum_prop ,
318
+ model_prop = model_prop ,
303
319
)
304
320
).parsed
0 commit comments