@ -26,7 +26,7 @@ def _get_kwargs(
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, Error]]:
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = User.from_dict(response.json())
|
||||
return response_200
|
||||
@ -36,10 +36,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, User, 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, User, Error]]:
|
||||
def _build_response(
|
||||
*, response: httpx.Response
|
||||
) -> Response[Optional[Union[User, Error]]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
@ -52,7 +54,7 @@ def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, User, Error]]:
|
||||
) -> Response[Optional[Union[User, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -70,7 +72,7 @@ def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, User, Error]]:
|
||||
) -> Optional[Union[User, Error]]:
|
||||
"""To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
|
||||
Alternatively, to get information about the authenticated user, use `/user` endpoint.
|
||||
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
|
||||
@ -85,7 +87,7 @@ async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, User, Error]]:
|
||||
) -> Response[Optional[Union[User, Error]]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
@ -101,7 +103,7 @@ async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, User, Error]]:
|
||||
) -> Optional[Union[User, Error]]:
|
||||
"""To get information about yourself, use `/users/me` as the endpoint. By doing so you will get the user information for the authenticated user.
|
||||
Alternatively, to get information about the authenticated user, use `/user` endpoint.
|
||||
To get information about any KittyCAD user, you must be a KittyCAD employee.""" # noqa: E501
|
||||
|
Reference in New Issue
Block a user