switch to pydantic

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2023-11-28 23:50:50 -08:00
parent d9d73522fd
commit bc3d698539
230 changed files with 4467 additions and 25280 deletions

View File

@ -62,15 +62,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity, Error]]:
if response.status_code == 201:
response_201 = FileDensity.from_dict(response.json())
response_201 = FileDensity(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(