@ -24,7 +24,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, str, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[str, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = response.text
|
||||
return response_200
|
||||
@ -34,10 +34,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, str, Err
|
||||
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, str, Error]]:
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[str, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -49,7 +51,7 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, str, Err
|
||||
def sync_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, str, Error]]:
|
||||
) -> Response[Optional[Union[str, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -65,7 +67,7 @@ def sync_detailed(
|
||||
def sync(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, str, Error]]:
|
||||
) -> Optional[Union[str, Error]]:
|
||||
"""This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser""" # noqa: E501
|
||||
|
||||
return sync_detailed(
|
||||
@ -76,7 +78,7 @@ def sync(
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, str, Error]]:
|
||||
) -> Response[Optional[Union[str, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
client=client,
|
||||
)
|
||||
@ -90,7 +92,7 @@ async def asyncio_detailed(
|
||||
async def asyncio(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, str, Error]]:
|
||||
) -> Optional[Union[str, Error]]:
|
||||
"""This info is sent to front when initialing the front chat, it prevents impersonations using js hacks in the browser""" # noqa: E501
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user