@ -24,7 +24,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = response.json()
|
||||
return response_200
|
||||
@ -34,10 +34,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, dict, Er
|
||||
if response.status_code == 500:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
return Error.from_dict(response.json())
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Error]]:
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[dict, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -49,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, dict, Er
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, dict, Error]]:
|
||||
) -> Response[Optional[Union[dict, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -65,7 +67,7 @@ def sync_detailed(
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, dict, Error]]:
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
@ -75,7 +77,7 @@ def sync(
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, dict, Error]]:
|
||||
) -> Response[Optional[Union[dict, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -89,7 +91,7 @@ async def asyncio_detailed(
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, dict, Error]]:
|
||||
) -> Optional[Union[dict, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
|
Reference in New Issue
Block a user