Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
137b1600a8 | |||
6ef6e60467 | |||
374a57746e | |||
20a61d19d1 | |||
782dc863d4 | |||
daab399185 | |||
e4370b6108 | |||
0403eddfd7 | |||
95f22c849d | |||
9fe98c9185 | |||
d90bc06ff4 | |||
e63cda47eb | |||
44e8b10185 |
@ -67,7 +67,7 @@ def generatePaths(cwd: str, parser: dict) -> dict:
|
||||
# Generate the directory/__init__.py for each of the tags.
|
||||
tags = parser['tags']
|
||||
for tag in tags:
|
||||
tag_name = tag['name']
|
||||
tag_name = tag['name'].replace('-', '_')
|
||||
tag_description = tag['description']
|
||||
tag_path = os.path.join(path, tag_name)
|
||||
# Esnure the directory exists.
|
||||
@ -116,7 +116,7 @@ def generatePath(
|
||||
tag_name = ''
|
||||
# Add the tag to the path if it exists.
|
||||
if 'tags' in endpoint:
|
||||
tag_name = endpoint['tags'][0]
|
||||
tag_name = endpoint['tags'][0].replace('-', '_')
|
||||
path = os.path.join(path, tag_name)
|
||||
file_path = os.path.join(path, file_name)
|
||||
print("generating type: ", name, " at: ", file_path)
|
||||
@ -139,6 +139,7 @@ def generatePath(
|
||||
params_str = ''
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
optional_args = []
|
||||
for parameter in parameters:
|
||||
parameter_name = parameter['name']
|
||||
parameter_type = ''
|
||||
@ -154,8 +155,20 @@ def generatePath(
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
params_str += ', ' + \
|
||||
camel_to_snake(parameter_name) + '=' + parameter_type
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + ']'
|
||||
optional_args.append(
|
||||
', ' + camel_to_snake(parameter_name) + '=' + parameter_type)
|
||||
else:
|
||||
params_str += ', ' + \
|
||||
camel_to_snake(parameter_name) + '=' + parameter_type
|
||||
else:
|
||||
params_str += ', ' + \
|
||||
camel_to_snake(parameter_name) + '=' + parameter_type
|
||||
|
||||
for optional_arg in optional_args:
|
||||
params_str += optional_arg
|
||||
|
||||
if request_body_type:
|
||||
params_str += ', body=' + request_body_type
|
||||
@ -217,6 +230,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
# Define the method.
|
||||
f.write("def _get_kwargs(\n")
|
||||
# Iterate over the parameters.
|
||||
optional_args = []
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
for parameter in parameters:
|
||||
@ -232,12 +246,28 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + '] = None'
|
||||
optional_args.append("\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if request_body_type:
|
||||
f.write(
|
||||
"\tbody: " +
|
||||
@ -245,6 +275,8 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
",\n")
|
||||
f.write("\t*,\n")
|
||||
f.write("\tclient: Client,\n")
|
||||
for optional_arg in optional_args:
|
||||
f.write(optional_arg)
|
||||
f.write(") -> Dict[str, Any]:\n")
|
||||
templateUrl = "{}" + name
|
||||
formatTemplate = ".format(client.base_url"
|
||||
@ -426,6 +458,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
f.write("\n")
|
||||
f.write(
|
||||
"def sync_detailed(\n")
|
||||
optional_args = []
|
||||
# Iterate over the parameters.
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
@ -442,12 +475,28 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + '] = None'
|
||||
optional_args.append("\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if request_body_type:
|
||||
f.write(
|
||||
"\tbody: " +
|
||||
@ -455,6 +504,8 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
",\n")
|
||||
f.write("\t*,\n")
|
||||
f.write("\tclient: Client,\n")
|
||||
for optional_arg in optional_args:
|
||||
f.write(optional_arg)
|
||||
f.write(") -> Response[Union[Any, " +
|
||||
", ".join(endpoint_refs) +
|
||||
"]]:\n")
|
||||
@ -478,6 +529,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
f.write("\n")
|
||||
f.write(
|
||||
"def sync(\n")
|
||||
optional_args = []
|
||||
# Iterate over the parameters.
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
@ -494,12 +546,28 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + '] = None'
|
||||
optional_args.append("\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if request_body_type:
|
||||
f.write(
|
||||
"\tbody: " +
|
||||
@ -507,6 +575,8 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
",\n")
|
||||
f.write("\t*,\n")
|
||||
f.write("\tclient: Client,\n")
|
||||
for optional_arg in optional_args:
|
||||
f.write(optional_arg)
|
||||
f.write(") -> Optional[Union[Any, " +
|
||||
", ".join(endpoint_refs) +
|
||||
"]]:\n")
|
||||
@ -526,6 +596,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
f.write("\n")
|
||||
f.write(
|
||||
"async def asyncio_detailed(\n")
|
||||
optional_args = []
|
||||
# Iterate over the parameters.
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
@ -542,12 +613,28 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + '] = None'
|
||||
optional_args.append("\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if request_body_type:
|
||||
f.write(
|
||||
"\tbody: " +
|
||||
@ -555,6 +642,8 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
",\n")
|
||||
f.write("\t*,\n")
|
||||
f.write("\tclient: Client,\n")
|
||||
for optional_arg in optional_args:
|
||||
f.write(optional_arg)
|
||||
f.write(") -> Response[Union[Any, " +
|
||||
", ".join(endpoint_refs) +
|
||||
"]]:\n")
|
||||
@ -576,6 +665,7 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
f.write("\n")
|
||||
f.write(
|
||||
"async def asyncio(\n")
|
||||
optional_args = []
|
||||
# Iterate over the parameters.
|
||||
if 'parameters' in endpoint:
|
||||
parameters = endpoint['parameters']
|
||||
@ -592,12 +682,28 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
else:
|
||||
print(" parameter: ", parameter)
|
||||
raise Exception("Unknown parameter type")
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if 'nullable' in parameter['schema']:
|
||||
if parameter['schema']['nullable']:
|
||||
parameter_type = 'Optional[' + parameter_type + '] = None'
|
||||
optional_args.append("\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
else:
|
||||
f.write(
|
||||
"\t" +
|
||||
camel_to_snake(parameter_name) +
|
||||
": " +
|
||||
parameter_type +
|
||||
",\n")
|
||||
if request_body_type:
|
||||
f.write(
|
||||
"\tbody: " +
|
||||
@ -605,6 +711,8 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
|
||||
",\n")
|
||||
f.write("\t*,\n")
|
||||
f.write("\tclient: Client,\n")
|
||||
for optional_arg in optional_args:
|
||||
f.write(optional_arg)
|
||||
f.write(") -> Optional[Union[Any, " +
|
||||
", ".join(endpoint_refs) +
|
||||
"]]:\n")
|
||||
|
File diff suppressed because one or more lines are too long
1
kittycad/api/ai/__init__.py
Normal file
1
kittycad/api/ai/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
""" Contains methods for accessing the ai API paths: AI uses machine learning to generate 3D meshes. """
|
128
kittycad/api/ai/create_image_to_3d.py
Normal file
128
kittycad/api/ai/create_image_to_3d.py
Normal file
@ -0,0 +1,128 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.mesh import Mesh
|
||||
from ...models.error import Error
|
||||
from ...models.image_type import ImageType
|
||||
from ...models.file_export_format import FileExportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
input_format: ImageType,
|
||||
output_format: FileExportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/ai/image-to-3d/{input_format}/{output_format}".format(client.base_url, input_format=input_format, output_format=output_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, Mesh, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Mesh.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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
input_format: ImageType,
|
||||
output_format: FileExportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, Mesh, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
input_format=input_format,
|
||||
output_format=output_format,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
input_format: ImageType,
|
||||
output_format: FileExportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, Mesh, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
input_format=input_format,
|
||||
output_format=output_format,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
input_format: ImageType,
|
||||
output_format: FileExportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, Mesh, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
input_format=input_format,
|
||||
output_format=output_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(
|
||||
input_format: ImageType,
|
||||
output_format: FileExportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, Mesh, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
input_format=input_format,
|
||||
output_format=output_format,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
117
kittycad/api/ai/create_text_to_3d.py
Normal file
117
kittycad/api/ai/create_text_to_3d.py
Normal file
@ -0,0 +1,117 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.mesh import Mesh
|
||||
from ...models.error import Error
|
||||
from ...models.file_export_format import FileExportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: FileExportFormat,
|
||||
prompt: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/ai/text-to-3d/{output_format}?prompt={prompt}".format(client.base_url, output_format=output_format, prompt=prompt)
|
||||
|
||||
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, Mesh, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = Mesh.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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, Mesh, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: FileExportFormat,
|
||||
prompt: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, Mesh, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
prompt=prompt,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.post(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: FileExportFormat,
|
||||
prompt: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, Mesh, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
prompt=prompt,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: FileExportFormat,
|
||||
prompt: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, Mesh, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
prompt=prompt,
|
||||
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: FileExportFormat,
|
||||
prompt: str,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, Mesh, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
prompt=prompt,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -1 +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. """
|
||||
""" 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. """
|
@ -9,11 +9,11 @@ from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/api-calls?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -51,11 +51,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallW
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -73,11 +73,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, 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. """
|
||||
|
||||
@ -90,11 +90,11 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -110,11 +110,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, 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. """
|
||||
|
@ -10,11 +10,11 @@ from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
id: str,
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users/{id}/api-calls?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, id=id, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -53,11 +53,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallW
|
||||
|
||||
def sync_detailed(
|
||||
id: str,
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
@ -77,11 +77,11 @@ def sync_detailed(
|
||||
|
||||
def sync(
|
||||
id: str,
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, 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.
|
||||
@ -99,11 +99,11 @@ The API calls are returned in order of creation, with the most recently created
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: str,
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
@ -121,11 +121,11 @@ async def asyncio_detailed(
|
||||
|
||||
async def asyncio(
|
||||
id: str,
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, 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.
|
@ -10,12 +10,12 @@ from ...models.api_call_status import ApiCallStatus
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
status: ApiCallStatus,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/async/operations?limit={limit}&page_token={page_token}&sort_by={sort_by}&status={status}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by, status=status)
|
||||
|
||||
@ -53,12 +53,12 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, AsyncApi
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
status: ApiCallStatus,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -77,12 +77,12 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
status: ApiCallStatus,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
|
||||
""" For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
|
||||
This endpoint requires authentication by a KittyCAD employee. """
|
||||
@ -97,12 +97,12 @@ This endpoint requires authentication by a KittyCAD employee. """
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
status: ApiCallStatus,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, AsyncApiCallResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -119,12 +119,12 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
status: ApiCallStatus,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, AsyncApiCallResultsPage, Error]]:
|
||||
""" For async file conversion operations, this endpoint does not return the contents of converted files (`output`). To get the contents use the `/async/operations/{id}` endpoint.
|
||||
This endpoint requires authentication by a KittyCAD employee. """
|
@ -9,11 +9,11 @@ from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/api-calls?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -51,11 +51,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiCallW
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -73,11 +73,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, 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. """
|
||||
@ -91,11 +91,11 @@ The API calls are returned in order of creation, with the most recently created
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiCallWithPriceResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -111,11 +111,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiCallWithPriceResultsPage, 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. """
|
@ -1 +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. """
|
||||
""" 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. """
|
@ -9,11 +9,11 @@ from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/api-tokens?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -51,11 +51,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, ApiToken
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiTokenResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -73,11 +73,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiTokenResultsPage, 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. """
|
||||
@ -91,11 +91,11 @@ The API tokens are returned in order of creation, with the most recently created
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ApiTokenResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -111,11 +111,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ApiTokenResultsPage, 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. """
|
134
kittycad/api/file/create_file_2d_vector_conversion.py
Normal file
134
kittycad/api/file/create_file_2d_vector_conversion.py
Normal file
@ -0,0 +1,134 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.file2_d_vector_conversion import File2DVectorConversion
|
||||
from ...models.error import Error
|
||||
from ...models.file2_d_vector_export_format import File2DVectorExportFormat
|
||||
from ...models.file2_d_vector_import_format import File2DVectorImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: File2DVectorExportFormat,
|
||||
src_format: File2DVectorImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/file/2d/vector/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, File2DVectorConversion, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = File2DVectorConversion.from_dict(response.json())
|
||||
return response_201
|
||||
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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, File2DVectorConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: File2DVectorExportFormat,
|
||||
src_format: File2DVectorImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, File2DVectorConversion, 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: File2DVectorExportFormat,
|
||||
src_format: File2DVectorImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, File2DVectorConversion, Error]]:
|
||||
""" Convert a 2D Vector file from one format to another. If the file being converted is larger than 25MB, 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 operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: File2DVectorExportFormat,
|
||||
src_format: File2DVectorImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, File2DVectorConversion, 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: File2DVectorExportFormat,
|
||||
src_format: File2DVectorImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, File2DVectorConversion, Error]]:
|
||||
""" Convert a 2D Vector file from one format to another. If the file being converted is larger than 25MB, 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 operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
134
kittycad/api/file/create_file_3d_conversion.py
Normal file
134
kittycad/api/file/create_file_3d_conversion.py
Normal file
@ -0,0 +1,134 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.file3_d_conversion import File3DConversion
|
||||
from ...models.error import Error
|
||||
from ...models.file3_d_export_format import File3DExportFormat
|
||||
from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: File3DExportFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/file/3d/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, File3DConversion, Error]]:
|
||||
if response.status_code == 201:
|
||||
response_201 = File3DConversion.from_dict(response.json())
|
||||
return response_201
|
||||
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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, File3DConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: File3DExportFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, File3DConversion, 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: File3DExportFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, File3DConversion, Error]]:
|
||||
""" Convert a 3D file from one format to another. If the file being converted is larger than 25MB, 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 operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: File3DExportFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, File3DConversion, 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: File3DExportFormat,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, File3DConversion, Error]]:
|
||||
""" Convert a 3D file from one format to another. If the file being converted is larger than 25MB, 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 operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -9,13 +9,12 @@ from ...models.file3_d_import_format import File3DImportFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
material_density: float,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/file/center-of-mass?material_density={material_density}&src_format={src_format}".format(client.base_url, material_density=material_density, src_format=src_format)
|
||||
url = "{}/file/center-of-mass?src_format={src_format}".format(client.base_url, src_format=src_format)
|
||||
|
||||
headers: Dict[str, Any] = client.get_headers()
|
||||
cookies: Dict[str, Any] = client.get_cookies()
|
||||
@ -52,14 +51,12 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileCent
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
material_density: float,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileCenterOfMass, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
@ -74,7 +71,6 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
material_density: float,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
@ -84,7 +80,6 @@ def sync(
|
||||
If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. """
|
||||
|
||||
return sync_detailed(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
@ -92,14 +87,12 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
material_density: float,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, FileCenterOfMass, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
@ -112,7 +105,6 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
material_density: float,
|
||||
src_format: File3DImportFormat,
|
||||
body: bytes,
|
||||
*,
|
||||
@ -123,7 +115,6 @@ If the operation is performed asynchronously, the `id` of the operation will be
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
body=body,
|
||||
client=client,
|
||||
|
@ -10,10 +10,10 @@ from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
lang: CodeLanguage,
|
||||
output: str,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/file/execute/{lang}?output={output}".format(client.base_url, lang=lang, output=output)
|
||||
|
||||
@ -53,10 +53,10 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, CodeOutp
|
||||
|
||||
def sync_detailed(
|
||||
lang: CodeLanguage,
|
||||
output: str,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Response[Union[Any, CodeOutput, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
lang=lang,
|
||||
@ -75,10 +75,10 @@ def sync_detailed(
|
||||
|
||||
def sync(
|
||||
lang: CodeLanguage,
|
||||
output: str,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Optional[Union[Any, CodeOutput, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
@ -91,10 +91,10 @@ def sync(
|
||||
|
||||
async def asyncio_detailed(
|
||||
lang: CodeLanguage,
|
||||
output: str,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Response[Union[Any, CodeOutput, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
lang=lang,
|
||||
@ -111,10 +111,10 @@ async def asyncio_detailed(
|
||||
|
||||
async def asyncio(
|
||||
lang: CodeLanguage,
|
||||
output: str,
|
||||
body: bytes,
|
||||
*,
|
||||
client: Client,
|
||||
output: Optional[str] = None,
|
||||
) -> Optional[Union[Any, CodeOutput, Error]]:
|
||||
|
||||
return (
|
||||
|
@ -7,11 +7,11 @@ from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
callback_url: str,
|
||||
email: str,
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/auth/email/callback?callback_url={callback_url}&email={email}&token={token}".format(client.base_url, callback_url=callback_url, email=email, token=token)
|
||||
|
||||
@ -49,11 +49,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Error]]:
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
callback_url: str,
|
||||
email: str,
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Response[Union[Any, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
callback_url=callback_url,
|
||||
@ -71,11 +71,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
callback_url: str,
|
||||
email: str,
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Union[Any, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
@ -87,11 +87,11 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
callback_url: str,
|
||||
email: str,
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Response[Union[Any, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
callback_url=callback_url,
|
||||
@ -107,11 +107,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
callback_url: str,
|
||||
email: str,
|
||||
token: str,
|
||||
*,
|
||||
client: Client,
|
||||
callback_url: Optional[str] = None,
|
||||
) -> Optional[Union[Any, Error]]:
|
||||
|
||||
return (
|
||||
|
98
kittycad/api/meta/get_ai_plugin_manifest.py
Normal file
98
kittycad/api/meta/get_ai_plugin_manifest.py
Normal file
@ -0,0 +1,98 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.ai_plugin_manifest import AiPluginManifest
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/.well-known/ai-plugin.json".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, AiPluginManifest, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = AiPluginManifest.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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, AiPluginManifest, 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, AiPluginManifest, 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, AiPluginManifest, Error]]:
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, AiPluginManifest, 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, AiPluginManifest, Error]]:
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -0,0 +1,99 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.error import Error
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/user/payment/tax".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, Error]]:
|
||||
if response.status_code == 204:
|
||||
response_204 = None
|
||||
return response_204
|
||||
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 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(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, 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, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response. """
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, 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, Error]]:
|
||||
""" This endpoint requires authentication by any KittyCAD user. It will return an error if the customer's information is not valid for automatic tax. Otherwise, it will return an empty successful response. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
129
kittycad/api/unit/get_radioactivity_unit_conversion.py
Normal file
129
kittycad/api/unit/get_radioactivity_unit_conversion.py
Normal file
@ -0,0 +1,129 @@
|
||||
from typing import Any, Dict, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ...client import Client
|
||||
from ...models.unit_radioactivity_conversion import UnitRadioactivityConversion
|
||||
from ...models.error import Error
|
||||
from ...models.unit_radioactivity_format import UnitRadioactivityFormat
|
||||
from ...models.unit_radioactivity_format import UnitRadioactivityFormat
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
output_format: UnitRadioactivityFormat,
|
||||
src_format: UnitRadioactivityFormat,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/unit/conversion/radioactivity/{src_format}/{output_format}?value={value}".format(client.base_url, output_format=output_format, src_format=src_format, value=value)
|
||||
|
||||
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, UnitRadioactivityConversion, Error]]:
|
||||
if response.status_code == 200:
|
||||
response_200 = UnitRadioactivityConversion.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 None
|
||||
|
||||
|
||||
def _build_response(*, response: httpx.Response) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
|
||||
return Response(
|
||||
status_code=response.status_code,
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
output_format: UnitRadioactivityFormat,
|
||||
src_format: UnitRadioactivityFormat,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
|
||||
response = httpx.get(
|
||||
verify=client.verify_ssl,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
output_format: UnitRadioactivityFormat,
|
||||
src_format: UnitRadioactivityFormat,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
|
||||
""" Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return sync_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
output_format: UnitRadioactivityFormat,
|
||||
src_format: UnitRadioactivityFormat,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Response[Union[Any, UnitRadioactivityConversion, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
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(
|
||||
output_format: UnitRadioactivityFormat,
|
||||
src_format: UnitRadioactivityFormat,
|
||||
value: float,
|
||||
*,
|
||||
client: Client,
|
||||
) -> Optional[Union[Any, UnitRadioactivityConversion, Error]]:
|
||||
""" Convert a radioactivity unit value to another radioactivity unit value. This is a nice endpoint to use for helper functions. """
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
value=value,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
@ -9,11 +9,11 @@ from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -51,11 +51,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, UserResu
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, UserResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -73,11 +73,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, UserResultsPage, Error]]:
|
||||
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
|
||||
|
||||
@ -90,11 +90,11 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, UserResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -110,11 +110,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, UserResultsPage, Error]]:
|
||||
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
|
||||
|
||||
|
@ -9,11 +9,11 @@ from ...models.created_at_sort_mode import CreatedAtSortMode
|
||||
from ...types import Response
|
||||
|
||||
def _get_kwargs(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Dict[str, Any]:
|
||||
url = "{}/users-extended?limit={limit}&page_token={page_token}&sort_by={sort_by}".format(client.base_url, limit=limit, page_token=page_token, sort_by=sort_by)
|
||||
|
||||
@ -51,11 +51,11 @@ def _build_response(*, response: httpx.Response) -> Response[Union[Any, Extended
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ExtendedUserResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -73,11 +73,11 @@ def sync_detailed(
|
||||
|
||||
|
||||
def sync(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ExtendedUserResultsPage, Error]]:
|
||||
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
|
||||
|
||||
@ -90,11 +90,11 @@ def sync(
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Response[Union[Any, ExtendedUserResultsPage, Error]]:
|
||||
kwargs = _get_kwargs(
|
||||
limit=limit,
|
||||
@ -110,11 +110,11 @@ async def asyncio_detailed(
|
||||
|
||||
|
||||
async def asyncio(
|
||||
limit: int,
|
||||
page_token: str,
|
||||
sort_by: CreatedAtSortMode,
|
||||
*,
|
||||
client: Client,
|
||||
limit: Optional[int] = None,
|
||||
page_token: Optional[str] = None,
|
||||
) -> Optional[Union[Any, ExtendedUserResultsPage, Error]]:
|
||||
""" This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first. """
|
||||
|
||||
|
@ -3,10 +3,11 @@ import pytest
|
||||
import asyncio
|
||||
|
||||
from .client import ClientFromEnv
|
||||
from .models import FileConversion, FileExportFormat, FileImportFormat, User, Pong, ApiCallStatus, FileMass, FileVolume
|
||||
from .models import FileConversion, FileExportFormat, FileImportFormat, User, Pong, ApiCallStatus, FileMass, FileVolume, ApiTokenResultsPage, CreatedAtSortMode
|
||||
from .api.file import create_file_conversion_with_base64_helper, create_file_mass, create_file_volume
|
||||
from .api.meta import ping
|
||||
from .api.users import get_user_self
|
||||
from .api.api_tokens import list_api_tokens_for_user
|
||||
|
||||
|
||||
def test_get_session():
|
||||
@ -21,6 +22,20 @@ def test_get_session():
|
||||
print(f"Session: {session}")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_api_tokens_async():
|
||||
# Create our client.
|
||||
client = ClientFromEnv()
|
||||
|
||||
# List API tokens.
|
||||
fc: ApiTokenResultsPage = list_api_tokens_for_user.sync(
|
||||
client=client, sort_by=CreatedAtSortMode)
|
||||
|
||||
assert fc is not None
|
||||
|
||||
print(f"fc: {fc}")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_session_async():
|
||||
# Create our client.
|
||||
|
@ -1,6 +1,12 @@
|
||||
""" Contains all the data models used in inputs/outputs """
|
||||
|
||||
from .account_provider import AccountProvider
|
||||
from .ai_plugin_api import AiPluginApi
|
||||
from .ai_plugin_api_type import AiPluginApiType
|
||||
from .ai_plugin_auth import AiPluginAuth
|
||||
from .ai_plugin_auth_type import AiPluginAuthType
|
||||
from .ai_plugin_http_auth_type import AiPluginHttpAuthType
|
||||
from .ai_plugin_manifest import AiPluginManifest
|
||||
from .api_call_query_group import ApiCallQueryGroup
|
||||
from .api_call_query_group_by import ApiCallQueryGroupBy
|
||||
from .api_call_status import ApiCallStatus
|
||||
@ -20,6 +26,7 @@ from .code_language import CodeLanguage
|
||||
from .code_output import CodeOutput
|
||||
from .commit import Commit
|
||||
from .connection import Connection
|
||||
from .country_code import CountryCode
|
||||
from .created_at_sort_mode import CreatedAtSortMode
|
||||
from .currency import Currency
|
||||
from .customer import Customer
|
||||
@ -35,8 +42,10 @@ from .error import Error
|
||||
from .executor_metadata import ExecutorMetadata
|
||||
from .extended_user import ExtendedUser
|
||||
from .extended_user_results_page import ExtendedUserResultsPage
|
||||
from .file2_d_vector_conversion import File2DVectorConversion
|
||||
from .file2_d_vector_export_format import File2DVectorExportFormat
|
||||
from .file2_d_vector_import_format import File2DVectorImportFormat
|
||||
from .file3_d_conversion import File3DConversion
|
||||
from .file3_d_export_format import File3DExportFormat
|
||||
from .file3_d_import_format import File3DImportFormat
|
||||
from .file_center_of_mass import FileCenterOfMass
|
||||
@ -49,6 +58,7 @@ from .file_surface_area import FileSurfaceArea
|
||||
from .file_system_metadata import FileSystemMetadata
|
||||
from .file_volume import FileVolume
|
||||
from .gateway import Gateway
|
||||
from .image_type import ImageType
|
||||
from .index_info import IndexInfo
|
||||
from .invoice import Invoice
|
||||
from .invoice_line_item import InvoiceLineItem
|
||||
@ -58,6 +68,7 @@ from .jetstream_api_stats import JetstreamApiStats
|
||||
from .jetstream_config import JetstreamConfig
|
||||
from .jetstream_stats import JetstreamStats
|
||||
from .leaf_node import LeafNode
|
||||
from .mesh import Mesh
|
||||
from .meta_cluster_info import MetaClusterInfo
|
||||
from .metadata import Metadata
|
||||
from .method import Method
|
||||
@ -73,6 +84,7 @@ from .payment_method_type import PaymentMethodType
|
||||
from .physics_constant import PhysicsConstant
|
||||
from .physics_constant_name import PhysicsConstantName
|
||||
from .plugins_info import PluginsInfo
|
||||
from .point_e_metadata import PointEMetadata
|
||||
from .pong import Pong
|
||||
from .registry_service_config import RegistryServiceConfig
|
||||
from .runtime import Runtime
|
||||
@ -123,6 +135,8 @@ from .unit_pressure_conversion import UnitPressureConversion
|
||||
from .unit_pressure_format import UnitPressureFormat
|
||||
from .unit_radiation_conversion import UnitRadiationConversion
|
||||
from .unit_radiation_format import UnitRadiationFormat
|
||||
from .unit_radioactivity_conversion import UnitRadioactivityConversion
|
||||
from .unit_radioactivity_format import UnitRadioactivityFormat
|
||||
from .unit_solid_angle_conversion import UnitSolidAngleConversion
|
||||
from .unit_solid_angle_format import UnitSolidAngleFormat
|
||||
from .unit_temperature_conversion import UnitTemperatureConversion
|
||||
|
76
kittycad/models/ai_plugin_api.py
Normal file
76
kittycad/models/ai_plugin_api.py
Normal file
@ -0,0 +1,76 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.ai_plugin_api_type import AiPluginApiType
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="AiPluginApi")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class AiPluginApi:
|
||||
""" """
|
||||
is_user_authenticated: Union[Unset, bool] = False
|
||||
type: Union[Unset, AiPluginApiType] = UNSET
|
||||
url: Union[Unset, str] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
is_user_authenticated = self.is_user_authenticated
|
||||
type: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.type, Unset):
|
||||
type = self.type.value
|
||||
url = self.url
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if is_user_authenticated is not UNSET:
|
||||
field_dict['is_user_authenticated'] = is_user_authenticated
|
||||
if type is not UNSET:
|
||||
field_dict['type'] = type
|
||||
if url is not UNSET:
|
||||
field_dict['url'] = url
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
is_user_authenticated = d.pop("is_user_authenticated", UNSET)
|
||||
|
||||
_type = d.pop("type", UNSET)
|
||||
type: Union[Unset, AiPluginApiType]
|
||||
if isinstance(_type, Unset):
|
||||
type = UNSET
|
||||
else:
|
||||
type = AiPluginApiType(_type)
|
||||
|
||||
url = d.pop("url", UNSET)
|
||||
|
||||
ai_plugin_api = cls(
|
||||
is_user_authenticated=is_user_authenticated,
|
||||
type=type,
|
||||
url=url,
|
||||
)
|
||||
|
||||
ai_plugin_api.additional_properties = d
|
||||
return ai_plugin_api
|
||||
|
||||
@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
|
8
kittycad/models/ai_plugin_api_type.py
Normal file
8
kittycad/models/ai_plugin_api_type.py
Normal file
@ -0,0 +1,8 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginApiType(str, Enum):
|
||||
OPENAPI = 'openapi'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
77
kittycad/models/ai_plugin_auth.py
Normal file
77
kittycad/models/ai_plugin_auth.py
Normal file
@ -0,0 +1,77 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.ai_plugin_http_auth_type import AiPluginHttpAuthType
|
||||
from ..models.ai_plugin_auth_type import AiPluginAuthType
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="AiPluginAuth")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class AiPluginAuth:
|
||||
""" """
|
||||
authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET
|
||||
type: Union[Unset, AiPluginAuthType] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
authorization_type: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.authorization_type, Unset):
|
||||
authorization_type = self.authorization_type.value
|
||||
type: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.type, Unset):
|
||||
type = self.type.value
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if authorization_type is not UNSET:
|
||||
field_dict['authorization_type'] = authorization_type
|
||||
if type is not UNSET:
|
||||
field_dict['type'] = type
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
_authorization_type = d.pop("authorization_type", UNSET)
|
||||
authorization_type: Union[Unset, AiPluginHttpAuthType]
|
||||
if isinstance(_authorization_type, Unset):
|
||||
authorization_type = UNSET
|
||||
else:
|
||||
authorization_type = AiPluginHttpAuthType(_authorization_type)
|
||||
|
||||
_type = d.pop("type", UNSET)
|
||||
type: Union[Unset, AiPluginAuthType]
|
||||
if isinstance(_type, Unset):
|
||||
type = UNSET
|
||||
else:
|
||||
type = AiPluginAuthType(_type)
|
||||
|
||||
ai_plugin_auth = cls(
|
||||
authorization_type=authorization_type,
|
||||
type=type,
|
||||
)
|
||||
|
||||
ai_plugin_auth.additional_properties = d
|
||||
return ai_plugin_auth
|
||||
|
||||
@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
|
11
kittycad/models/ai_plugin_auth_type.py
Normal file
11
kittycad/models/ai_plugin_auth_type.py
Normal file
@ -0,0 +1,11 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginAuthType(str, Enum):
|
||||
NONE = 'none'
|
||||
USER_HTTP = 'user_http'
|
||||
SERVICE_HTTP = 'service_http'
|
||||
OAUTH = 'oauth'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
9
kittycad/models/ai_plugin_http_auth_type.py
Normal file
9
kittycad/models/ai_plugin_http_auth_type.py
Normal file
@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class AiPluginHttpAuthType(str, Enum):
|
||||
BASIC = 'basic'
|
||||
BEARER = 'bearer'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
133
kittycad/models/ai_plugin_manifest.py
Normal file
133
kittycad/models/ai_plugin_manifest.py
Normal file
@ -0,0 +1,133 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.ai_plugin_api import AiPluginApi
|
||||
from ..models.ai_plugin_auth import AiPluginAuth
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="AiPluginManifest")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class AiPluginManifest:
|
||||
""" """
|
||||
api: Union[Unset, AiPluginApi] = UNSET
|
||||
auth: Union[Unset, AiPluginAuth] = UNSET
|
||||
contact_email: Union[Unset, str] = UNSET
|
||||
description_for_human: Union[Unset, str] = UNSET
|
||||
description_for_model: Union[Unset, str] = UNSET
|
||||
legal_info_url: Union[Unset, str] = UNSET
|
||||
logo_url: Union[Unset, str] = UNSET
|
||||
name_for_human: Union[Unset, str] = UNSET
|
||||
name_for_model: Union[Unset, str] = UNSET
|
||||
schema_version: Union[Unset, str] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
api: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.api, Unset):
|
||||
api = self.api.value
|
||||
auth: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.auth, Unset):
|
||||
auth = self.auth.value
|
||||
contact_email = self.contact_email
|
||||
description_for_human = self.description_for_human
|
||||
description_for_model = self.description_for_model
|
||||
legal_info_url = self.legal_info_url
|
||||
logo_url = self.logo_url
|
||||
name_for_human = self.name_for_human
|
||||
name_for_model = self.name_for_model
|
||||
schema_version = self.schema_version
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if api is not UNSET:
|
||||
field_dict['api'] = api
|
||||
if auth is not UNSET:
|
||||
field_dict['auth'] = auth
|
||||
if contact_email is not UNSET:
|
||||
field_dict['contact_email'] = contact_email
|
||||
if description_for_human is not UNSET:
|
||||
field_dict['description_for_human'] = description_for_human
|
||||
if description_for_model is not UNSET:
|
||||
field_dict['description_for_model'] = description_for_model
|
||||
if legal_info_url is not UNSET:
|
||||
field_dict['legal_info_url'] = legal_info_url
|
||||
if logo_url is not UNSET:
|
||||
field_dict['logo_url'] = logo_url
|
||||
if name_for_human is not UNSET:
|
||||
field_dict['name_for_human'] = name_for_human
|
||||
if name_for_model is not UNSET:
|
||||
field_dict['name_for_model'] = name_for_model
|
||||
if schema_version is not UNSET:
|
||||
field_dict['schema_version'] = schema_version
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
_api = d.pop("api", UNSET)
|
||||
api: Union[Unset, AiPluginApi]
|
||||
if isinstance(_api, Unset):
|
||||
api = UNSET
|
||||
else:
|
||||
api = AiPluginApi(_api)
|
||||
|
||||
_auth = d.pop("auth", UNSET)
|
||||
auth: Union[Unset, AiPluginAuth]
|
||||
if isinstance(_auth, Unset):
|
||||
auth = UNSET
|
||||
else:
|
||||
auth = AiPluginAuth(_auth)
|
||||
|
||||
contact_email = d.pop("contact_email", UNSET)
|
||||
|
||||
description_for_human = d.pop("description_for_human", UNSET)
|
||||
|
||||
description_for_model = d.pop("description_for_model", UNSET)
|
||||
|
||||
legal_info_url = d.pop("legal_info_url", UNSET)
|
||||
|
||||
logo_url = d.pop("logo_url", UNSET)
|
||||
|
||||
name_for_human = d.pop("name_for_human", UNSET)
|
||||
|
||||
name_for_model = d.pop("name_for_model", UNSET)
|
||||
|
||||
schema_version = d.pop("schema_version", UNSET)
|
||||
|
||||
ai_plugin_manifest = cls(
|
||||
api=api,
|
||||
auth=auth,
|
||||
contact_email=contact_email,
|
||||
description_for_human=description_for_human,
|
||||
description_for_model=description_for_model,
|
||||
legal_info_url=legal_info_url,
|
||||
logo_url=logo_url,
|
||||
name_for_human=name_for_human,
|
||||
name_for_model=name_for_model,
|
||||
schema_version=schema_version,
|
||||
)
|
||||
|
||||
ai_plugin_manifest.additional_properties = d
|
||||
return ai_plugin_manifest
|
||||
|
||||
@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
|
256
kittycad/models/country_code.py
Normal file
256
kittycad/models/country_code.py
Normal file
@ -0,0 +1,256 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class CountryCode(str, Enum):
|
||||
AF = 'AF'
|
||||
AX = 'AX'
|
||||
AL = 'AL'
|
||||
DZ = 'DZ'
|
||||
AS = 'AS'
|
||||
AD = 'AD'
|
||||
AO = 'AO'
|
||||
AI = 'AI'
|
||||
AQ = 'AQ'
|
||||
AG = 'AG'
|
||||
AR = 'AR'
|
||||
AM = 'AM'
|
||||
AW = 'AW'
|
||||
AU = 'AU'
|
||||
AT = 'AT'
|
||||
AZ = 'AZ'
|
||||
BS = 'BS'
|
||||
BH = 'BH'
|
||||
BD = 'BD'
|
||||
BB = 'BB'
|
||||
BY = 'BY'
|
||||
BE = 'BE'
|
||||
BZ = 'BZ'
|
||||
BJ = 'BJ'
|
||||
BM = 'BM'
|
||||
BT = 'BT'
|
||||
BO = 'BO'
|
||||
BQ = 'BQ'
|
||||
BA = 'BA'
|
||||
BW = 'BW'
|
||||
BV = 'BV'
|
||||
BR = 'BR'
|
||||
IO = 'IO'
|
||||
BN = 'BN'
|
||||
BG = 'BG'
|
||||
BF = 'BF'
|
||||
BI = 'BI'
|
||||
CV = 'CV'
|
||||
KH = 'KH'
|
||||
CM = 'CM'
|
||||
CA = 'CA'
|
||||
KY = 'KY'
|
||||
CF = 'CF'
|
||||
TD = 'TD'
|
||||
CL = 'CL'
|
||||
CN = 'CN'
|
||||
CX = 'CX'
|
||||
CC = 'CC'
|
||||
CO = 'CO'
|
||||
KM = 'KM'
|
||||
CG = 'CG'
|
||||
CD = 'CD'
|
||||
CK = 'CK'
|
||||
CR = 'CR'
|
||||
CI = 'CI'
|
||||
HR = 'HR'
|
||||
CU = 'CU'
|
||||
CW = 'CW'
|
||||
CY = 'CY'
|
||||
CZ = 'CZ'
|
||||
DK = 'DK'
|
||||
DJ = 'DJ'
|
||||
DM = 'DM'
|
||||
DO = 'DO'
|
||||
EC = 'EC'
|
||||
EG = 'EG'
|
||||
SV = 'SV'
|
||||
GQ = 'GQ'
|
||||
ER = 'ER'
|
||||
EE = 'EE'
|
||||
ET = 'ET'
|
||||
FK = 'FK'
|
||||
FO = 'FO'
|
||||
FJ = 'FJ'
|
||||
FI = 'FI'
|
||||
FR = 'FR'
|
||||
GF = 'GF'
|
||||
PF = 'PF'
|
||||
TF = 'TF'
|
||||
GA = 'GA'
|
||||
GM = 'GM'
|
||||
GE = 'GE'
|
||||
DE = 'DE'
|
||||
GH = 'GH'
|
||||
GI = 'GI'
|
||||
GR = 'GR'
|
||||
GL = 'GL'
|
||||
GD = 'GD'
|
||||
GP = 'GP'
|
||||
GU = 'GU'
|
||||
GT = 'GT'
|
||||
GG = 'GG'
|
||||
GN = 'GN'
|
||||
GW = 'GW'
|
||||
GY = 'GY'
|
||||
HT = 'HT'
|
||||
HM = 'HM'
|
||||
VA = 'VA'
|
||||
HN = 'HN'
|
||||
HK = 'HK'
|
||||
HU = 'HU'
|
||||
IS = 'IS'
|
||||
IN = 'IN'
|
||||
ID = 'ID'
|
||||
IR = 'IR'
|
||||
IQ = 'IQ'
|
||||
IE = 'IE'
|
||||
IM = 'IM'
|
||||
IL = 'IL'
|
||||
IT = 'IT'
|
||||
JM = 'JM'
|
||||
JP = 'JP'
|
||||
JE = 'JE'
|
||||
JO = 'JO'
|
||||
KZ = 'KZ'
|
||||
KE = 'KE'
|
||||
KI = 'KI'
|
||||
KP = 'KP'
|
||||
KR = 'KR'
|
||||
KW = 'KW'
|
||||
KG = 'KG'
|
||||
LA = 'LA'
|
||||
LV = 'LV'
|
||||
LB = 'LB'
|
||||
LS = 'LS'
|
||||
LR = 'LR'
|
||||
LY = 'LY'
|
||||
LI = 'LI'
|
||||
LT = 'LT'
|
||||
LU = 'LU'
|
||||
MO = 'MO'
|
||||
MK = 'MK'
|
||||
MG = 'MG'
|
||||
MW = 'MW'
|
||||
MY = 'MY'
|
||||
MV = 'MV'
|
||||
ML = 'ML'
|
||||
MT = 'MT'
|
||||
MH = 'MH'
|
||||
MQ = 'MQ'
|
||||
MR = 'MR'
|
||||
MU = 'MU'
|
||||
YT = 'YT'
|
||||
MX = 'MX'
|
||||
FM = 'FM'
|
||||
MD = 'MD'
|
||||
MC = 'MC'
|
||||
MN = 'MN'
|
||||
ME = 'ME'
|
||||
MS = 'MS'
|
||||
MA = 'MA'
|
||||
MZ = 'MZ'
|
||||
MM = 'MM'
|
||||
NA = 'NA'
|
||||
NR = 'NR'
|
||||
NP = 'NP'
|
||||
NL = 'NL'
|
||||
NC = 'NC'
|
||||
NZ = 'NZ'
|
||||
NI = 'NI'
|
||||
NE = 'NE'
|
||||
NG = 'NG'
|
||||
NU = 'NU'
|
||||
NF = 'NF'
|
||||
MP = 'MP'
|
||||
NO = 'NO'
|
||||
OM = 'OM'
|
||||
PK = 'PK'
|
||||
PW = 'PW'
|
||||
PS = 'PS'
|
||||
PA = 'PA'
|
||||
PG = 'PG'
|
||||
PY = 'PY'
|
||||
PE = 'PE'
|
||||
PH = 'PH'
|
||||
PN = 'PN'
|
||||
PL = 'PL'
|
||||
PT = 'PT'
|
||||
PR = 'PR'
|
||||
QA = 'QA'
|
||||
RE = 'RE'
|
||||
RO = 'RO'
|
||||
RU = 'RU'
|
||||
RW = 'RW'
|
||||
BL = 'BL'
|
||||
SH = 'SH'
|
||||
KN = 'KN'
|
||||
LC = 'LC'
|
||||
MF = 'MF'
|
||||
PM = 'PM'
|
||||
VC = 'VC'
|
||||
WS = 'WS'
|
||||
SM = 'SM'
|
||||
ST = 'ST'
|
||||
SA = 'SA'
|
||||
SN = 'SN'
|
||||
RS = 'RS'
|
||||
SC = 'SC'
|
||||
SL = 'SL'
|
||||
SG = 'SG'
|
||||
SX = 'SX'
|
||||
SK = 'SK'
|
||||
SI = 'SI'
|
||||
SB = 'SB'
|
||||
SO = 'SO'
|
||||
ZA = 'ZA'
|
||||
GS = 'GS'
|
||||
SS = 'SS'
|
||||
ES = 'ES'
|
||||
LK = 'LK'
|
||||
SD = 'SD'
|
||||
SR = 'SR'
|
||||
SJ = 'SJ'
|
||||
SZ = 'SZ'
|
||||
SE = 'SE'
|
||||
CH = 'CH'
|
||||
SY = 'SY'
|
||||
TW = 'TW'
|
||||
TJ = 'TJ'
|
||||
TZ = 'TZ'
|
||||
TH = 'TH'
|
||||
TL = 'TL'
|
||||
TG = 'TG'
|
||||
TK = 'TK'
|
||||
TO = 'TO'
|
||||
TT = 'TT'
|
||||
TN = 'TN'
|
||||
TR = 'TR'
|
||||
TM = 'TM'
|
||||
TC = 'TC'
|
||||
TV = 'TV'
|
||||
UG = 'UG'
|
||||
UA = 'UA'
|
||||
AE = 'AE'
|
||||
GB = 'GB'
|
||||
US = 'US'
|
||||
UM = 'UM'
|
||||
UY = 'UY'
|
||||
UZ = 'UZ'
|
||||
VU = 'VU'
|
||||
VE = 'VE'
|
||||
VN = 'VN'
|
||||
VG = 'VG'
|
||||
VI = 'VI'
|
||||
WF = 'WF'
|
||||
EH = 'EH'
|
||||
YE = 'YE'
|
||||
ZM = 'ZM'
|
||||
ZW = 'ZW'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -28,7 +28,6 @@ class ExtendedUser:
|
||||
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)
|
||||
|
||||
@ -55,7 +54,6 @@ class ExtendedUser:
|
||||
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)
|
||||
@ -92,8 +90,6 @@ class ExtendedUser:
|
||||
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
|
||||
|
||||
@ -147,8 +143,6 @@ class ExtendedUser:
|
||||
else:
|
||||
updated_at = isoparse(_updated_at)
|
||||
|
||||
zendesk_id = d.pop("zendesk_id", UNSET)
|
||||
|
||||
extended_user = cls(
|
||||
company=company,
|
||||
created_at=created_at,
|
||||
@ -166,7 +160,6 @@ class ExtendedUser:
|
||||
phone=phone,
|
||||
stripe_id=stripe_id,
|
||||
updated_at=updated_at,
|
||||
zendesk_id=zendesk_id,
|
||||
)
|
||||
|
||||
extended_user.additional_properties = d
|
||||
|
179
kittycad/models/file2_d_vector_conversion.py
Normal file
179
kittycad/models/file2_d_vector_conversion.py
Normal file
@ -0,0 +1,179 @@
|
||||
import datetime
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
from ..models.file2_d_vector_export_format import File2DVectorExportFormat
|
||||
from ..models.file2_d_vector_import_format import File2DVectorImportFormat
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="File2DVectorConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class File2DVectorConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
output: Union[Unset, str] = UNSET
|
||||
output_format: Union[Unset, File2DVectorExportFormat] = UNSET
|
||||
src_format: Union[Unset, File2DVectorImportFormat] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
status: Union[Unset, ApiCallStatus] = 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]:
|
||||
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()
|
||||
error = self.error
|
||||
id = self.id
|
||||
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
|
||||
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 completed_at is not UNSET:
|
||||
field_dict['completed_at'] = completed_at
|
||||
if created_at is not UNSET:
|
||||
field_dict['created_at'] = created_at
|
||||
if error is not UNSET:
|
||||
field_dict['error'] = error
|
||||
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 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()
|
||||
_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)
|
||||
|
||||
error = d.pop("error", UNSET)
|
||||
|
||||
id = d.pop("id", UNSET)
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, File2DVectorExportFormat]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = File2DVectorExportFormat(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, File2DVectorImportFormat]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = File2DVectorImportFormat(_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, ApiCallStatus]
|
||||
if isinstance(_status, Unset):
|
||||
status = UNSET
|
||||
else:
|
||||
status = ApiCallStatus(_status)
|
||||
|
||||
_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)
|
||||
|
||||
file2_d_vector_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
output=output,
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
file2_d_vector_conversion.additional_properties = d
|
||||
return file2_d_vector_conversion
|
||||
|
||||
@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
|
@ -4,6 +4,8 @@ from enum import Enum
|
||||
class File2DVectorExportFormat(str, Enum):
|
||||
DXF = 'dxf'
|
||||
JSON = 'json'
|
||||
PNG = 'png'
|
||||
PS = 'ps'
|
||||
SVG = 'svg'
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
179
kittycad/models/file3_d_conversion.py
Normal file
179
kittycad/models/file3_d_conversion.py
Normal file
@ -0,0 +1,179 @@
|
||||
import datetime
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
from ..models.file3_d_export_format import File3DExportFormat
|
||||
from ..models.file3_d_import_format import File3DImportFormat
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="File3DConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class File3DConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
output: Union[Unset, str] = UNSET
|
||||
output_format: Union[Unset, File3DExportFormat] = UNSET
|
||||
src_format: Union[Unset, File3DImportFormat] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
status: Union[Unset, ApiCallStatus] = 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]:
|
||||
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()
|
||||
error = self.error
|
||||
id = self.id
|
||||
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
|
||||
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 completed_at is not UNSET:
|
||||
field_dict['completed_at'] = completed_at
|
||||
if created_at is not UNSET:
|
||||
field_dict['created_at'] = created_at
|
||||
if error is not UNSET:
|
||||
field_dict['error'] = error
|
||||
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 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()
|
||||
_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)
|
||||
|
||||
error = d.pop("error", UNSET)
|
||||
|
||||
id = d.pop("id", UNSET)
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, File3DExportFormat]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = File3DExportFormat(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, File3DImportFormat]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = File3DImportFormat(_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, ApiCallStatus]
|
||||
if isinstance(_status, Unset):
|
||||
status = UNSET
|
||||
else:
|
||||
status = ApiCallStatus(_status)
|
||||
|
||||
_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)
|
||||
|
||||
file3_d_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
output=output,
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
file3_d_conversion.additional_properties = d
|
||||
return file3_d_conversion
|
||||
|
||||
@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
|
@ -7,6 +7,7 @@ class File3DExportFormat(str, Enum):
|
||||
FBXB = 'fbxb'
|
||||
OBJ = 'obj'
|
||||
OBJ_NOMTL = 'obj_nomtl'
|
||||
PLY = 'ply'
|
||||
STEP = 'step'
|
||||
STL = 'stl'
|
||||
|
||||
|
@ -3,9 +3,12 @@ from enum import Enum
|
||||
|
||||
class File3DImportFormat(str, Enum):
|
||||
DAE = 'dae'
|
||||
DXF = 'dxf'
|
||||
FBX = 'fbx'
|
||||
OBJ_ZIP = 'obj_zip'
|
||||
OBJ = 'obj'
|
||||
OBJ_NOMTL = 'obj_nomtl'
|
||||
PLY = 'ply'
|
||||
STEP = 'step'
|
||||
STL = 'stl'
|
||||
|
||||
|
@ -20,7 +20,6 @@ class FileCenterOfMass:
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
material_density: Union[Unset, float] = UNSET
|
||||
src_format: Union[Unset, File3DImportFormat] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
status: Union[Unset, ApiCallStatus] = UNSET
|
||||
@ -41,7 +40,6 @@ class FileCenterOfMass:
|
||||
created_at = self.created_at.isoformat()
|
||||
error = self.error
|
||||
id = self.id
|
||||
material_density = self.material_density
|
||||
src_format: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.src_format, Unset):
|
||||
src_format = self.src_format.value
|
||||
@ -69,8 +67,6 @@ class FileCenterOfMass:
|
||||
field_dict['error'] = error
|
||||
if id is not UNSET:
|
||||
field_dict['id'] = id
|
||||
if material_density is not UNSET:
|
||||
field_dict['material_density'] = material_density
|
||||
if src_format is not UNSET:
|
||||
field_dict['src_format'] = src_format
|
||||
if started_at is not UNSET:
|
||||
@ -107,8 +103,6 @@ class FileCenterOfMass:
|
||||
|
||||
id = d.pop("id", UNSET)
|
||||
|
||||
material_density = d.pop("material_density", UNSET)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, File3DImportFormat]
|
||||
if isinstance(_src_format, Unset):
|
||||
@ -145,7 +139,6 @@ class FileCenterOfMass:
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
material_density=material_density,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
|
@ -9,6 +9,7 @@ class FileExportFormat(str, Enum):
|
||||
JSON = 'json'
|
||||
OBJ = 'obj'
|
||||
OBJ_NOMTL = 'obj_nomtl'
|
||||
PLY = 'ply'
|
||||
STEP = 'step'
|
||||
STL = 'stl'
|
||||
SVG = 'svg'
|
||||
|
@ -5,8 +5,10 @@ class FileImportFormat(str, Enum):
|
||||
DAE = 'dae'
|
||||
DXF = 'dxf'
|
||||
FBX = 'fbx'
|
||||
OBJ_ZIP = 'obj_zip'
|
||||
OBJ = 'obj'
|
||||
OBJ_NOMTL = 'obj_nomtl'
|
||||
PLY = 'ply'
|
||||
STEP = 'step'
|
||||
STL = 'stl'
|
||||
SVG = 'svg'
|
||||
|
9
kittycad/models/image_type.py
Normal file
9
kittycad/models/image_type.py
Normal file
@ -0,0 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ImageType(str, Enum):
|
||||
PNG = 'png'
|
||||
JPG = 'jpg'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
54
kittycad/models/mesh.py
Normal file
54
kittycad/models/mesh.py
Normal file
@ -0,0 +1,54 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="Mesh")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class Mesh:
|
||||
""" """
|
||||
mesh: Union[Unset, str] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
mesh = self.mesh
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if mesh is not UNSET:
|
||||
field_dict['mesh'] = mesh
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
mesh = d.pop("mesh", UNSET)
|
||||
|
||||
mesh = cls(
|
||||
mesh=mesh,
|
||||
)
|
||||
|
||||
mesh.additional_properties = d
|
||||
return mesh
|
||||
|
||||
@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
|
@ -7,6 +7,7 @@ from ..models.engine_metadata import EngineMetadata
|
||||
from ..models.environment import Environment
|
||||
from ..models.executor_metadata import ExecutorMetadata
|
||||
from ..models.file_system_metadata import FileSystemMetadata
|
||||
from ..models.point_e_metadata import PointEMetadata
|
||||
from ..models.connection import Connection
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
@ -22,6 +23,7 @@ class Metadata:
|
||||
executor: Union[Unset, ExecutorMetadata] = UNSET
|
||||
fs: Union[Unset, FileSystemMetadata] = UNSET
|
||||
git_hash: Union[Unset, str] = UNSET
|
||||
point_e: Union[Unset, PointEMetadata] = UNSET
|
||||
pubsub: Union[Unset, Connection] = UNSET
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
@ -43,6 +45,9 @@ class Metadata:
|
||||
if not isinstance(self.fs, Unset):
|
||||
fs = self.fs.value
|
||||
git_hash = self.git_hash
|
||||
point_e: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.point_e, Unset):
|
||||
point_e = self.point_e.value
|
||||
pubsub: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.pubsub, Unset):
|
||||
pubsub = self.pubsub.value
|
||||
@ -62,6 +67,8 @@ class Metadata:
|
||||
field_dict['fs'] = fs
|
||||
if git_hash is not UNSET:
|
||||
field_dict['git_hash'] = git_hash
|
||||
if point_e is not UNSET:
|
||||
field_dict['point_e'] = point_e
|
||||
if pubsub is not UNSET:
|
||||
field_dict['pubsub'] = pubsub
|
||||
|
||||
@ -107,6 +114,13 @@ class Metadata:
|
||||
|
||||
git_hash = d.pop("git_hash", UNSET)
|
||||
|
||||
_point_e = d.pop("point_e", UNSET)
|
||||
point_e: Union[Unset, PointEMetadata]
|
||||
if isinstance(_point_e, Unset):
|
||||
point_e = UNSET
|
||||
else:
|
||||
point_e = PointEMetadata(_point_e)
|
||||
|
||||
_pubsub = d.pop("pubsub", UNSET)
|
||||
pubsub: Union[Unset, Connection]
|
||||
if isinstance(_pubsub, Unset):
|
||||
@ -121,6 +135,7 @@ class Metadata:
|
||||
executor=executor,
|
||||
fs=fs,
|
||||
git_hash=git_hash,
|
||||
point_e=point_e,
|
||||
pubsub=pubsub,
|
||||
)
|
||||
|
||||
|
@ -2,6 +2,7 @@ from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..models.country_code import CountryCode
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="NewAddress")
|
||||
@ -11,7 +12,7 @@ T = TypeVar("T", bound="NewAddress")
|
||||
class NewAddress:
|
||||
""" """
|
||||
city: Union[Unset, str] = UNSET
|
||||
country: Union[Unset, str] = UNSET
|
||||
country: Union[Unset, CountryCode] = UNSET
|
||||
state: Union[Unset, str] = UNSET
|
||||
street1: Union[Unset, str] = UNSET
|
||||
street2: Union[Unset, str] = UNSET
|
||||
@ -22,7 +23,9 @@ class NewAddress:
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
city = self.city
|
||||
country = self.country
|
||||
country: Union[Unset, str] = UNSET
|
||||
if not isinstance(self.country, Unset):
|
||||
country = self.country.value
|
||||
state = self.state
|
||||
street1 = self.street1
|
||||
street2 = self.street2
|
||||
@ -54,7 +57,12 @@ class NewAddress:
|
||||
d = src_dict.copy()
|
||||
city = d.pop("city", UNSET)
|
||||
|
||||
country = d.pop("country", UNSET)
|
||||
_country = d.pop("country", UNSET)
|
||||
country: Union[Unset, CountryCode]
|
||||
if isinstance(_country, Unset):
|
||||
country = UNSET
|
||||
else:
|
||||
country = CountryCode(_country)
|
||||
|
||||
state = d.pop("state", UNSET)
|
||||
|
||||
|
54
kittycad/models/point_e_metadata.py
Normal file
54
kittycad/models/point_e_metadata.py
Normal file
@ -0,0 +1,54 @@
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="PointEMetadata")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class PointEMetadata:
|
||||
""" """
|
||||
ok: Union[Unset, bool] = False
|
||||
|
||||
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
ok = self.ok
|
||||
|
||||
field_dict: Dict[str, Any] = {}
|
||||
field_dict.update(self.additional_properties)
|
||||
field_dict.update({})
|
||||
if ok is not UNSET:
|
||||
field_dict['ok'] = ok
|
||||
|
||||
return field_dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
||||
d = src_dict.copy()
|
||||
ok = d.pop("ok", UNSET)
|
||||
|
||||
point_e_metadata = cls(
|
||||
ok=ok,
|
||||
)
|
||||
|
||||
point_e_metadata.additional_properties = d
|
||||
return point_e_metadata
|
||||
|
||||
@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
|
@ -4,9 +4,12 @@ from enum import Enum
|
||||
class UnitEnergyFormat(str, Enum):
|
||||
JOULE = 'joule'
|
||||
CALORIE = 'calorie'
|
||||
KILOWATT_HOUR = 'kilowatt_hour'
|
||||
WATT_HOUR = 'watt_hour'
|
||||
BRITISH_THERMAL_UNIT = 'british_thermal_unit'
|
||||
BRITISH_THERMAL_UNIT_ISO = 'british_thermal_unit_iso'
|
||||
BRITISH_THERMAL_UNIT59 = 'british_thermal_unit59'
|
||||
THERM = 'therm'
|
||||
FOOT_POUND = 'foot_pound'
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
@ -5,7 +5,7 @@ class UnitForceFormat(str, Enum):
|
||||
NEWTON = 'newton'
|
||||
POUND = 'pound'
|
||||
DYNE = 'dyne'
|
||||
KILOPOUND = 'kilopound'
|
||||
KILOPOND = 'kilopond'
|
||||
POUNDAL = 'poundal'
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
@ -3,12 +3,18 @@ from enum import Enum
|
||||
|
||||
class UnitLengthFormat(str, Enum):
|
||||
METER = 'meter'
|
||||
MILLIMETER = 'millimeter'
|
||||
CENTIMETER = 'centimeter'
|
||||
KILOMETER = 'kilometer'
|
||||
FOOT = 'foot'
|
||||
MIL = 'mil'
|
||||
INCH = 'inch'
|
||||
MILE = 'mile'
|
||||
NAUTICAL_MILE = 'nautical_mile'
|
||||
ASTRONOMICAL_UNIT = 'astronomical_unit'
|
||||
LIGHTYEAR = 'lightyear'
|
||||
PARSEC = 'parsec'
|
||||
ANGSTROM = 'angstrom'
|
||||
CUBIT = 'cubit'
|
||||
FATHOM = 'fathom'
|
||||
CHAIN = 'chain'
|
||||
@ -17,9 +23,6 @@ class UnitLengthFormat(str, Enum):
|
||||
LEAGUE = 'league'
|
||||
NAUTICAL_LEAGUE = 'nautical_league'
|
||||
YARD = 'yard'
|
||||
MILLIMETER = 'millimeter'
|
||||
CENTIMETER = 'centimeter'
|
||||
KILOMETER = 'kilometer'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
|
@ -3,6 +3,7 @@ from enum import Enum
|
||||
|
||||
class UnitMassFormat(str, Enum):
|
||||
GRAM = 'gram'
|
||||
KILOGRAM = 'kilogram'
|
||||
METRIC_TON = 'metric_ton'
|
||||
POUND = 'pound'
|
||||
LONG_TON = 'long_ton'
|
||||
@ -11,7 +12,6 @@ class UnitMassFormat(str, Enum):
|
||||
OUNCE = 'ounce'
|
||||
CARAT = 'carat'
|
||||
SLUG = 'slug'
|
||||
KILOGRAM = 'kilogram'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
|
185
kittycad/models/unit_radioactivity_conversion.py
Normal file
185
kittycad/models/unit_radioactivity_conversion.py
Normal file
@ -0,0 +1,185 @@
|
||||
import datetime
|
||||
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
||||
|
||||
import attr
|
||||
from dateutil.parser import isoparse
|
||||
|
||||
from ..models.uuid import Uuid
|
||||
from ..models.unit_radioactivity_format import UnitRadioactivityFormat
|
||||
from ..models.api_call_status import ApiCallStatus
|
||||
from ..types import UNSET, Unset
|
||||
|
||||
T = TypeVar("T", bound="UnitRadioactivityConversion")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class UnitRadioactivityConversion:
|
||||
""" """
|
||||
completed_at: Union[Unset, datetime.datetime] = UNSET
|
||||
created_at: Union[Unset, datetime.datetime] = UNSET
|
||||
error: Union[Unset, str] = UNSET
|
||||
id: Union[Unset, str] = UNSET
|
||||
input: Union[Unset, float] = UNSET
|
||||
output: Union[Unset, float] = UNSET
|
||||
output_format: Union[Unset, UnitRadioactivityFormat] = UNSET
|
||||
src_format: Union[Unset, UnitRadioactivityFormat] = UNSET
|
||||
started_at: Union[Unset, datetime.datetime] = UNSET
|
||||
status: Union[Unset, ApiCallStatus] = 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]:
|
||||
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()
|
||||
error = self.error
|
||||
id = self.id
|
||||
input = self.input
|
||||
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
|
||||
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 completed_at is not UNSET:
|
||||
field_dict['completed_at'] = completed_at
|
||||
if created_at is not UNSET:
|
||||
field_dict['created_at'] = created_at
|
||||
if error is not UNSET:
|
||||
field_dict['error'] = error
|
||||
if id is not UNSET:
|
||||
field_dict['id'] = id
|
||||
if input is not UNSET:
|
||||
field_dict['input'] = input
|
||||
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 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()
|
||||
_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)
|
||||
|
||||
error = d.pop("error", UNSET)
|
||||
|
||||
id = d.pop("id", UNSET)
|
||||
|
||||
input = d.pop("input", UNSET)
|
||||
|
||||
output = d.pop("output", UNSET)
|
||||
|
||||
_output_format = d.pop("output_format", UNSET)
|
||||
output_format: Union[Unset, UnitRadioactivityFormat]
|
||||
if isinstance(_output_format, Unset):
|
||||
output_format = UNSET
|
||||
else:
|
||||
output_format = UnitRadioactivityFormat(_output_format)
|
||||
|
||||
_src_format = d.pop("src_format", UNSET)
|
||||
src_format: Union[Unset, UnitRadioactivityFormat]
|
||||
if isinstance(_src_format, Unset):
|
||||
src_format = UNSET
|
||||
else:
|
||||
src_format = UnitRadioactivityFormat(_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, ApiCallStatus]
|
||||
if isinstance(_status, Unset):
|
||||
status = UNSET
|
||||
else:
|
||||
status = ApiCallStatus(_status)
|
||||
|
||||
_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)
|
||||
|
||||
unit_radioactivity_conversion = cls(
|
||||
completed_at=completed_at,
|
||||
created_at=created_at,
|
||||
error=error,
|
||||
id=id,
|
||||
input=input,
|
||||
output=output,
|
||||
output_format=output_format,
|
||||
src_format=src_format,
|
||||
started_at=started_at,
|
||||
status=status,
|
||||
updated_at=updated_at,
|
||||
user_id=user_id,
|
||||
)
|
||||
|
||||
unit_radioactivity_conversion.additional_properties = d
|
||||
return unit_radioactivity_conversion
|
||||
|
||||
@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
|
10
kittycad/models/unit_radioactivity_format.py
Normal file
10
kittycad/models/unit_radioactivity_format.py
Normal file
@ -0,0 +1,10 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class UnitRadioactivityFormat(str, Enum):
|
||||
BECQUEREL = 'becquerel'
|
||||
CURIE = 'curie'
|
||||
RUTHERFORD = 'rutherford'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
@ -3,13 +3,35 @@ from enum import Enum
|
||||
|
||||
class UnitVolumeFormat(str, Enum):
|
||||
CUBIC_METER = 'cubic_meter'
|
||||
CUBIC_CENTIMETER = 'cubic_centimeter'
|
||||
CUBIC_MILLIMETER = 'cubic_millimeter'
|
||||
CUBIC_KILOMETER = 'cubic_kilometer'
|
||||
LITER = 'liter'
|
||||
CUBIC_INCH = 'cubic_inch'
|
||||
CUBIC_FOOT = 'cubic_foot'
|
||||
CUBIC_YARD = 'cubic_yard'
|
||||
CUBIC_MILE = 'cubic_mile'
|
||||
CUBIC_CENTIMETER = 'cubic_centimeter'
|
||||
GALLON = 'gallon'
|
||||
QUART = 'quart'
|
||||
PINT = 'pint'
|
||||
CUP = 'cup'
|
||||
FLUID_OUNCE = 'fluid_ounce'
|
||||
BARREL = 'barrel'
|
||||
BUSHEL = 'bushel'
|
||||
CORD = 'cord'
|
||||
CUBIC_FATHOM = 'cubic_fathom'
|
||||
TABLESPOON = 'tablespoon'
|
||||
TEASPOON = 'teaspoon'
|
||||
PINCH = 'pinch'
|
||||
DASH = 'dash'
|
||||
DROP = 'drop'
|
||||
FIFTH = 'fifth'
|
||||
DRAM = 'dram'
|
||||
GILL = 'gill'
|
||||
PECK = 'peck'
|
||||
SACK = 'sack'
|
||||
SHOT = 'shot'
|
||||
STRIKE = 'strike'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self.value)
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "kittycad"
|
||||
version = "0.3.3"
|
||||
version = "0.3.5"
|
||||
description = "A client library for accessing KittyCAD"
|
||||
|
||||
authors = []
|
||||
@ -23,15 +23,15 @@ flake8 = "^5.0.4"
|
||||
pytest = "^7.0.1"
|
||||
sphinx-autodoc-typehints = "^1.12.0"
|
||||
pyenchant = "^3.2.2"
|
||||
sphinxcontrib-spelling = "^7.3.0"
|
||||
sphinxcontrib-spelling = "^8.0.0"
|
||||
toml = "^0.10.2"
|
||||
sphinx-rtd-theme = "^1.0.0"
|
||||
sphinx-automodapi = "^0.14"
|
||||
sphinx-automodapi = "^0.15"
|
||||
pytest-cov = "^4.0.0"
|
||||
pytest-asyncio = "^0.19.0"
|
||||
pytest-asyncio = "^0.21.0"
|
||||
openapi-parser = "^0.2.6"
|
||||
autopep8 = "^1.6.0"
|
||||
prance = "^0.21.8"
|
||||
autopep8 = "^2.0.0"
|
||||
prance = "^0.22.11"
|
||||
openapi-spec-validator = "^0.4.0"
|
||||
jsonpatch = "^1.32"
|
||||
|
||||
|
Reference in New Issue
Block a user