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
@@ -23,6 +24,7 @@ def _get_kwargs(
23
24
union_prop : Union [Unset , float , str ] = "not a float" ,
24
25
union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
25
26
enum_prop : Union [Unset , AnEnum ] = UNSET ,
27
+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
26
28
) -> Dict [str , Any ]:
27
29
url = "{}/tests/defaults" .format (client .base_url )
28
30
@@ -65,27 +67,33 @@ def _get_kwargs(
65
67
if not isinstance (enum_prop , Unset ):
66
68
json_enum_prop = enum_prop
67
69
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
+
68
74
params : Dict [str , Any ] = {}
69
- if string_prop is not UNSET :
75
+ if not isinstance ( string_prop , Unset ) and string_prop is not None :
70
76
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 :
72
78
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 :
74
80
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 :
76
82
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 :
78
84
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 :
80
86
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 :
82
88
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 :
84
90
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 :
86
92
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 :
88
94
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 )
89
97
90
98
return {
91
99
"url" : url ,
@@ -130,6 +138,7 @@ def sync_detailed(
130
138
union_prop : Union [Unset , float , str ] = "not a float" ,
131
139
union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
132
140
enum_prop : Union [Unset , AnEnum ] = UNSET ,
141
+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
133
142
) -> Response [Union [None , HTTPValidationError ]]:
134
143
kwargs = _get_kwargs (
135
144
client = client ,
@@ -143,6 +152,7 @@ def sync_detailed(
143
152
union_prop = union_prop ,
144
153
union_prop_with_ref = union_prop_with_ref ,
145
154
enum_prop = enum_prop ,
155
+ model_prop = model_prop ,
146
156
)
147
157
148
158
response = httpx .post (
@@ -165,6 +175,7 @@ def sync(
165
175
union_prop : Union [Unset , float , str ] = "not a float" ,
166
176
union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
167
177
enum_prop : Union [Unset , AnEnum ] = UNSET ,
178
+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
168
179
) -> Optional [Union [None , HTTPValidationError ]]:
169
180
""" """
170
181
@@ -180,6 +191,7 @@ def sync(
180
191
union_prop = union_prop ,
181
192
union_prop_with_ref = union_prop_with_ref ,
182
193
enum_prop = enum_prop ,
194
+ model_prop = model_prop ,
183
195
).parsed
184
196
185
197
@@ -196,6 +208,7 @@ async def asyncio_detailed(
196
208
union_prop : Union [Unset , float , str ] = "not a float" ,
197
209
union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
198
210
enum_prop : Union [Unset , AnEnum ] = UNSET ,
211
+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
199
212
) -> Response [Union [None , HTTPValidationError ]]:
200
213
kwargs = _get_kwargs (
201
214
client = client ,
@@ -209,6 +222,7 @@ async def asyncio_detailed(
209
222
union_prop = union_prop ,
210
223
union_prop_with_ref = union_prop_with_ref ,
211
224
enum_prop = enum_prop ,
225
+ model_prop = model_prop ,
212
226
)
213
227
214
228
async with httpx .AsyncClient () as _client :
@@ -230,6 +244,7 @@ async def asyncio(
230
244
union_prop : Union [Unset , float , str ] = "not a float" ,
231
245
union_prop_with_ref : Union [Unset , float , AnEnum ] = 0.6 ,
232
246
enum_prop : Union [Unset , AnEnum ] = UNSET ,
247
+ model_prop : Union [ModelWithUnionProperty , Unset ] = UNSET ,
233
248
) -> Optional [Union [None , HTTPValidationError ]]:
234
249
""" """
235
250
@@ -246,5 +261,6 @@ async def asyncio(
246
261
union_prop = union_prop ,
247
262
union_prop_with_ref = union_prop_with_ref ,
248
263
enum_prop = enum_prop ,
264
+ model_prop = model_prop ,
249
265
)
250
266
).parsed
0 commit comments