Compare commits

...

12 Commits

Author SHA1 Message Date
a03bc56651 bump version (#76)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-04-17 10:15:34 -07:00
2833086f13 Update httpx requirement from >=0.15.4,<0.24.0 to >=0.15.4,<0.25.0 (#74)
Updates the requirements on [httpx](https://github.com/encode/httpx) to permit the latest version.
- [Release notes](https://github.com/encode/httpx/releases)
- [Changelog](https://github.com/encode/httpx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/httpx/compare/0.15.4...0.24.0)

---
updated-dependencies:
- dependency-name: httpx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 10:12:25 -07:00
67da0afff9 Update attrs requirement from >=20.1.0,<23.0.0 to >=20.1.0,<24.0.0 (#75)
Updates the requirements on [attrs](https://github.com/python-attrs/attrs) to permit the latest version.
- [Release notes](https://github.com/python-attrs/attrs/releases)
- [Changelog](https://github.com/python-attrs/attrs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python-attrs/attrs/compare/20.1.0...23.1.0)

---
updated-dependencies:
- dependency-name: attrs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 10:07:29 -07:00
573f4a8bc8 Update api spec (#73)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-17 10:07:16 -07:00
11a1948ebc fix dockerfile / makefile (#72)
* update

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-06 16:09:33 -07:00
137b1600a8 bump version (#71)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-04-06 15:36:16 -07:00
6ef6e60467 Update api spec (#70)
* YOYO NEW API SPEC!

* generate

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-06 15:34:57 -07:00
374a57746e Update autopep8 requirement from ^1.6.0 to ^2.0.0 (#59)
Updates the requirements on [autopep8](https://github.com/hhatto/autopep8) to permit the latest version.
- [Release notes](https://github.com/hhatto/autopep8/releases)
- [Commits](https://github.com/hhatto/autopep8/compare/v1.6.0...v2.0.0)

---
updated-dependencies:
- dependency-name: autopep8
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-06 15:26:22 -07:00
20a61d19d1 Update pytest-asyncio requirement from ^0.20.3 to ^0.21.0 (#69)
Updates the requirements on [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.3...v0.21.0)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-06 15:20:39 -07:00
782dc863d4 Update sphinx-automodapi requirement from ^0.14 to ^0.15 (#68)
Updates the requirements on [sphinx-automodapi](https://github.com/astropy/sphinx-automodapi) to permit the latest version.
- [Release notes](https://github.com/astropy/sphinx-automodapi/releases)
- [Changelog](https://github.com/astropy/sphinx-automodapi/blob/main/CHANGES.rst)
- [Commits](https://github.com/astropy/sphinx-automodapi/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: sphinx-automodapi
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-06 15:20:32 -07:00
daab399185 Update sphinxcontrib-spelling requirement from ^7.3.0 to ^8.0.0 (#67)
Updates the requirements on [sphinxcontrib-spelling](https://github.com/sphinx-contrib/spelling) to permit the latest version.
- [Release notes](https://github.com/sphinx-contrib/spelling/releases)
- [Commits](https://github.com/sphinx-contrib/spelling/compare/7.3.0...8.0.0)

---
updated-dependencies:
- dependency-name: sphinxcontrib-spelling
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-06 15:20:24 -07:00
e4370b6108 Update api spec (#65)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-01-31 14:27:22 -05:00
31 changed files with 1507 additions and 1777 deletions

View File

@ -3,9 +3,9 @@ FROM python:3.9
RUN pip install \
poetry
WORKDIR /usr/src/
WORKDIR /home/user/src/
COPY . /usr/src/
COPY . /home/user/src/
RUN poetry update && poetry install

View File

@ -14,8 +14,8 @@ generate: docker-image ## Generate the api client.
docker run --rm -i $(DOCKER_FLAGS) \
--name python-generator \
--disable-content-trust \
-v $(CURDIR):/usr/src \
--workdir /usr/src \
-v $(CURDIR):/home/user/src \
--workdir /home/user/src \
$(DOCKER_IMAGE_NAME) ./generate/run.sh
.PHONY: shell
@ -24,8 +24,8 @@ shell: docker-image ## Pop into a shell in the docker image.
--name python-generator-shell \
-e KITTYCAD_API_TOKEN \
--disable-content-trust \
-v $(CURDIR):/usr/src \
--workdir /usr/src \
-v $(CURDIR):/home/user/src \
--workdir /home/user/src \
$(DOCKER_IMAGE_NAME) /bin/bash

View File

@ -2,6 +2,9 @@
set -e
set -o pipefail
# Fix for ci.
git config --global --add safe.directory /home/user/src
# Cleanup old stuff.
rm -rf kittycad/models
rm -rf kittycad/api

File diff suppressed because one or more lines are too long

View File

@ -81,6 +81,7 @@ def sync(
*,
client: Client,
) -> Optional[Union[Any, Mesh, Error]]:
""" This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better. """
return sync_detailed(
input_format=input_format,
@ -117,6 +118,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, Mesh, Error]]:
""" This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better. """
return (
await asyncio_detailed(

View File

@ -75,6 +75,7 @@ def sync(
*,
client: Client,
) -> Optional[Union[Any, Mesh, Error]]:
""" This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better. """
return sync_detailed(
output_format=output_format,
@ -107,6 +108,7 @@ async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, Mesh, Error]]:
""" This is an alpha endpoint. It will change in the future. The current output is honestly pretty bad. So if you find this endpoint, you get what you pay for, which currently is nothing. But in the future will be made a lot better. """
return (
await asyncio_detailed(

View File

@ -5,9 +5,7 @@ import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file2_d_vector_conversion import File2DVectorConversion
from ...models.file3_d_conversion import File3DConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_center_of_mass_with_uniform_density import FileCenterOfMassWithUniformDensity
from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity
@ -33,7 +31,7 @@ def _get_kwargs(
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200:
data = response.json()
try:
@ -50,13 +48,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = File3DConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
@ -64,13 +55,6 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMassWithUniformDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
@ -108,7 +92,7 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConv
return None
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
def _build_response(*, response: httpx.Response) -> Response[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
@ -121,7 +105,7 @@ def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
) -> Response[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
@ -139,7 +123,7 @@ def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned.
@ -155,7 +139,7 @@ async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
) -> Response[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
@ -171,7 +155,7 @@ async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, FileCenterOfMass, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async operation.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.
If the user is not authenticated to view the specified async operation, then it is not returned.

View File

@ -1,134 +0,0 @@
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

View File

@ -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,18 +71,15 @@ def sync_detailed(
def sync(
material_density: float,
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
Does the same as the `center_of_mass_with_uniform_density` endpoint; except, this has a redundant `material_density value`. Kept for legacy in this version.
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,
@ -93,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,
@ -113,19 +105,16 @@ async def asyncio_detailed(
async def asyncio(
material_density: float,
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMass, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
Does the same as the `center_of_mass_with_uniform_density` endpoint; except, this has a redundant `material_density value`. Kept for legacy in this version.
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(
material_density=material_density,
src_format=src_format,
body=body,
client=client,

View File

@ -1,122 +0,0 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_center_of_mass_with_uniform_density import FileCenterOfMassWithUniformDensity
from ...models.error import Error
from ...models.file3_d_import_format import File3DImportFormat
from ...types import Response
def _get_kwargs(
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/center-of-mass-with-uniform-density?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()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body,
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileCenterOfMassWithUniformDensity, Error]]:
if response.status_code == 201:
response_201 = FileCenterOfMassWithUniformDensity.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, FileCenterOfMassWithUniformDensity, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMassWithUniformDensity, Error]]:
kwargs = _get_kwargs(
src_format=src_format,
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMassWithUniformDensity, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
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(
src_format=src_format,
body=body,
client=client,
).parsed
async def asyncio_detailed(
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Response[Union[Any, FileCenterOfMassWithUniformDensity, Error]]:
kwargs = _get_kwargs(
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(
src_format: File3DImportFormat,
body: bytes,
*,
client: Client,
) -> Optional[Union[Any, FileCenterOfMassWithUniformDensity, Error]]:
""" Get the center of mass of an object in a CAD file. If the file is larger than 25MB, it will be performed asynchronously.
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(
src_format=src_format,
body=body,
client=client,
)
).parsed

View File

@ -1,185 +0,0 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file2_d_vector_conversion import File2DVectorConversion
from ...models.file3_d_conversion import File3DConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_center_of_mass_with_uniform_density import FileCenterOfMassWithUniformDensity
from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/conversions/{id}".format(client.base_url, id=id)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200:
data = response.json()
try:
if not isinstance(data, dict):
raise TypeError()
option = FileConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = File2DVectorConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = File3DConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMassWithUniformDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileVolume.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except:
raise
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, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned.
Only KittyCAD employees with the proper access can view file conversions for other users. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.
If the user is not authenticated to view the specified file conversion, then it is not returned.
Only KittyCAD employees with the proper access can view file conversions for other users. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -1,181 +0,0 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion import FileConversion
from ...models.file2_d_vector_conversion import File2DVectorConversion
from ...models.file3_d_conversion import File3DConversion
from ...models.file_center_of_mass import FileCenterOfMass
from ...models.file_center_of_mass_with_uniform_density import FileCenterOfMassWithUniformDensity
from ...models.file_mass import FileMass
from ...models.file_volume import FileVolume
from ...models.file_density import FileDensity
from ...models.file_surface_area import FileSurfaceArea
from ...models.error import Error
from ...types import Response
def _get_kwargs(
id: str,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/file/conversions/{id}".format(client.base_url, id=id)
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
if response.status_code == 200:
data = response.json()
try:
if not isinstance(data, dict):
raise TypeError()
option = FileConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = File2DVectorConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = File3DConversion.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileCenterOfMassWithUniformDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileMass.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileVolume.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileDensity.from_dict(data)
return option
except:
pass
try:
if not isinstance(data, dict):
raise TypeError()
option = FileSurfaceArea.from_dict(data)
return option
except:
raise
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, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
return sync_detailed(
id=id,
client=client,
).parsed
async def asyncio_detailed(
id: str,
*,
client: Client,
) -> Response[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
kwargs = _get_kwargs(
id=id,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
id: str,
*,
client: Client,
) -> Optional[Union[Any, FileConversion, File2DVectorConversion, File3DConversion, FileCenterOfMass, FileCenterOfMassWithUniformDensity, FileMass, FileVolume, FileDensity, FileSurfaceArea, Error]]:
""" Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.
This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. """
return (
await asyncio_detailed(
id=id,
client=client,
)
).parsed

View File

@ -0,0 +1,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

View File

@ -0,0 +1,100 @@
from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.dict import dict
from ...models.error import Error
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/openai/openapi.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, dict, Error]]:
if response.status_code == 200:
response_200 = 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, dict, Error]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
""" This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars. """
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Union[Any, dict, Error]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Any, dict, Error]]:
""" This is the same as the OpenAPI schema, BUT it has some modifications to make it compatible with OpenAI. For example, descriptions must be < 300 chars. """
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -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

View File

@ -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
@ -38,11 +45,8 @@ 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
from .file_center_of_mass_with_uniform_density import FileCenterOfMassWithUniformDensity
from .file_conversion import FileConversion
from .file_density import FileDensity
from .file_export_format import FileExportFormat

View 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

View File

@ -0,0 +1,8 @@
from enum import Enum
class AiPluginApiType(str, Enum):
OPENAPI = 'openapi'
def __str__(self) -> str:
return str(self.value)

View 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

View 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)

View 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)

View 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

View File

@ -4,10 +4,8 @@ from enum import Enum
class AsyncApiCallType(str, Enum):
FILE_CONVERSION = 'FileConversion'
FILE2_D_VECTOR_CONVERSION = 'File2DVectorConversion'
FILE3_D_CONVERSION = 'File3DConversion'
FILE_VOLUME = 'FileVolume'
FILE_CENTER_OF_MASS = 'FileCenterOfMass'
FILE_CENTER_OF_MASS_WITH_UNIFORM_DENSITY = 'FileCenterOfMassWithUniformDensity'
FILE_MASS = 'FileMass'
FILE_DENSITY = 'FileDensity'
FILE_SURFACE_AREA = 'FileSurfaceArea'

View 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)

View File

@ -1,179 +0,0 @@
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

View File

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

View File

@ -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,

View File

@ -1,166 +0,0 @@
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_import_format import File3DImportFormat
from ..models.api_call_status import ApiCallStatus
from ..types import UNSET, Unset
T = TypeVar("T", bound="FileCenterOfMassWithUniformDensity")
@attr.s(auto_attribs=True)
class FileCenterOfMassWithUniformDensity:
""" """
center_of_mass: Union[Unset, List[float]] = UNSET
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
id: Union[Unset, str] = 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]:
center_of_mass: Union[Unset, List[float]] = UNSET
if not isinstance(self.center_of_mass, Unset):
center_of_mass = self.center_of_mass
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
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 center_of_mass is not UNSET:
field_dict['center_of_mass'] = center_of_mass
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 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()
center_of_mass = cast(List[float], d.pop("center_of_mass", UNSET))
_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)
_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)
file_center_of_mass_with_uniform_density = cls(
center_of_mass=center_of_mass,
completed_at=completed_at,
created_at=created_at,
error=error,
id=id,
src_format=src_format,
started_at=started_at,
status=status,
updated_at=updated_at,
user_id=user_id,
)
file_center_of_mass_with_uniform_density.additional_properties = d
return file_center_of_mass_with_uniform_density
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties

View File

@ -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)

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "kittycad"
version = "0.3.4"
version = "0.3.6"
description = "A client library for accessing KittyCAD"
authors = []
@ -13,8 +13,8 @@ include = ["CHANGELOG.md", "kittycad/py.typed"]
[tool.poetry.dependencies]
python = "^3.7"
httpx = ">=0.15.4,<0.24.0"
attrs = ">=20.1.0,<23.0.0"
httpx = ">=0.15.4,<0.25.0"
attrs = ">=20.1.0,<24.0.0"
python-dateutil = "^2.8.0"
[tool.poetry.dev-dependencies]
@ -23,14 +23,14 @@ 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.20.3"
pytest-asyncio = "^0.21.0"
openapi-parser = "^0.2.6"
autopep8 = "^1.6.0"
autopep8 = "^2.0.0"
prance = "^0.22.11"
openapi-spec-validator = "^0.4.0"
jsonpatch = "^1.32"

1326
spec.json

File diff suppressed because it is too large Load Diff