|
6 | 6 | from ..core.request_options import RequestOptions |
7 | 7 | from .types.blocks_list_response_item import BlocksListResponseItem |
8 | 8 | from ..core.datetime_utils import serialize_datetime |
9 | | -from ..core.pydantic_utilities import parse_obj_as |
| 9 | +from ..core.unchecked_base_model import construct_type |
10 | 10 | from json.decoder import JSONDecodeError |
11 | 11 | from ..core.api_error import ApiError |
12 | 12 | from .types.blocks_create_request import BlocksCreateRequest |
@@ -99,7 +99,7 @@ def list( |
99 | 99 | if 200 <= _response.status_code < 300: |
100 | 100 | return typing.cast( |
101 | 101 | typing.List[BlocksListResponseItem], |
102 | | - parse_obj_as( |
| 102 | + construct_type( |
103 | 103 | type_=typing.List[BlocksListResponseItem], # type: ignore |
104 | 104 | object_=_response.json(), |
105 | 105 | ), |
@@ -138,7 +138,7 @@ def create( |
138 | 138 | if 200 <= _response.status_code < 300: |
139 | 139 | return typing.cast( |
140 | 140 | BlocksCreateResponse, |
141 | | - parse_obj_as( |
| 141 | + construct_type( |
142 | 142 | type_=BlocksCreateResponse, # type: ignore |
143 | 143 | object_=_response.json(), |
144 | 144 | ), |
@@ -171,7 +171,7 @@ def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = Non |
171 | 171 | if 200 <= _response.status_code < 300: |
172 | 172 | return typing.cast( |
173 | 173 | BlocksGetResponse, |
174 | | - parse_obj_as( |
| 174 | + construct_type( |
175 | 175 | type_=BlocksGetResponse, # type: ignore |
176 | 176 | object_=_response.json(), |
177 | 177 | ), |
@@ -204,7 +204,7 @@ def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = |
204 | 204 | if 200 <= _response.status_code < 300: |
205 | 205 | return typing.cast( |
206 | 206 | BlocksDeleteResponse, |
207 | | - parse_obj_as( |
| 207 | + construct_type( |
208 | 208 | type_=BlocksDeleteResponse, # type: ignore |
209 | 209 | object_=_response.json(), |
210 | 210 | ), |
@@ -245,7 +245,7 @@ def update( |
245 | 245 | if 200 <= _response.status_code < 300: |
246 | 246 | return typing.cast( |
247 | 247 | BlocksUpdateResponse, |
248 | | - parse_obj_as( |
| 248 | + construct_type( |
249 | 249 | type_=BlocksUpdateResponse, # type: ignore |
250 | 250 | object_=_response.json(), |
251 | 251 | ), |
@@ -332,7 +332,7 @@ async def list( |
332 | 332 | if 200 <= _response.status_code < 300: |
333 | 333 | return typing.cast( |
334 | 334 | typing.List[BlocksListResponseItem], |
335 | | - parse_obj_as( |
| 335 | + construct_type( |
336 | 336 | type_=typing.List[BlocksListResponseItem], # type: ignore |
337 | 337 | object_=_response.json(), |
338 | 338 | ), |
@@ -371,7 +371,7 @@ async def create( |
371 | 371 | if 200 <= _response.status_code < 300: |
372 | 372 | return typing.cast( |
373 | 373 | BlocksCreateResponse, |
374 | | - parse_obj_as( |
| 374 | + construct_type( |
375 | 375 | type_=BlocksCreateResponse, # type: ignore |
376 | 376 | object_=_response.json(), |
377 | 377 | ), |
@@ -404,7 +404,7 @@ async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] |
404 | 404 | if 200 <= _response.status_code < 300: |
405 | 405 | return typing.cast( |
406 | 406 | BlocksGetResponse, |
407 | | - parse_obj_as( |
| 407 | + construct_type( |
408 | 408 | type_=BlocksGetResponse, # type: ignore |
409 | 409 | object_=_response.json(), |
410 | 410 | ), |
@@ -437,7 +437,7 @@ async def delete(self, id: str, *, request_options: typing.Optional[RequestOptio |
437 | 437 | if 200 <= _response.status_code < 300: |
438 | 438 | return typing.cast( |
439 | 439 | BlocksDeleteResponse, |
440 | | - parse_obj_as( |
| 440 | + construct_type( |
441 | 441 | type_=BlocksDeleteResponse, # type: ignore |
442 | 442 | object_=_response.json(), |
443 | 443 | ), |
@@ -478,7 +478,7 @@ async def update( |
478 | 478 | if 200 <= _response.status_code < 300: |
479 | 479 | return typing.cast( |
480 | 480 | BlocksUpdateResponse, |
481 | | - parse_obj_as( |
| 481 | + construct_type( |
482 | 482 | type_=BlocksUpdateResponse, # type: ignore |
483 | 483 | object_=_response.json(), |
484 | 484 | ), |
|
0 commit comments