1
kittycad/api/api-calls/__init__.py
Normal file
1
kittycad/api/api-calls/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the api-calls API paths: API calls that have been performed by users can be queried by the API. This is helpful for debugging as well as billing. """
|
||||
113
kittycad/api/api-calls/get_api_call.py
Normal file
113
kittycad/api/api-calls/get_api_call.py
Normal file
@ -0,0 +1,113 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/api-calls/{id}".format(client.base_url, id=id)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ApiCallWithPrice.from_dict(response.json())
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
|
||||
If the user is not authenticated to view the specified API call, then it is not returned.
|
||||
Only KittyCAD employees can view API calls for other users. """
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.
|
||||
If the user is not authenticated to view the specified API call, then it is not returned.
|
||||
Only KittyCAD employees can view API calls for other users. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
109
kittycad/api/api-calls/get_api_call_for_user.py
Normal file
109
kittycad/api/api-calls/get_api_call_for_user.py
Normal file
@ -0,0 +1,109 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/api-calls/{id}".format(client.base_url, id=id)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ApiCallWithPrice.from_dict(response.json())
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user. """
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, ApiCallWithPrice, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, ApiCallWithPrice, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
113
kittycad/api/api-calls/get_api_call_metrics.py
Normal file
113
kittycad/api/api-calls/get_api_call_metrics.py
Normal file
@ -0,0 +1,113 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_query_group import ApiCallQueryGroup
|
||||
from ...models.error import Error
|
||||
from ...models.api_call_query_group_by import ApiCallQueryGroupBy
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
group_by: ApiCallQueryGroupBy,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/api-call-metrics".format(client.base_url, group_by=group_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [
|
||||
ApiCallQueryGroup.from_dict(item)
|
||||
for item in response.json()
|
||||
]
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
group_by: ApiCallQueryGroupBy,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
group_by=group_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
group_by: ApiCallQueryGroupBy,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
""" This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed. """
|
||||
|
||||
return sync_detailed(
|
||||
group_by=group_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
group_by: ApiCallQueryGroupBy,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
group_by=group_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
group_by: ApiCallQueryGroupBy,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallQueryGroup], Error]]:
|
||||
""" This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
group_by=group_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
131
kittycad/api/api-calls/list_api_calls.py
Normal file
131
kittycad/api/api-calls/list_api_calls.py
Normal file
@ -0,0 +1,131 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/api-calls".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [
|
||||
ApiCallWithPrice.from_dict(item)
|
||||
for item in response.json()
|
||||
]
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
146
kittycad/api/api-calls/list_api_calls_for_user.py
Normal file
146
kittycad/api/api-calls/list_api_calls_for_user.py
Normal file
@ -0,0 +1,146 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users/{id}/api-calls".format(client.base_url, id=id, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [
|
||||
ApiCallWithPrice.from_dict(item)
|
||||
for item in response.json()
|
||||
]
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
|
||||
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
|
||||
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if "me" is passed as the user id.
|
||||
Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.
|
||||
If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
133
kittycad/api/api-calls/user_list_api_calls.py
Normal file
133
kittycad/api/api-calls/user_list_api_calls.py
Normal file
@ -0,0 +1,133 @@
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.api_call_with_price import ApiCallWithPrice
|
||||
from ...models.error import Error
|
||||
from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/api-calls".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
|
||||
return {
|
||||
"url": url,
|
||||
"headers": headers,
|
||||
"cookies": cookies,
|
||||
"timeout": client.get_timeout(),
|
||||
}
|
||||
|
||||
|
||||
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = [
|
||||
ApiCallWithPrice.from_dict(item)
|
||||
for item in response.json()
|
||||
]
|
||||
return response_200
|
||||
if response.status_code == 4XX:
|
||||
response_4XX = Error.from_dict(response.json())
|
||||
return response_4XX
|
||||
if response.status_code == 5XX:
|
||||
response_5XX = Error.from_dict(response.json())
|
||||
return response_5XX
|
||||
return None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return sync_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
|
||||
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
|
||||
response = await _client.get(**kwargs)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: integer,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, [ApiCallWithPrice], Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.
|
||||
The API calls are returned in order of creation, with the most recently created API calls first. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
limit=limit,
|
||||
page_token=page_token,
|
||||
sort_by=sort_by,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
Reference in New Issue
Block a user