Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2023-09-29 16:05:40 -07:00
parent 31cd9e532d
commit 12c164620b
268 changed files with 22464 additions and 18287 deletions

View File

@ -10,33 +10,56 @@ from ...types import Response
def _get_kwargs(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Dict[str, Any]:
url = "{}/api-calls".format(
client.base_url,
) # noqa: E501
url = "{}/api-calls".format(client.base_url, ) # noqa: E501
if limit is not None:
if "?" in url:
url = url + "&limit=" + str(limit)
else:
url = url + "?limit=" + str(limit)
if page_token is not None:
if "?" in url:
url = url + "&page_token=" + str(page_token)
else:
url = url + "?page_token=" + str(page_token)
if sort_by is not None:
if "?" in url:
url = url + "&sort_by=" + str(sort_by)
else:
url = url + "?sort_by=" + str(sort_by)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
@ -46,27 +69,27 @@ def _get_kwargs(
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return Error.from_dict(response.json())
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiCallWithPriceResultsPage, Error]] :
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
return response_5XX
return Error.from_dict(response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -76,16 +99,37 @@ def _build_response(
def sync_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
@ -98,33 +142,75 @@ def sync_detailed(
def sync(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
) -> Optional[Union[ApiCallWithPriceResultsPage, 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.""" # noqa: E501
return sync_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
).parsed
async def asyncio_detailed(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
) -> Response[Optional[Union[ApiCallWithPriceResultsPage, Error]]]:
kwargs = _get_kwargs(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
@ -135,19 +221,40 @@ async def asyncio_detailed(
async def asyncio(
sort_by: CreatedAtSortMode,
*,
client: Client,
limit: Optional[int] = None,
page_token: Optional[str] = None,
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
) -> Optional[Union[ApiCallWithPriceResultsPage, 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.""" # noqa: E501
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed