Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-04-06 20:35:34 -07:00
parent 0ed9aaf127
commit 216b454c14
40 changed files with 3736 additions and 0 deletions

View 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. """

View 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

View 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

View 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

View 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

View 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

View 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

View File

@ -0,0 +1 @@
""" Contains methods for accessing the api-tokens API paths: API tokens allow users to call the API outside of their session token that is used as a cookie in the user interface. Users can create, delete, and list their API tokens. But, of course, you need an API token to do this, so first be sure to generate one in the account UI. """

View File

@ -0,0 +1,100 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_token import ApiToken
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens".format(client.base_url)
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, ApiToken, Error]]:
if response.status_code == 201:
response_201 = ApiToken.from_dict(response.json())
return response_201
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, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user. """
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user. """
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,110 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token)
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, Error]]:
if response.status_code == 204:
response_204 = None
return response_204
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, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.delete(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes. """
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.delete(**kwargs)
return _build_response(response=response)
async def asyncio(
token: str,
*,
client: Client,
) -> Optional[Union[Any, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.
This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes. """
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -0,0 +1,109 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_token import ApiToken
from ...models.error import Error
from ...types import Response
def _get_kwargs(
token: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/api-tokens/{token}".format(client.base_url, token=token)
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, ApiToken, Error]]:
if response.status_code == 200:
response_200 = ApiToken.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, ApiToken, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
token=token,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
token: str,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
return sync_detailed(
token=token,
client=client,
).parsed
async def asyncio_detailed(
token: str,
*,
client: Client,
) -> Response[Union[Any, ApiToken, Error]]:
kwargs = _get_kwargs(
token=token,
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(
token: str,
*,
client: Client,
) -> Optional[Union[Any, ApiToken, Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. """
return (
await asyncio_detailed(
token=token,
client=client,
)
).parsed

View File

@ -0,0 +1,133 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.api_token import ApiToken
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-tokens".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, [ApiToken], Error]]:
if response.status_code == 200:
response_200 = [
ApiToken.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, [ApiToken], 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, [ApiToken], 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, [ApiToken], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
The API tokens are returned in order of creation, with the most recently created API tokens 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, [ApiToken], 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, [ApiToken], Error]]:
""" This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
The API tokens are returned in order of creation, with the most recently created API tokens first. """
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,134 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...models.file_conversion_output_format import FileConversionOutputFormat
from ...models.file_conversion_source_format import FileConversionSourceFormat
from ...types import Response
def _get_kwargs(
output_format: FileConversionOutputFormat,
src_format: FileConversionSourceFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/conversion/{src_format}/{output_format}".format(client.base_url, output_format=output_format, src_format=src_format)
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(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
if response.status_code == 201:
response_201 = FileConversionWithOutput.from_dict(response.json())
return response_201
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, FileConversionWithOutput, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
output_format: FileConversionOutputFormat,
src_format: FileConversionSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
output_format: FileConversionOutputFormat,
src_format: FileConversionSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint. """
return sync_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
output_format: FileConversionOutputFormat,
src_format: FileConversionSourceFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileConversionWithOutput, Error]]:
kwargs = _get_kwargs(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
output_format: FileConversionOutputFormat,
src_format: FileConversionSourceFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileConversionWithOutput, Error]]:
""" Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.
If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.
If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint. """
return (
await asyncio_detailed(
output_format=output_format,
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -0,0 +1,115 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/conversions/{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, FileConversionWithOutput, Error]]:
if response.status_code == 200:
response_200 = FileConversionWithOutput.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, FileConversionWithOutput, 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, FileConversionWithOutput, 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, FileConversionWithOutput, Error]]:
""" Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned.
Only KittyCAD employees with the proper access can view file conversions for other users. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversionWithOutput, 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, FileConversionWithOutput, Error]]:
""" Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned.
Only KittyCAD employees with the proper access can view file conversions for other users. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,111 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/file/conversions/{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, FileConversionWithOutput, Error]]:
if response.status_code == 200:
response_200 = FileConversionWithOutput.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, FileConversionWithOutput, 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, FileConversionWithOutput, 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, FileConversionWithOutput, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversionWithOutput, 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, FileConversionWithOutput, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,133 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
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 = "{}/file/conversions".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, [FileConversion], Error]]:
if response.status_code == 200:
response_200 = [
FileConversion.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, [FileConversion], 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, [FileConversion], 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, [FileConversion], Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """
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, [FileConversion], 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, [FileConversion], Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by a KittyCAD employee. """
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,135 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
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/file/conversions".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, [FileConversion], Error]]:
if response.status_code == 200:
response_200 = [
FileConversion.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, [FileConversion], 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, [FileConversion], 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, [FileConversion], Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
The file conversions are returned in order of creation, with the most recently created file conversions 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, [FileConversion], 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, [FileConversion], Error]]:
""" This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.
This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.
The file conversions are returned in order of creation, with the most recently created file conversions first. """
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,98 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.dict import dict
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/".format(client.base_url)
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, dict, Error]]:
if response.status_code == 200:
response_200 = 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, dict, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
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(
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1 @@
""" Contains methods for accessing the users API paths: A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. """

View File

@ -0,0 +1,113 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.user import User
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users/{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, User, Error]]:
if response.status_code == 200:
response_200 = User.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, User, 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, User, 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, 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. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, User, 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, 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. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,113 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.extended_user import ExtendedUser
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/users-extended/{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, ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.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, ExtendedUser, 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, ExtendedUser, 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, ExtendedUser, Error]]:
""" To get information about yourself, use `/users-extended/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/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, ExtendedUser, 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, ExtendedUser, Error]]:
""" To get information about yourself, use `/users-extended/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/extended` endpoint.
To get information about any KittyCAD user, you must be a KittyCAD employee. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,102 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.user import User
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user".format(client.base_url)
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, User, Error]]:
if response.status_code == 200:
response_200 = User.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, User, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, User, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, User, Error]]:
""" Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint. """
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, User, Error]]:
kwargs = _get_kwargs(
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(
*,
client: Client,
) -> Optional[Union[Any, User, Error]]:
""" Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint. """
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,102 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.extended_user import ExtendedUser
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/extended".format(client.base_url)
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, ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.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, ExtendedUser, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, ExtendedUser, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, ExtendedUser, Error]]:
""" Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint. """
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, ExtendedUser, Error]]:
kwargs = _get_kwargs(
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(
*,
client: Client,
) -> Optional[Union[Any, ExtendedUser, Error]]:
""" Get the user information for the authenticated user.
Alternatively, you can also use the `/users/me` endpoint. """
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -0,0 +1,131 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.user import User
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 = "{}/users".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, [User], Error]]:
if response.status_code == 200:
response_200 = [
User.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, [User], 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, [User], 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, [User], Error]]:
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users 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, [User], 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, [User], Error]]:
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,131 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.extended_user import ExtendedUser
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 = "{}/users-extended".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, [ExtendedUser], Error]]:
if response.status_code == 200:
response_200 = [
ExtendedUser.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, [ExtendedUser], 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, [ExtendedUser], 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, [ExtendedUser], Error]]:
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users 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, [ExtendedUser], 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, [ExtendedUser], Error]]:
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
return (
await asyncio_detailed(
limit=limit,
page_token=page_token,
sort_by=sort_by,
client=client,
)
).parsed

View File

@ -0,0 +1,61 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="ApiCallQueryGroup")
@attr.s(auto_attribs=True)
class ApiCallQueryGroup:
""" """
count: Union[Unset, int] = UNSET
query: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
count = self.count
query = self.query
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if count is not UNSET:
field_dict['count'] = count
if query is not UNSET:
field_dict['query'] = query
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
count = d.pop("count", UNSET)
query = d.pop("query", UNSET)
api_call_query_group = cls(
count= count,
query= query,
)
api_call_query_group.additional_properties = d
return api_call_query_group
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,12 @@
from enum import Enum
class ApiCallQueryGroupBy(str, Enum):
EMAIL = 'email'
METHOD = 'method'
ENDPOINT = 'endpoint'
USER_ID = 'user_id'
ORIGIN = 'origin'
IP_ADDRESS = 'ip_address'
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,255 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..models.method import Method
from ..models.status_code import StatusCode
from ..types import UNSET, Unset
T = TypeVar("T", bound="ApiCallWithPrice")
@attr.s(auto_attribs=True)
class ApiCallWithPrice:
""" """
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
duration: Union[Unset, int] = UNSET
email: Union[Unset, str] = UNSET
endpoint: Union[Unset, str] = UNSET
id: Union[Unset, Uuid] = UNSET
ip_address: Union[Unset, str] = UNSET
method: Union[Unset, Method] = UNSET
minutes: Union[Unset, int] = UNSET
origin: Union[Unset, str] = UNSET
price: Union[Unset, float] = UNSET
request_body: Union[Unset, str] = UNSET
request_query_params: Union[Unset, str] = UNSET
response_body: Union[Unset, str] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status_code: Union[Unset, StatusCode] = UNSET
stripe_invoice_item_id: Union[Unset, str] = UNSET
token: Union[Unset, Uuid] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_agent: Union[Unset, str] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
duration = self.duration
email = self.email
endpoint = self.endpoint
id: Union[Unset, str] = UNSET
if not isinstance(self.id, Unset):
id = self.id.value
ip_address = self.ip_address
method: Union[Unset, str] = UNSET
if not isinstance(self.method, Unset):
method = self.method.value
minutes = self.minutes
origin = self.origin
price = self.price
request_body = self.request_body
request_query_params = self.request_query_params
response_body = self.response_body
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status_code: Union[Unset, str] = UNSET
if not isinstance(self.status_code, Unset):
status_code = self.status_code.value
stripe_invoice_item_id = self.stripe_invoice_item_id
token: Union[Unset, str] = UNSET
if not isinstance(self.token, Unset):
token = self.token.value
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_agent = self.user_agent
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict['completed_at'] = completed_at
if created_at is not UNSET:
field_dict['created_at'] = created_at
if duration is not UNSET:
field_dict['duration'] = duration
if email is not UNSET:
field_dict['email'] = email
if endpoint is not UNSET:
field_dict['endpoint'] = endpoint
if id is not UNSET:
field_dict['id'] = id
if ip_address is not UNSET:
field_dict['ip_address'] = ip_address
if method is not UNSET:
field_dict['method'] = method
if minutes is not UNSET:
field_dict['minutes'] = minutes
if origin is not UNSET:
field_dict['origin'] = origin
if price is not UNSET:
field_dict['price'] = price
if request_body is not UNSET:
field_dict['request_body'] = request_body
if request_query_params is not UNSET:
field_dict['request_query_params'] = request_query_params
if response_body is not UNSET:
field_dict['response_body'] = response_body
if started_at is not UNSET:
field_dict['started_at'] = started_at
if status_code is not UNSET:
field_dict['status_code'] = status_code
if stripe_invoice_item_id is not UNSET:
field_dict['stripe_invoice_item_id'] = stripe_invoice_item_id
if token is not UNSET:
field_dict['token'] = token
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
if user_agent is not UNSET:
field_dict['user_agent'] = user_agent
if user_id is not UNSET:
field_dict['user_id'] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
duration = d.pop("duration", UNSET)
email = d.pop("email", UNSET)
endpoint = d.pop("endpoint", UNSET)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
ip_address = d.pop("ip_address", UNSET)
_method = d.pop("method", UNSET)
method: Union[Unset, Method]
if isinstance(_method, Unset):
method = UNSET
else:
method = Method(_method)
minutes = d.pop("minutes", UNSET)
origin = d.pop("origin", UNSET)
price = d.pop("price", UNSET)
request_body = d.pop("request_body", UNSET)
request_query_params = d.pop("request_query_params", UNSET)
response_body = d.pop("response_body", UNSET)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status_code = d.pop("status_code", UNSET)
status_code: Union[Unset, StatusCode]
if isinstance(_status_code, Unset):
status_code = UNSET
else:
status_code = StatusCode(_status_code)
stripe_invoice_item_id = d.pop("stripe_invoice_item_id", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
else:
token = Uuid(_token)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user_agent = d.pop("user_agent", UNSET)
user_id = d.pop("user_id", UNSET)
api_call_with_price = cls(
completed_at= completed_at,
created_at= created_at,
duration= duration,
email= email,
endpoint= endpoint,
id= id,
ip_address= ip_address,
method= method,
minutes= minutes,
origin= origin,
price= price,
request_body= request_body,
request_query_params= request_query_params,
response_body= response_body,
started_at= started_at,
status_code= status_code,
stripe_invoice_item_id= stripe_invoice_item_id,
token= token,
updated_at= updated_at,
user_agent= user_agent,
user_id= user_id,
)
api_call_with_price.additional_properties = d
return api_call_with_price
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,113 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..types import UNSET, Unset
T = TypeVar("T", bound="ApiToken")
@attr.s(auto_attribs=True)
class ApiToken:
""" """
created_at: Union[Unset, datetime.datetime] = UNSET
id: Union[Unset, str] = UNSET
is_valid: Union[Unset, bool] = False
token: Union[Unset, Uuid] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
id = self.id
is_valid = self.is_valid
token: Union[Unset, str] = UNSET
if not isinstance(self.token, Unset):
token = self.token.value
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if created_at is not UNSET:
field_dict['created_at'] = created_at
if id is not UNSET:
field_dict['id'] = id
if is_valid is not UNSET:
field_dict['is_valid'] = is_valid
if token is not UNSET:
field_dict['token'] = token
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
if user_id is not UNSET:
field_dict['user_id'] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
id = d.pop("id", UNSET)
is_valid = d.pop("is_valid", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
else:
token = Uuid(_token)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user_id = d.pop("user_id", UNSET)
api_token = cls(
created_at= created_at,
id= id,
is_valid= is_valid,
token= token,
updated_at= updated_at,
user_id= user_id,
)
api_token.additional_properties = d
return api_token
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,8 @@
from enum import Enum
class CreatedAtSortMode(str, Enum):
CREATED-AT-ASCENDING = 'created-at-ascending'
CREATED-AT-DESCENDING = 'created-at-descending'
def __str__(self) -> str:
return str(self.value)

68
kittycad/models/error.py Normal file
View File

@ -0,0 +1,68 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="Error")
@attr.s(auto_attribs=True)
class Error:
""" """
error_code: Union[Unset, str] = UNSET
message: Union[Unset, str] = UNSET
request_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
error_code = self.error_code
message = self.message
request_id = self.request_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if error_code is not UNSET:
field_dict['error_code'] = error_code
if message is not UNSET:
field_dict['message'] = message
if request_id is not UNSET:
field_dict['request_id'] = request_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
error_code = d.pop("error_code", UNSET)
message = d.pop("message", UNSET)
request_id = d.pop("request_id", UNSET)
error = cls(
error_code= error_code,
message= message,
request_id= request_id,
)
error.additional_properties = d
return error
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,182 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="ExtendedUser")
@attr.s(auto_attribs=True)
class ExtendedUser:
""" """
company: Union[Unset, str] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
discord: Union[Unset, str] = UNSET
email: Union[Unset, str] = UNSET
email_verified: Union[Unset, datetime.datetime] = UNSET
first_name: Union[Unset, str] = UNSET
github: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
image: Union[Unset, str] = UNSET
last_name: Union[Unset, str] = UNSET
mailchimp_id: Union[Unset, str] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, str] = UNSET
stripe_id: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
zendesk_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
company = self.company
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
discord = self.discord
email = self.email
email_verified: Union[Unset, str] = UNSET
if not isinstance(self.email_verified, Unset):
email_verified = self.email_verified.isoformat()
first_name = self.first_name
github = self.github
id = self.id
image = self.image
last_name = self.last_name
mailchimp_id = self.mailchimp_id
name = self.name
phone = self.phone
stripe_id = self.stripe_id
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
zendesk_id = self.zendesk_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if company is not UNSET:
field_dict['company'] = company
if created_at is not UNSET:
field_dict['created_at'] = created_at
if discord is not UNSET:
field_dict['discord'] = discord
if email is not UNSET:
field_dict['email'] = email
if email_verified is not UNSET:
field_dict['email_verified'] = email_verified
if first_name is not UNSET:
field_dict['first_name'] = first_name
if github is not UNSET:
field_dict['github'] = github
if id is not UNSET:
field_dict['id'] = id
if image is not UNSET:
field_dict['image'] = image
if last_name is not UNSET:
field_dict['last_name'] = last_name
if mailchimp_id is not UNSET:
field_dict['mailchimp_id'] = mailchimp_id
if name is not UNSET:
field_dict['name'] = name
if phone is not UNSET:
field_dict['phone'] = phone
if stripe_id is not UNSET:
field_dict['stripe_id'] = stripe_id
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
if zendesk_id is not UNSET:
field_dict['zendesk_id'] = zendesk_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
company = d.pop("company", UNSET)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
discord = d.pop("discord", UNSET)
email = d.pop("email", UNSET)
_email_verified = d.pop("email_verified", UNSET)
email_verified: Union[Unset, datetime.datetime]
if isinstance(_email_verified, Unset):
email_verified = UNSET
else:
email_verified = isoparse(_email_verified)
first_name = d.pop("first_name", UNSET)
github = d.pop("github", UNSET)
id = d.pop("id", UNSET)
image = d.pop("image", UNSET)
last_name = d.pop("last_name", UNSET)
mailchimp_id = d.pop("mailchimp_id", UNSET)
name = d.pop("name", UNSET)
phone = d.pop("phone", UNSET)
stripe_id = d.pop("stripe_id", UNSET)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
zendesk_id = d.pop("zendesk_id", UNSET)
extended_user = cls(
company= company,
created_at= created_at,
discord= discord,
email= email,
email_verified= email_verified,
first_name= first_name,
github= github,
id= id,
image= image,
last_name= last_name,
mailchimp_id= mailchimp_id,
name= name,
phone= phone,
stripe_id= stripe_id,
updated_at= updated_at,
zendesk_id= zendesk_id,
)
extended_user.additional_properties = d
return extended_user
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -0,0 +1,12 @@
from enum import Enum
class FileConversionOutputFormat(str, Enum):
STL = 'stl'
OBJ = 'obj'
DAE = 'dae'
STEP = 'step'
FBX = 'fbx'
FBXB = 'fbxb'
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,11 @@
from enum import Enum
class FileConversionSourceFormat(str, Enum):
STL = 'stl'
OBJ = 'obj'
DAE = 'dae'
STEP = 'step'
FBX = 'fbx'
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,165 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..models.uuid import Uuid
from ..models.file_conversion_output_format import FileConversionOutputFormat
from ..models.file_conversion_source_format import FileConversionSourceFormat
from ..models.file_conversion_status import FileConversionStatus
from ..types import UNSET, Unset
T = TypeVar("T", bound="FileConversionWithOutput")
@attr.s(auto_attribs=True)
class FileConversionWithOutput:
""" """
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
id: Union[Unset, Uuid] = UNSET
output: Union[Unset, str] = UNSET
output_format: Union[Unset, FileConversionOutputFormat] = UNSET
src_format: Union[Unset, FileConversionSourceFormat] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, FileConversionStatus] = UNSET
user_id: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
id: Union[Unset, str] = UNSET
if not isinstance(self.id, Unset):
id = self.id.value
output = self.output
output_format: Union[Unset, str] = UNSET
if not isinstance(self.output_format, Unset):
output_format = self.output_format.value
src_format: Union[Unset, str] = UNSET
if not isinstance(self.src_format, Unset):
src_format = self.src_format.value
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status: Union[Unset, str] = UNSET
if not isinstance(self.status, Unset):
status = self.status.value
user_id = self.user_id
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict['completed_at'] = completed_at
if created_at is not UNSET:
field_dict['created_at'] = created_at
if id is not UNSET:
field_dict['id'] = id
if output is not UNSET:
field_dict['output'] = output
if output_format is not UNSET:
field_dict['output_format'] = output_format
if src_format is not UNSET:
field_dict['src_format'] = src_format
if started_at is not UNSET:
field_dict['started_at'] = started_at
if status is not UNSET:
field_dict['status'] = status
if user_id is not UNSET:
field_dict['user_id'] = user_id
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
else:
id = Uuid(_id)
output = d.pop("output", UNSET)
_output_format = d.pop("output_format", UNSET)
output_format: Union[Unset, FileConversionOutputFormat]
if isinstance(_output_format, Unset):
output_format = UNSET
else:
output_format = FileConversionOutputFormat(_output_format)
_src_format = d.pop("src_format", UNSET)
src_format: Union[Unset, FileConversionSourceFormat]
if isinstance(_src_format, Unset):
src_format = UNSET
else:
src_format = FileConversionSourceFormat(_src_format)
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status = d.pop("status", UNSET)
status: Union[Unset, FileConversionStatus]
if isinstance(_status, Unset):
status = UNSET
else:
status = FileConversionStatus(_status)
user_id = d.pop("user_id", UNSET)
file_conversion_with_output = cls(
completed_at= completed_at,
created_at= created_at,
id= id,
output= output,
output_format= output_format,
src_format= src_format,
started_at= started_at,
status= status,
user_id= user_id,
)
file_conversion_with_output.additional_properties = d
return file_conversion_with_output
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

16
kittycad/models/method.py Normal file
View File

@ -0,0 +1,16 @@
from enum import Enum
class Method(str, Enum):
OPTIONS = 'OPTIONS'
GET = 'GET'
POST = 'POST'
PUT = 'PUT'
DELETE = 'DELETE'
HEAD = 'HEAD'
TRACE = 'TRACE'
CONNECT = 'CONNECT'
PATCH = 'PATCH'
EXTENSION = 'EXTENSION'
def __str__(self) -> str:
return str(self.value)

54
kittycad/models/pong.py Normal file
View File

@ -0,0 +1,54 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="Pong")
@attr.s(auto_attribs=True)
class Pong:
""" """
message: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
message = self.message
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if message is not UNSET:
field_dict['message'] = message
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
message = d.pop("message", UNSET)
pong = cls(
message= message,
)
pong.additional_properties = d
return pong
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

161
kittycad/models/user.py Normal file
View File

@ -0,0 +1,161 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from ..types import UNSET, Unset
T = TypeVar("T", bound="User")
@attr.s(auto_attribs=True)
class User:
""" """
company: Union[Unset, str] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
discord: Union[Unset, str] = UNSET
email: Union[Unset, str] = UNSET
email_verified: Union[Unset, datetime.datetime] = UNSET
first_name: Union[Unset, str] = UNSET
github: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
image: Union[Unset, str] = UNSET
last_name: Union[Unset, str] = UNSET
name: Union[Unset, str] = UNSET
phone: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
company = self.company
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
discord = self.discord
email = self.email
email_verified: Union[Unset, str] = UNSET
if not isinstance(self.email_verified, Unset):
email_verified = self.email_verified.isoformat()
first_name = self.first_name
github = self.github
id = self.id
image = self.image
last_name = self.last_name
name = self.name
phone = self.phone
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if company is not UNSET:
field_dict['company'] = company
if created_at is not UNSET:
field_dict['created_at'] = created_at
if discord is not UNSET:
field_dict['discord'] = discord
if email is not UNSET:
field_dict['email'] = email
if email_verified is not UNSET:
field_dict['email_verified'] = email_verified
if first_name is not UNSET:
field_dict['first_name'] = first_name
if github is not UNSET:
field_dict['github'] = github
if id is not UNSET:
field_dict['id'] = id
if image is not UNSET:
field_dict['image'] = image
if last_name is not UNSET:
field_dict['last_name'] = last_name
if name is not UNSET:
field_dict['name'] = name
if phone is not UNSET:
field_dict['phone'] = phone
if updated_at is not UNSET:
field_dict['updated_at'] = updated_at
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
company = d.pop("company", UNSET)
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
discord = d.pop("discord", UNSET)
email = d.pop("email", UNSET)
_email_verified = d.pop("email_verified", UNSET)
email_verified: Union[Unset, datetime.datetime]
if isinstance(_email_verified, Unset):
email_verified = UNSET
else:
email_verified = isoparse(_email_verified)
first_name = d.pop("first_name", UNSET)
github = d.pop("github", UNSET)
id = d.pop("id", UNSET)
image = d.pop("image", UNSET)
last_name = d.pop("last_name", UNSET)
name = d.pop("name", UNSET)
phone = d.pop("phone", UNSET)
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user = cls(
company= company,
created_at= created_at,
discord= discord,
email= email,
email_verified= email_verified,
first_name= first_name,
github= github,
id= id,
image= image,
last_name= last_name,
name= name,
phone= phone,
updated_at= updated_at,
)
user.additional_properties = d
return user
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

0
kittycad/models/uuid.py Normal file
View File