working samples

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2023-11-29 10:32:31 -08:00
parent 9f8069decb
commit ed36086040
37 changed files with 962 additions and 856 deletions

2
.gitignore vendored
View File

@ -28,3 +28,5 @@ testing
docs/_build/ docs/_build/
docs/_autosummary/ docs/_autosummary/
docs/html/_sources/ docs/html/_sources/
snapshot.png

View File

@ -93,7 +93,7 @@ def sync(
client=client, client=client,
) )
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, compression=None, max_size=None) # type: ignore return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, max_size=None) # type: ignore
@ -126,7 +126,7 @@ async def asyncio(
client=client, client=client,
) )
return await ws_connect_async(kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"], close_timeout=120, compression=None, max_size=None) return await ws_connect_async(kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"], close_timeout=120, max_size=None)
{% if has_request_body %} {% if has_request_body %}
@ -183,11 +183,11 @@ class WebSocket:
def send(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}): def send(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}):
"""Send data to the websocket.""" """Send data to the websocket."""
self.ws.send(json.dumps(data.model_dump(mode="json"))) self.ws.send(json.dumps(data.model_dump()))
def send_binary(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}): def send_binary(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}):
"""Send data as bson to the websocket.""" """Send data as bson to the websocket."""
self.ws.send(bson.encode(data.model_dump(mode="json"))) # type: ignore self.ws.send(bson.encode(data.model_dump())) # type: ignore
def recv(self) -> {{response_type}}: def recv(self) -> {{response_type}}:
"""Receive data from the websocket.""" """Receive data from the websocket."""

View File

@ -1293,7 +1293,7 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
# Write the sum type. # Write the sum type.
description = getAnyOfDescription(schema) description = getAnyOfDescription(schema)
content = generateUnionType(all_options, name, description) content = generateUnionType(all_options, name, description, tag)
f.write(content) f.write(content)
# Close the file. # Close the file.
@ -1307,7 +1307,9 @@ def getAnyOfDescription(schema: dict) -> str:
return "" return ""
def generateUnionType(types: List[str], name: str, description: str) -> str: def generateUnionType(
types: List[str], name: str, description: str, tag: Optional[str]
) -> str:
ArgType = TypedDict( ArgType = TypedDict(
"ArgType", "ArgType",
{ {
@ -1324,12 +1326,14 @@ def generateUnionType(types: List[str], name: str, description: str) -> str:
"types": List[ArgType], "types": List[ArgType],
"description": str, "description": str,
"name": str, "name": str,
"tag": Optional[str],
}, },
) )
template_info: TemplateType = { template_info: TemplateType = {
"types": [], "types": [],
"description": description, "description": description,
"name": name, "name": name,
"tag": tag,
} }
for type in types: for type in types:
if type == "SuccessWebSocketResponse": if type == "SuccessWebSocketResponse":
@ -1496,7 +1500,7 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
# Write the sum type. # Write the sum type.
description = getOneOfDescription(schema) description = getOneOfDescription(schema)
content = generateUnionType(all_options, name, description) content = generateUnionType(all_options, name, description, tag)
f.write(content) f.write(content)
# Close the file. # Close the file.
@ -2058,7 +2062,7 @@ def getTypeName(schema: dict) -> str:
elif schema["format"] == "byte": elif schema["format"] == "byte":
return "Base64Data" return "Base64Data"
elif schema["format"] == "uuid": elif schema["format"] == "uuid":
return "UUID" return "str"
elif schema["format"] == "url": elif schema["format"] == "url":
return "AnyUrl" return "AnyUrl"
elif schema["format"] == "phone": elif schema["format"] == "phone":

View File

@ -1,5 +1,5 @@
import datetime import datetime
from typing import List, Optional, Dict, Union, Any from typing import List, Optional, Dict, Union, Any, Literal
from uuid import UUID from uuid import UUID
from pydantic import BaseModel, Base64Bytes, AnyUrl from pydantic import BaseModel, Base64Bytes, AnyUrl
@ -14,7 +14,7 @@ class {{ name }}(BaseModel):
"""{{ description }}""" """{{ description }}"""
{% for field in fields %} {% for field in fields %}
{% if field.value %} {% if field.value %}
{{ field.name }}: {{ field.type }} = {{ field.value }} {{ field.name }}: Literal[{{ field.value }}] = {{ field.value }}
{% else %} {% else %}
{{ field.name }}: {{ field.type }} {{ field.name }}: {{ field.type }}
{% endif %} {% endif %}

View File

@ -1,10 +1,21 @@
from typing import Dict, Any, Union, Type, TypeVar from typing import Dict, Any, Union, Type, TypeVar
from pydantic import RootModel from pydantic import RootModel, Field
from typing_extensions import Annotated
{% if tag %}
{{name}} = RootModel[Annotated[Union[
{% for type in types %}
{{type.name}},
{% endfor %}
], Field(discriminator='{{tag}}')]]
{% else %}
{{name}} = RootModel[Union[ {{name}} = RootModel[Union[
{% for type in types %} {% for type in types %}
{{type.name}}, {{type.name}},
{% endfor %} {% endfor %}
]] ]]
{% endif %}

View File

@ -1,130 +1,10 @@
[ [
{ {
"op": "add", "op": "add",
"path": "/paths/~1users-extended~1{id}/get/x-python", "path": "/paths/~1file~1execute~1{lang}/post/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html"
}
},
{
"op": "add",
"path": "/paths/~1.well-known~1ai-plugin.json/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1surface-area/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1intent/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/put/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1consent/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1invoices/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"
} }
}, },
{ {
@ -137,218 +17,18 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1ping/get/x-python", "path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1openai~1openapi.json/get/x-python", "path": "/paths/~1logout/post/x-python",
"value": { "value": {
"example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"
}
},
{
"op": "add",
"path": "/paths/~1ai-prompts/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPromptResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.html"
}
},
{
"op": "add",
"path": "/paths/~1users-extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1users~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"
}
},
{
"op": "add",
"path": "/paths/~1_meta~1info/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1callback/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1density/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1webhook/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1volume/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"
}
},
{
"op": "add",
"path": "/paths/~1auth~1email/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationToken\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationToken, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html"
}
},
{
"op": "add",
"path": "/paths/~1ai-prompts~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPrompt = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.html"
}
},
{
"op": "add",
"path": "/paths/~1user/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1user/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1user/put/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"<string>\",\n discord=\"<string>\",\n first_name=\"<string>\",\n github=\"<string>\",\n last_name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1executor~1term/get/x-python",
"value": {
"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n with create_executor_term.sync(\n client=client,\n ) as websocket:\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1center-of-mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1/get/x-python",
"value": {
"example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1ai~1text-to-cad~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html"
} }
}, },
{ {
@ -369,66 +49,18 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1ws~1modeling~1commands/get/x-python", "path": "/paths/~1users~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, WebSocketRequest, WebSocketResponse\nfrom kittycad.models.rtc_sdp_type import RtcSdpType\nfrom kittycad.models.rtc_session_description import RtcSessionDescription\nfrom kittycad.models.web_socket_request import sdp_offer\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n with modeling_commands_ws.WebSocket(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n ) as websocket:\n # Send a message.\n websocket.send(\n WebSocketRequest(\n sdp_offer(\n offer=RtcSessionDescription(\n sdp=\"<string>\",\n type=RtcSdpType.UNSPECIFIED,\n ),\n )\n )\n )\n\n # Get a message.\n message = websocket.recv()\n print(message)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1api-calls~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_force_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitForceConversion\nfrom kittycad.models.unit_force import UnitForce\nfrom kittycad.types import Response\n\n\ndef example_get_force_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitForceConversion, Error]\n ] = get_force_unit_conversion.sync(\n client=client,\n input_unit=UnitForce.DYNES,\n output_unit=UnitForce.DYNES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitForceConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_force_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.internal_get_api_token_for_discord_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1logout/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import logout\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_logout():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = logout.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.logout.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1front-hash/get/x-python",
"value": {
"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"
} }
}, },
{ {
@ -441,10 +73,58 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1api-call-metrics/get/x-python", "path": "/paths/~1user/put/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import update_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.models.update_user import UpdateUser\nfrom kittycad.types import Response\n\n\ndef example_update_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = update_user_self.sync(\n client=client,\n body=UpdateUser(\n company=\"<string>\",\n discord=\"<string>\",\n first_name=\"<string>\",\n github=\"<string>\",\n last_name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.update_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1user/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, User\nfrom kittycad.types import Response\n\n\ndef example_get_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[User, Error]] = get_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: User = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1user/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import delete_user_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_user_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_user_self.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.delete_user_self.html"
}
},
{
"op": "add",
"path": "/paths/~1users-extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ExtendedUserResultsPage, Error]\n ] = list_users_extended.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1ai-prompts/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_ai_prompts\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPromptResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_ai_prompts():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPromptResultsPage, Error]] = list_ai_prompts.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPromptResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_ai_prompts.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPrice, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPrice = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1front-hash/get/x-python",
"value": {
"example": "from kittycad.api.users import get_user_front_hash_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_user_front_hash_self():\n # Create our client.\n client = ClientFromEnv()\n\n get_user_front_hash_self.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_front_hash_self.html"
} }
}, },
{ {
@ -455,6 +135,30 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html"
} }
}, },
{
"op": "add",
"path": "/paths/~1users~1{id}~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"<string>\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1invoices/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_invoices_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Invoice\nfrom kittycad.types import Response\n\n\ndef example_list_invoices_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[List[Invoice], Error]] = list_invoices_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[Invoice] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_invoices_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_mass_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitMassConversion\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_get_mass_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitMassConversion, Error]\n ] = get_mass_unit_conversion.sync(\n client=client,\n input_unit=UnitMass.G,\n output_unit=UnitMass.G,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitMassConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_mass_unit_conversion.html"
}
},
{ {
"op": "add", "op": "add",
"path": "/paths/~1auth~1email~1callback/get/x-python", "path": "/paths/~1auth~1email~1callback/get/x-python",
@ -465,66 +169,114 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1payment~1balance/get/x-python", "path": "/paths/~1/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n", "example": "from kittycad.api.meta import get_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_schema.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1execute~1{lang}/post/x-python", "path": "/paths/~1users-extended~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.executor import create_file_execution\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CodeOutput, Error\nfrom kittycad.models.code_language import CodeLanguage\nfrom kittycad.types import Response\n\n\ndef example_create_file_execution():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[CodeOutput, Error]] = create_file_execution.sync(\n client=client,\n lang=CodeLanguage.GO,\n output=None, # Optional[str]\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CodeOutput = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_extended.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_file_execution.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_extended.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1users/get/x-python", "path": "/paths/~1openai~1openapi.json/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n", "example": "from kittycad.api.meta import get_openai_schema\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_get_openai_schema():\n # Create our client.\n client = ClientFromEnv()\n\n get_openai_schema.sync(\n client=client,\n )\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1file~1mass/post/x-python", "path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1text-to-cad~1{id}/get/x-python", "path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_for_user.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_frequency_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitFrequencyConversion\nfrom kittycad.models.unit_frequency import UnitFrequency\nfrom kittycad.types import Response\n\n\ndef example_get_frequency_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitFrequencyConversion, Error]\n ] = get_frequency_unit_conversion.sync(\n client=client,\n input_unit=UnitFrequency.GIGAHERTZ,\n output_unit=UnitFrequency.GIGAHERTZ,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitFrequencyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_frequency_unit_conversion.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1text-to-cad~1{id}/post/x-python", "path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"<uuid>\",\n feedback=AiFeedback.THUMBS_UP,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_pressure_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPressureConversion\nfrom kittycad.models.unit_pressure import UnitPressure\nfrom kittycad.types import Response\n\n\ndef example_get_pressure_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPressureConversion, Error]\n ] = get_pressure_unit_conversion.sync(\n client=client,\n input_unit=UnitPressure.ATMOSPHERES,\n output_unit=UnitPressure.ATMOSPHERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPressureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad_model_feedback.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_pressure_unit_conversion.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1payment~1tax/get/x-python", "path": "/paths/~1user~1payment/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = get_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_for_user.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1users~1{id}~1api-calls/get/x-python", "path": "/paths/~1user~1payment/put/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls_for_user.sync(\n client=client,\n id=\"<string>\",\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import update_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_update_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = update_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.update_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Customer, Error\nfrom kittycad.models.billing_info import BillingInfo\nfrom kittycad.types import Response\n\n\ndef example_create_payment_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[Customer, Error]\n ] = create_payment_information_for_user.sync(\n client=client,\n body=BillingInfo(\n name=\"<string>\",\n phone=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Customer = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1ai-prompts~1{id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_ai_prompt\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPrompt, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_prompt():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AiPrompt, Error]] = get_ai_prompt.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPrompt = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_ai_prompt.html"
}
},
{
"op": "add",
"path": "/paths/~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_current_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitCurrentConversion\nfrom kittycad.models.unit_current import UnitCurrent\nfrom kittycad.types import Response\n\n\ndef example_get_current_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitCurrentConversion, Error]\n ] = get_current_unit_conversion.sync(\n client=client,\n input_unit=UnitCurrent.AMPERES,\n output_unit=UnitCurrent.AMPERES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitCurrentConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_current_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import internal_get_api_token_for_discord_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_internal_get_api_token_for_discord_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiToken, Error]\n ] = internal_get_api_token_for_discord_user.sync(\n client=client,\n discord_id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.internal_get_api_token_for_discord_user.html"
} }
}, },
{ {
@ -543,6 +295,14 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.delete_api_token_for_user.html"
} }
}, },
{
"op": "add",
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import delete_payment_method_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_payment_method_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_payment_method_for_user.sync(\n client=client,\n id=\"<string>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.delete_payment_method_for_user.html"
}
},
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1session~1{token}/get/x-python", "path": "/paths/~1user~1session~1{token}/get/x-python",
@ -553,18 +313,26 @@
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1user~1text-to-cad/get/x-python", "path": "/paths/~1user~1text-to-cad~1{id}/get/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCadResultsPage = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import get_text_to_cad_model_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.types import Response\n\n\ndef example_get_text_to_cad_model_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCad, Error]\n ] = get_text_to_cad_model_for_user.sync(\n client=client,\n id=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html"
} }
}, },
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1user~1text-to-cad~1{id}/post/x-python",
"value": { "value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_angle_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAngleConversion\nfrom kittycad.models.unit_angle import UnitAngle\nfrom kittycad.types import Response\n\n\ndef example_get_angle_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAngleConversion, Error]\n ] = get_angle_unit_conversion.sync(\n client=client,\n input_unit=UnitAngle.DEGREES,\n output_unit=UnitAngle.DEGREES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAngleConversion = result\n print(body)\n", "example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad_model_feedback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.models.ai_feedback import AiFeedback\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad_model_feedback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = create_text_to_cad_model_feedback.sync(\n client=client,\n id=\"<uuid>\",\n feedback=AiFeedback.THUMBS_UP,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_angle_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad_model_feedback.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1executor~1term/get/x-python",
"value": {
"example": "from kittycad.api.executor import create_executor_term\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.types import Response\n\n\ndef example_create_executor_term():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n with create_executor_term.sync(\n client=client,\n ) as websocket:\n # Send a message.\n websocket.send(\"{}\")\n\n # Get the messages.\n for message in websocket:\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.executor.create_executor_term.html"
} }
}, },
{ {
@ -575,6 +343,30 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"
} }
}, },
{
"op": "add",
"path": "/paths/~1api-call-metrics/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_api_call_metrics\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallQueryGroup, Error\nfrom kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy\nfrom kittycad.types import Response\n\n\ndef example_get_api_call_metrics():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[ApiCallQueryGroup], Error]\n ] = get_api_call_metrics.sync(\n client=client,\n group_by=ApiCallQueryGroupBy.EMAIL,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[ApiCallQueryGroup] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_api_call_metrics.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1balance/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import get_payment_balance_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import CustomerBalance, Error\nfrom kittycad.types import Response\n\n\ndef example_get_payment_balance_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[CustomerBalance, Error]\n ] = get_payment_balance_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: CustomerBalance = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_balance_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1volume/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_volume\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileVolume\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_create_file_volume():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileVolume, Error]] = create_file_volume.sync(\n client=client,\n output_unit=UnitVolume.CM3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileVolume = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_volume.html"
}
},
{ {
"op": "add", "op": "add",
"path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python", "path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-python",
@ -583,6 +375,214 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html" "libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"
} }
}, },
{
"op": "add",
"path": "/paths/~1user~1text-to-cad/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import list_text_to_cad_models_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCadResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_text_to_cad_models_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[TextToCadResultsPage, Error]\n ] = list_text_to_cad_models_for_user.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCadResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.list_text_to_cad_models_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileConversion\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.types import Response\n\n\ndef example_create_file_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileConversion, Error]] = create_file_conversion.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_torque_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTorqueConversion\nfrom kittycad.models.unit_torque import UnitTorque\nfrom kittycad.types import Response\n\n\ndef example_get_torque_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTorqueConversion, Error]\n ] = get_torque_unit_conversion.sync(\n client=client,\n input_unit=UnitTorque.NEWTON_METRES,\n output_unit=UnitTorque.NEWTON_METRES,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitTorqueConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_torque_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1auth~1email/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, VerificationToken\nfrom kittycad.models.email_authentication_form import EmailAuthenticationForm\nfrom kittycad.types import Response\n\n\ndef example_auth_email():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[VerificationToken, Error]] = auth_email.sync(\n client=client,\n body=EmailAuthenticationForm(\n email=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: VerificationToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email.html"
}
},
{
"op": "add",
"path": "/paths/~1.well-known~1ai-plugin.json/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_ai_plugin_manifest\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AiPluginManifest, Error\nfrom kittycad.types import Response\n\n\ndef example_get_ai_plugin_manifest():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AiPluginManifest, Error]\n ] = get_ai_plugin_manifest.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AiPluginManifest = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_ai_plugin_manifest.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_power_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitPowerConversion\nfrom kittycad.models.unit_power import UnitPower\nfrom kittycad.types import Response\n\n\ndef example_get_power_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitPowerConversion, Error]\n ] = get_power_unit_conversion.sync(\n client=client,\n input_unit=UnitPower.BTU_PER_MINUTE,\n output_unit=UnitPower.BTU_PER_MINUTE,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitPowerConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_power_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-calls/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import user_list_api_calls\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiCallWithPriceResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_user_list_api_calls():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiCallWithPriceResultsPage, Error]\n ] = user_list_api_calls.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ApiCallWithPriceResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.user_list_api_calls.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1callback/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_callback.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_callback.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1center-of-mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_center_of_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileCenterOfMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_create_file_center_of_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileCenterOfMass, Error]\n ] = create_file_center_of_mass.sync(\n client=client,\n output_unit=UnitLength.CM,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileCenterOfMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_center_of_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1_meta~1info/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import get_metadata\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Metadata\nfrom kittycad.types import Response\n\n\ndef example_get_metadata():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Metadata, Error]] = get_metadata.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Metadata = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_metadata.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_area_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitAreaConversion\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_get_area_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitAreaConversion, Error]\n ] = get_area_unit_conversion.sync(\n client=client,\n input_unit=UnitArea.CM2,\n output_unit=UnitArea.CM2,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitAreaConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_area_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1methods/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import list_payment_methods_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentMethod\nfrom kittycad.types import Response\n\n\ndef example_list_payment_methods_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[List[PaymentMethod], Error]\n ] = list_payment_methods_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: List[PaymentMethod] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.list_payment_methods_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1surface-area/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_surface_area\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileSurfaceArea\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_area import UnitArea\nfrom kittycad.types import Response\n\n\ndef example_create_file_surface_area():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[FileSurfaceArea, Error]\n ] = create_file_surface_area.sync(\n client=client,\n output_unit=UnitArea.CM2,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileSurfaceArea = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_surface_area.html"
}
},
{
"op": "add",
"path": "/paths/~1ping/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.meta import ping\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Pong\nfrom kittycad.types import Response\n\n\ndef example_ping():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Pong, Error]] = ping.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Pong = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.ping.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_length_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitLengthConversion\nfrom kittycad.models.unit_length import UnitLength\nfrom kittycad.types import Response\n\n\ndef example_get_length_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitLengthConversion, Error]\n ] = get_length_unit_conversion.sync(\n client=client,\n input_unit=UnitLength.CM,\n output_unit=UnitLength.CM,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitLengthConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_length_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1webhook/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_webhook\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_webhook():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = apps_github_webhook.sync(\n client=client,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_webhook.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1density/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_density\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileDensity\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_density():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileDensity, Error]] = create_file_density.sync(\n client=client,\n material_mass=3.14,\n material_mass_unit=UnitMass.G,\n output_unit=UnitDensity.LB_FT3,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileDensity = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_density.html"
}
},
{
"op": "add",
"path": "/paths/~1ws~1modeling~1commands/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.modeling import modeling_commands_ws\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, WebSocketRequest, WebSocketResponse\nfrom kittycad.models.rtc_sdp_type import RtcSdpType\nfrom kittycad.models.rtc_session_description import RtcSessionDescription\nfrom kittycad.models.web_socket_request import sdp_offer\nfrom kittycad.types import Response\n\n\ndef example_modeling_commands_ws():\n # Create our client.\n client = ClientFromEnv()\n\n # Connect to the websocket.\n with modeling_commands_ws.WebSocket(\n client=client,\n fps=10,\n unlocked_framerate=False,\n video_res_height=10,\n video_res_width=10,\n webrtc=False,\n ) as websocket:\n # Send a message.\n websocket.send(\n WebSocketRequest(\n sdp_offer(\n offer=RtcSessionDescription(\n sdp=\"<string>\",\n type=RtcSdpType.UNSPECIFIED,\n ),\n )\n )\n )\n\n # Get a message.\n message = websocket.recv()\n print(message)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.modeling.modeling_commands_ws.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_volume_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitVolumeConversion\nfrom kittycad.models.unit_volume import UnitVolume\nfrom kittycad.types import Response\n\n\ndef example_get_volume_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitVolumeConversion, Error]\n ] = get_volume_unit_conversion.sync(\n client=client,\n input_unit=UnitVolume.CM3,\n output_unit=UnitVolume.CM3,\n value=3.14,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UnitVolumeConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_volume_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1tax/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import validate_customer_tax_information_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_validate_customer_tax_information_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = validate_customer_tax_information_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.validate_customer_tax_information_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1apps~1github~1consent/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.apps import apps_github_consent\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AppClientInfo, Error\nfrom kittycad.types import Response\n\n\ndef example_apps_github_consent():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[AppClientInfo, Error]] = apps_github_consent.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: AppClientInfo = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.apps.apps_github_consent.html"
}
},
{
"op": "add",
"path": "/paths/~1file~1mass/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.file import create_file_mass\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, FileMass\nfrom kittycad.models.file_import_format import FileImportFormat\nfrom kittycad.models.unit_density import UnitDensity\nfrom kittycad.models.unit_mass import UnitMass\nfrom kittycad.types import Response\n\n\ndef example_create_file_mass():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[FileMass, Error]] = create_file_mass.sync(\n client=client,\n material_density=3.14,\n material_density_unit=UnitDensity.LB_FT3,\n output_unit=UnitMass.G,\n src_format=FileImportFormat.FBX,\n body=bytes(\"some bytes\", \"utf-8\"),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: FileMass = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.file.create_file_mass.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_self_extended\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, ExtendedUser\nfrom kittycad.types import Response\n\n\ndef example_get_user_self_extended():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ExtendedUser, Error]] = get_user_self_extended.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: ExtendedUser = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_self_extended.html"
}
},
{
"op": "add",
"path": "/paths/~1users/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import list_users\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UserResultsPage\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_users():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[UserResultsPage, Error]] = list_users.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n limit=None, # Optional[int]\n page_token=None, # Optional[str]\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: UserResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.list_users.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1intent/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.payments import create_payment_intent_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, PaymentIntent\nfrom kittycad.types import Response\n\n\ndef example_create_payment_intent_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[PaymentIntent, Error]\n ] = create_payment_intent_for_user.sync(\n client=client,\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: PaymentIntent = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_intent_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1ai~1text-to-cad~1{output_format}/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.ai import create_text_to_cad\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, TextToCad\nfrom kittycad.models.file_export_format import FileExportFormat\nfrom kittycad.models.text_to_cad_create_body import TextToCadCreateBody\nfrom kittycad.types import Response\n\n\ndef example_create_text_to_cad():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[TextToCad, Error]] = create_text_to_cad.sync(\n client=client,\n output_format=FileExportFormat.FBX,\n body=TextToCadCreateBody(\n prompt=\"<string>\",\n ),\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: TextToCad = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.create_text_to_cad.html"
}
},
{ {
"op": "add", "op": "add",
"path": "/info/x-python", "path": "/info/x-python",

View File

@ -33,7 +33,7 @@ def sync(
client=client, client=client,
) )
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, compression=None, max_size=None) # type: ignore return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, max_size=None) # type: ignore
async def asyncio( async def asyncio(
@ -50,6 +50,5 @@ async def asyncio(
kwargs["url"].replace("http", "ws"), kwargs["url"].replace("http", "ws"),
extra_headers=kwargs["headers"], extra_headers=kwargs["headers"],
close_timeout=120, close_timeout=120,
compression=None,
max_size=None, max_size=None,
) )

View File

@ -82,7 +82,7 @@ def sync(
client=client, client=client,
) )
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, compression=None, max_size=None) # type: ignore return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=120, max_size=None) # type: ignore
async def asyncio( async def asyncio(
@ -109,7 +109,6 @@ async def asyncio(
kwargs["url"].replace("http", "ws"), kwargs["url"].replace("http", "ws"),
extra_headers=kwargs["headers"], extra_headers=kwargs["headers"],
close_timeout=120, close_timeout=120,
compression=None,
max_size=None, max_size=None,
) )
@ -161,11 +160,11 @@ class WebSocket:
def send(self, data: WebSocketRequest): def send(self, data: WebSocketRequest):
"""Send data to the websocket.""" """Send data to the websocket."""
self.ws.send(json.dumps(data.model_dump(mode="json"))) self.ws.send(json.dumps(data.model_dump()))
def send_binary(self, data: WebSocketRequest): def send_binary(self, data: WebSocketRequest):
"""Send data as bson to the websocket.""" """Send data as bson to the websocket."""
self.ws.send(bson.encode(data.model_dump(mode="json"))) # type: ignore self.ws.send(bson.encode(data.model_dump())) # type: ignore
def recv(self) -> WebSocketResponse: def recv(self) -> WebSocketResponse:
"""Receive data from the websocket.""" """Receive data from the websocket."""

View File

@ -1,7 +1,7 @@
import json import json
import os import os
import uuid import uuid
from typing import Optional, Union, cast from typing import Optional, Union
import pytest import pytest
@ -20,7 +20,6 @@ from .models import (
Direction, Direction,
Error, Error,
ExtendedUserResultsPage, ExtendedUserResultsPage,
FailureWebSocketResponse,
FileConversion, FileConversion,
FileExportFormat, FileExportFormat,
FileImportFormat, FileImportFormat,
@ -32,7 +31,6 @@ from .models import (
ModelingCmd, ModelingCmd,
ModelingCmdId, ModelingCmdId,
Pong, Pong,
SuccessWebSocketResponse,
System, System,
UnitDensity, UnitDensity,
UnitLength, UnitLength,
@ -40,6 +38,7 @@ from .models import (
UnitVolume, UnitVolume,
User, User,
WebSocketRequest, WebSocketRequest,
WebSocketResponse,
) )
from .models.input_format import obj from .models.input_format import obj
from .models.modeling_cmd import ( from .models.modeling_cmd import (
@ -48,7 +47,6 @@ from .models.modeling_cmd import (
start_path, start_path,
take_snapshot, take_snapshot,
) )
from .models.ok_web_socket_response_data import modeling
from .models.web_socket_request import modeling_cmd_req from .models.web_socket_request import modeling_cmd_req
from .types import Unset from .types import Unset
@ -385,16 +383,29 @@ def test_ws_import():
websocket.send_binary(req) websocket.send_binary(req)
# Get the success message. # Get the success message.
message = websocket.recv() object_id = ""
if isinstance(message, FailureWebSocketResponse): for message in websocket:
raise Exception(message) message_dict = message.model_dump()
elif isinstance(message, SuccessWebSocketResponse): if message_dict["success"] is not True:
response = cast(SuccessWebSocketResponse, message) raise Exception(message_dict)
resp = cast(modeling, response.resp) elif message_dict["resp"]["type"] != "modeling":
print(json.dumps(resp.model_dump_json())) continue
# Get the object id from the response. elif (
# TODO: FIX message_dict["resp"]["data"]["modeling_response"]["type"]
object_id = uuid.uuid4() != "import_files"
):
# We have a modeling command response.
# Make sure its the import files response.
raise Exception(message_dict)
else:
# Okay we have the import files response.
# Break since now we know it was a success.
object_id = str(
message_dict["resp"]["data"]["modeling_response"]["data"][
"object_id"
]
)
break
# Now we want to focus on the object. # Now we want to focus on the object.
cmd_id = uuid.uuid4() cmd_id = uuid.uuid4()
@ -408,8 +419,17 @@ def test_ws_import():
websocket.send(req) websocket.send(req)
# Get the success message. # Get the success message.
message = websocket.recv() for message in websocket:
print(json.dumps(message.model_dump_json())) message_dict = message.model_dump()
if message_dict["success"] is not True:
raise Exception(message_dict)
elif message_dict["resp"]["type"] != "modeling":
continue
elif message_dict["request_id"] == str(cmd_id):
# We got a success response for our cmd.
break
else:
raise Exception(message_dict)
# Now we want to snapshot as a png. # Now we want to snapshot as a png.
cmd_id = uuid.uuid4() cmd_id = uuid.uuid4()
@ -422,3 +442,50 @@ def test_ws_import():
) )
) )
websocket.send(req) websocket.send(req)
# Get the success message.
png_contents = b""
for message in websocket:
message_dict = message.model_dump()
if message_dict["success"] is not True:
raise Exception(message_dict)
elif message_dict["resp"]["type"] != "modeling":
continue
elif (
message_dict["resp"]["data"]["modeling_response"]["type"]
!= "take_snapshot"
):
# Make sure its the correct response.
raise Exception(message_dict)
else:
# Okay we have the snapshot response.
# Break since now we know it was a success.
png_contents = message_dict["resp"]["data"]["modeling_response"][
"data"
]["contents"].get_decoded()
break
# Save the contents to a file.
png_path = os.path.join(dir_path, "..", "assets", "snapshot.png")
with open(png_path, "wb") as f:
f.write(png_contents)
# Ensure the file is not empty.
assert len(png_contents) > 0
# Ensure the file exists.
assert os.path.exists(png_path)
def test_serialize_deserialize():
json_str = """{"success":true,"request_id":"16a06065-6ca3-4a96-a042-d0bec6b161a6","resp":{"type":"modeling","data":{"modeling_response":{"type":"import_files","data":{"object_id":"f61ac02e-77bd-468f-858f-fd4141a26acd"}}}}}"""
d = json.loads(json_str)
print(d)
message = WebSocketResponse(**d)
model_dump = message.model_dump()
print(model_dump)
assert model_dump["success"] is True # type: ignore
assert model_dump["request_id"] == "16a06065-6ca3-4a96-a042-d0bec6b161a6" # type: ignore
assert model_dump["resp"]["type"] == "modeling" # type: ignore
assert model_dump["resp"]["data"]["modeling_response"]["type"] == "import_files" # type: ignore
assert model_dump["resp"]["data"]["modeling_response"]["data"]["object_id"] == "f61ac02e-77bd-468f-858f-fd4141a26acd" # type: ignore

View File

@ -1,7 +1,8 @@
import datetime import datetime
from typing import Dict, Optional, Union from typing import Dict, Literal, Optional, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.ai_feedback import AiFeedback from ..models.ai_feedback import AiFeedback
from ..models.api_call_status import ApiCallStatus from ..models.api_call_status import ApiCallStatus
@ -44,7 +45,7 @@ class file_conversion(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "file_conversion" type: Literal["file_conversion"] = "file_conversion"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -72,7 +73,7 @@ class file_center_of_mass(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "file_center_of_mass" type: Literal["file_center_of_mass"] = "file_center_of_mass"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -104,7 +105,7 @@ class file_mass(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "file_mass" type: Literal["file_mass"] = "file_mass"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -130,7 +131,7 @@ class file_volume(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "file_volume" type: Literal["file_volume"] = "file_volume"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -164,7 +165,7 @@ class file_density(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "file_density" type: Literal["file_density"] = "file_density"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -192,7 +193,7 @@ class file_surface_area(BaseModel):
surface_area: Optional[float] = None surface_area: Optional[float] = None
type: str = "file_surface_area" type: Literal["file_surface_area"] = "file_surface_area"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -224,7 +225,7 @@ class text_to_cad(BaseModel):
status: ApiCallStatus status: ApiCallStatus
type: str = "text_to_cad" type: Literal["text_to_cad"] = "text_to_cad"
updated_at: datetime.datetime updated_at: datetime.datetime
@ -232,6 +233,7 @@ class text_to_cad(BaseModel):
AsyncApiCallOutput = RootModel[ AsyncApiCallOutput = RootModel[
Annotated[
Union[ Union[
file_conversion, file_conversion,
file_center_of_mass, file_center_of_mass,
@ -240,5 +242,7 @@ AsyncApiCallOutput = RootModel[
file_density, file_density,
file_surface_area, file_surface_area,
text_to_cad, text_to_cad,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,8 +7,8 @@ from ..models.o_auth2_grant_type import OAuth2GrantType
class DeviceAccessTokenRequestForm(BaseModel): class DeviceAccessTokenRequestForm(BaseModel):
"""The form for a device access token request.""" """The form for a device access token request."""
client_id: UUID client_id: str
device_code: UUID device_code: str
grant_type: OAuth2GrantType grant_type: OAuth2GrantType

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -7,4 +6,4 @@ from pydantic import BaseModel
class DeviceAuthRequestForm(BaseModel): class DeviceAuthRequestForm(BaseModel):
"""The request parameters for the OAuth 2.0 Device Authorization Grant flow.""" """The request parameters for the OAuth 2.0 Device Authorization Grant flow."""
client_id: UUID client_id: str

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class EntityGetAllChildUuids(BaseModel): class EntityGetAllChildUuids(BaseModel):
"""The response from the `EntityGetAllChildUuids` command.""" """The response from the `EntityGetAllChildUuids` command."""
entity_ids: List[UUID] entity_ids: List[str]

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -7,4 +6,4 @@ from pydantic import BaseModel
class EntityGetChildUuid(BaseModel): class EntityGetChildUuid(BaseModel):
"""The response from the `EntityGetChildUuid` command.""" """The response from the `EntityGetChildUuid` command."""
entity_id: UUID entity_id: str

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -7,4 +6,4 @@ from pydantic import BaseModel
class EntityGetParentId(BaseModel): class EntityGetParentId(BaseModel):
"""The response from the `EntityGetParentId` command.""" """The response from the `EntityGetParentId` command."""
entity_id: UUID entity_id: str

View File

@ -1,5 +1,4 @@
from typing import List, Optional from typing import List, Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -11,6 +10,6 @@ class FailureWebSocketResponse(BaseModel):
errors: List[ApiError] errors: List[ApiError]
request_id: Optional[UUID] = None request_id: Optional[str] = None
success: bool success: bool

View File

@ -1,5 +1,4 @@
from typing import Optional from typing import Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,6 +7,6 @@ from pydantic import BaseModel
class HighlightSetEntity(BaseModel): class HighlightSetEntity(BaseModel):
"""The response from the `HighlightSetEntity` command.""" """The response from the `HighlightSetEntity` command."""
entity_id: Optional[UUID] = None entity_id: Optional[str] = None
sequence: Optional[int] = None sequence: Optional[int] = None

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -7,4 +6,4 @@ from pydantic import BaseModel
class ImportFiles(BaseModel): class ImportFiles(BaseModel):
"""Data from importing the files""" """Data from importing the files"""
object_id: UUID object_id: str

View File

@ -1,6 +1,7 @@
from typing import Union from typing import Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.system import System from ..models.system import System
from ..models.unit_length import UnitLength from ..models.unit_length import UnitLength
@ -9,13 +10,13 @@ from ..models.unit_length import UnitLength
class fbx(BaseModel): class fbx(BaseModel):
"""Autodesk Filmbox (FBX) format.""" """Autodesk Filmbox (FBX) format."""
type: str = "fbx" type: Literal["fbx"] = "fbx"
class gltf(BaseModel): class gltf(BaseModel):
"""Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb).""" """Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb)."""
type: str = "gltf" type: Literal["gltf"] = "gltf"
class obj(BaseModel): class obj(BaseModel):
@ -23,7 +24,7 @@ class obj(BaseModel):
coords: System coords: System
type: str = "obj" type: Literal["obj"] = "obj"
units: UnitLength units: UnitLength
@ -33,7 +34,7 @@ class ply(BaseModel):
coords: System coords: System
type: str = "ply" type: Literal["ply"] = "ply"
units: UnitLength units: UnitLength
@ -41,13 +42,13 @@ class ply(BaseModel):
class sldprt(BaseModel): class sldprt(BaseModel):
"""SolidWorks part (SLDPRT) format.""" """SolidWorks part (SLDPRT) format."""
type: str = "sldprt" type: Literal["sldprt"] = "sldprt"
class step(BaseModel): class step(BaseModel):
"""ISO 10303-21 (STEP) format.""" """ISO 10303-21 (STEP) format."""
type: str = "step" type: Literal["step"] = "step"
class stl(BaseModel): class stl(BaseModel):
@ -55,12 +56,13 @@ class stl(BaseModel):
coords: System coords: System
type: str = "stl" type: Literal["stl"] = "stl"
units: UnitLength units: UnitLength
InputFormat = RootModel[ InputFormat = RootModel[
Annotated[
Union[ Union[
fbx, fbx,
gltf, gltf,
@ -69,5 +71,7 @@ InputFormat = RootModel[
sldprt, sldprt,
step, step,
stl, stl,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,7 +1,7 @@
from typing import List, Optional, Union from typing import List, Literal, Optional, Union
from uuid import UUID
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.annotation_options import AnnotationOptions from ..models.annotation_options import AnnotationOptions
from ..models.annotation_type import AnnotationType from ..models.annotation_type import AnnotationType
@ -29,7 +29,7 @@ from ..models.unit_volume import UnitVolume
class start_path(BaseModel): class start_path(BaseModel):
"""Start a path.""" """Start a path."""
type: str = "start_path" type: Literal["start_path"] = "start_path"
class move_path_pen(BaseModel): class move_path_pen(BaseModel):
@ -39,7 +39,7 @@ class move_path_pen(BaseModel):
to: Point3d to: Point3d
type: str = "move_path_pen" type: Literal["move_path_pen"] = "move_path_pen"
class extend_path(BaseModel): class extend_path(BaseModel):
@ -49,7 +49,7 @@ class extend_path(BaseModel):
segment: PathSegment segment: PathSegment
type: str = "extend_path" type: Literal["extend_path"] = "extend_path"
class extrude(BaseModel): class extrude(BaseModel):
@ -61,15 +61,15 @@ class extrude(BaseModel):
target: ModelingCmdId target: ModelingCmdId
type: str = "extrude" type: Literal["extrude"] = "extrude"
class close_path(BaseModel): class close_path(BaseModel):
"""Closes a path, converting it to a 2D solid.""" """Closes a path, converting it to a 2D solid."""
path_id: UUID path_id: str
type: str = "close_path" type: Literal["close_path"] = "close_path"
class camera_drag_start(BaseModel): class camera_drag_start(BaseModel):
@ -77,7 +77,7 @@ class camera_drag_start(BaseModel):
interaction: CameraDragInteractionType interaction: CameraDragInteractionType
type: str = "camera_drag_start" type: Literal["camera_drag_start"] = "camera_drag_start"
window: Point2d window: Point2d
@ -89,7 +89,7 @@ class camera_drag_move(BaseModel):
sequence: Optional[int] = None sequence: Optional[int] = None
type: str = "camera_drag_move" type: Literal["camera_drag_move"] = "camera_drag_move"
window: Point2d window: Point2d
@ -99,7 +99,7 @@ class camera_drag_end(BaseModel):
interaction: CameraDragInteractionType interaction: CameraDragInteractionType
type: str = "camera_drag_end" type: Literal["camera_drag_end"] = "camera_drag_end"
window: Point2d window: Point2d
@ -109,7 +109,7 @@ class default_camera_look_at(BaseModel):
center: Point3d center: Point3d
type: str = "default_camera_look_at" type: Literal["default_camera_look_at"] = "default_camera_look_at"
up: Point3d up: Point3d
@ -121,7 +121,7 @@ class default_camera_zoom(BaseModel):
magnitude: float magnitude: float
type: str = "default_camera_zoom" type: Literal["default_camera_zoom"] = "default_camera_zoom"
class default_camera_enable_sketch_mode(BaseModel): class default_camera_enable_sketch_mode(BaseModel):
@ -135,7 +135,9 @@ class default_camera_enable_sketch_mode(BaseModel):
ortho: bool ortho: bool
type: str = "default_camera_enable_sketch_mode" type: Literal[
"default_camera_enable_sketch_mode"
] = "default_camera_enable_sketch_mode"
x_axis: Point3d x_axis: Point3d
@ -145,43 +147,45 @@ class default_camera_enable_sketch_mode(BaseModel):
class default_camera_disable_sketch_mode(BaseModel): class default_camera_disable_sketch_mode(BaseModel):
"""Disable sketch mode, from the default camera.""" """Disable sketch mode, from the default camera."""
type: str = "default_camera_disable_sketch_mode" type: Literal[
"default_camera_disable_sketch_mode"
] = "default_camera_disable_sketch_mode"
class default_camera_focus_on(BaseModel): class default_camera_focus_on(BaseModel):
"""Focus default camera on object.""" """Focus default camera on object."""
type: str = "default_camera_focus_on" type: Literal["default_camera_focus_on"] = "default_camera_focus_on"
uuid: UUID uuid: str
class export(BaseModel): class export(BaseModel):
"""Export the scene to a file.""" """Export the scene to a file."""
entity_ids: List[UUID] entity_ids: List[str]
format: OutputFormat format: OutputFormat
source_unit: UnitLength source_unit: UnitLength
type: str = "export" type: Literal["export"] = "export"
class entity_get_parent_id(BaseModel): class entity_get_parent_id(BaseModel):
"""What is this entity's parent?""" """What is this entity's parent?"""
entity_id: UUID entity_id: str
type: str = "entity_get_parent_id" type: Literal["entity_get_parent_id"] = "entity_get_parent_id"
class entity_get_num_children(BaseModel): class entity_get_num_children(BaseModel):
"""How many children does the entity have?""" """How many children does the entity have?"""
entity_id: UUID entity_id: str
type: str = "entity_get_num_children" type: Literal["entity_get_num_children"] = "entity_get_num_children"
class entity_get_child_uuid(BaseModel): class entity_get_child_uuid(BaseModel):
@ -189,31 +193,31 @@ class entity_get_child_uuid(BaseModel):
child_index: int child_index: int
entity_id: UUID entity_id: str
type: str = "entity_get_child_uuid" type: Literal["entity_get_child_uuid"] = "entity_get_child_uuid"
class entity_get_all_child_uuids(BaseModel): class entity_get_all_child_uuids(BaseModel):
"""What are all UUIDs of this entity's children?""" """What are all UUIDs of this entity's children?"""
entity_id: UUID entity_id: str
type: str = "entity_get_all_child_uuids" type: Literal["entity_get_all_child_uuids"] = "entity_get_all_child_uuids"
class edit_mode_enter(BaseModel): class edit_mode_enter(BaseModel):
"""Enter edit mode""" """Enter edit mode"""
target: UUID target: str
type: str = "edit_mode_enter" type: Literal["edit_mode_enter"] = "edit_mode_enter"
class edit_mode_exit(BaseModel): class edit_mode_exit(BaseModel):
"""Exit edit mode""" """Exit edit mode"""
type: str = "edit_mode_exit" type: Literal["edit_mode_exit"] = "edit_mode_exit"
class select_with_point(BaseModel): class select_with_point(BaseModel):
@ -223,43 +227,43 @@ class select_with_point(BaseModel):
selection_type: SceneSelectionType selection_type: SceneSelectionType
type: str = "select_with_point" type: Literal["select_with_point"] = "select_with_point"
class select_clear(BaseModel): class select_clear(BaseModel):
"""Clear the selection""" """Clear the selection"""
type: str = "select_clear" type: Literal["select_clear"] = "select_clear"
class select_add(BaseModel): class select_add(BaseModel):
"""Adds one or more entities (by UUID) to the selection.""" """Adds one or more entities (by UUID) to the selection."""
entities: List[UUID] entities: List[str]
type: str = "select_add" type: Literal["select_add"] = "select_add"
class select_remove(BaseModel): class select_remove(BaseModel):
"""Removes one or more entities (by UUID) from the selection.""" """Removes one or more entities (by UUID) from the selection."""
entities: List[UUID] entities: List[str]
type: str = "select_remove" type: Literal["select_remove"] = "select_remove"
class select_replace(BaseModel): class select_replace(BaseModel):
"""Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd.""" """Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd."""
entities: List[UUID] entities: List[str]
type: str = "select_replace" type: Literal["select_replace"] = "select_replace"
class select_get(BaseModel): class select_get(BaseModel):
"""Find all IDs of selected entities""" """Find all IDs of selected entities"""
type: str = "select_get" type: Literal["select_get"] = "select_get"
class highlight_set_entity(BaseModel): class highlight_set_entity(BaseModel):
@ -269,15 +273,15 @@ class highlight_set_entity(BaseModel):
sequence: Optional[int] = None sequence: Optional[int] = None
type: str = "highlight_set_entity" type: Literal["highlight_set_entity"] = "highlight_set_entity"
class highlight_set_entities(BaseModel): class highlight_set_entities(BaseModel):
"""Changes the current highlighted entity to these entities.""" """Changes the current highlighted entity to these entities."""
entities: List[UUID] entities: List[str]
type: str = "highlight_set_entities" type: Literal["highlight_set_entities"] = "highlight_set_entities"
class new_annotation(BaseModel): class new_annotation(BaseModel):
@ -289,17 +293,17 @@ class new_annotation(BaseModel):
options: AnnotationOptions options: AnnotationOptions
type: str = "new_annotation" type: Literal["new_annotation"] = "new_annotation"
class update_annotation(BaseModel): class update_annotation(BaseModel):
"""Update an annotation""" """Update an annotation"""
annotation_id: UUID annotation_id: str
options: AnnotationOptions options: AnnotationOptions
type: str = "update_annotation" type: Literal["update_annotation"] = "update_annotation"
class object_visible(BaseModel): class object_visible(BaseModel):
@ -307,45 +311,45 @@ class object_visible(BaseModel):
hidden: bool hidden: bool
object_id: UUID object_id: str
type: str = "object_visible" type: Literal["object_visible"] = "object_visible"
class object_bring_to_front(BaseModel): class object_bring_to_front(BaseModel):
"""Bring an object to the front of the scene""" """Bring an object to the front of the scene"""
object_id: UUID object_id: str
type: str = "object_bring_to_front" type: Literal["object_bring_to_front"] = "object_bring_to_front"
class get_entity_type(BaseModel): class get_entity_type(BaseModel):
"""What type of entity is this?""" """What type of entity is this?"""
entity_id: UUID entity_id: str
type: str = "get_entity_type" type: Literal["get_entity_type"] = "get_entity_type"
class solid2d_add_hole(BaseModel): class solid2d_add_hole(BaseModel):
"""Add a hole to a Solid2d object before extruding it.""" """Add a hole to a Solid2d object before extruding it."""
hole_id: UUID hole_id: str
object_id: UUID object_id: str
type: str = "solid2d_add_hole" type: Literal["solid2d_add_hole"] = "solid2d_add_hole"
class solid3d_get_all_edge_faces(BaseModel): class solid3d_get_all_edge_faces(BaseModel):
"""Gets all faces which use the given edge.""" """Gets all faces which use the given edge."""
edge_id: UUID edge_id: str
object_id: UUID object_id: str
type: str = "solid3d_get_all_edge_faces" type: Literal["solid3d_get_all_edge_faces"] = "solid3d_get_all_edge_faces"
class solid3d_get_all_opposite_edges(BaseModel): class solid3d_get_all_opposite_edges(BaseModel):
@ -353,47 +357,47 @@ class solid3d_get_all_opposite_edges(BaseModel):
along_vector: Optional[Point3d] = None along_vector: Optional[Point3d] = None
edge_id: UUID edge_id: str
object_id: UUID object_id: str
type: str = "solid3d_get_all_opposite_edges" type: Literal["solid3d_get_all_opposite_edges"] = "solid3d_get_all_opposite_edges"
class solid3d_get_opposite_edge(BaseModel): class solid3d_get_opposite_edge(BaseModel):
"""Gets the edge opposite the given edge, along the given face.""" """Gets the edge opposite the given edge, along the given face."""
edge_id: UUID edge_id: str
face_id: UUID face_id: str
object_id: UUID object_id: str
type: str = "solid3d_get_opposite_edge" type: Literal["solid3d_get_opposite_edge"] = "solid3d_get_opposite_edge"
class solid3d_get_next_adjacent_edge(BaseModel): class solid3d_get_next_adjacent_edge(BaseModel):
"""Gets the next adjacent edge for the given edge, along the given face.""" """Gets the next adjacent edge for the given edge, along the given face."""
edge_id: UUID edge_id: str
face_id: UUID face_id: str
object_id: UUID object_id: str
type: str = "solid3d_get_next_adjacent_edge" type: Literal["solid3d_get_next_adjacent_edge"] = "solid3d_get_next_adjacent_edge"
class solid3d_get_prev_adjacent_edge(BaseModel): class solid3d_get_prev_adjacent_edge(BaseModel):
"""Gets the previous adjacent edge for the given edge, along the given face.""" """Gets the previous adjacent edge for the given edge, along the given face."""
edge_id: UUID edge_id: str
face_id: UUID face_id: str
object_id: UUID object_id: str
type: str = "solid3d_get_prev_adjacent_edge" type: Literal["solid3d_get_prev_adjacent_edge"] = "solid3d_get_prev_adjacent_edge"
class send_object(BaseModel): class send_object(BaseModel):
@ -401,19 +405,19 @@ class send_object(BaseModel):
front: bool front: bool
object_id: UUID object_id: str
type: str = "send_object" type: Literal["send_object"] = "send_object"
class entity_set_opacity(BaseModel): class entity_set_opacity(BaseModel):
"""Set opacity of the entity.""" """Set opacity of the entity."""
entity_id: UUID entity_id: str
opacity: float opacity: float
type: str = "entity_set_opacity" type: Literal["entity_set_opacity"] = "entity_set_opacity"
class entity_fade(BaseModel): class entity_fade(BaseModel):
@ -421,11 +425,11 @@ class entity_fade(BaseModel):
duration_seconds: Optional[float] = None duration_seconds: Optional[float] = None
entity_id: UUID entity_id: str
fade_in: bool fade_in: bool
type: str = "entity_fade" type: Literal["entity_fade"] = "entity_fade"
class make_plane(BaseModel): class make_plane(BaseModel):
@ -439,7 +443,7 @@ class make_plane(BaseModel):
size: float size: float
type: str = "make_plane" type: Literal["make_plane"] = "make_plane"
x_axis: Point3d x_axis: Point3d
@ -451,9 +455,9 @@ class plane_set_color(BaseModel):
color: Color color: Color
plane_id: UUID plane_id: str
type: str = "plane_set_color" type: Literal["plane_set_color"] = "plane_set_color"
class set_tool(BaseModel): class set_tool(BaseModel):
@ -461,7 +465,7 @@ class set_tool(BaseModel):
tool: SceneToolType tool: SceneToolType
type: str = "set_tool" type: Literal["set_tool"] = "set_tool"
class mouse_move(BaseModel): class mouse_move(BaseModel):
@ -469,7 +473,7 @@ class mouse_move(BaseModel):
sequence: Optional[int] = None sequence: Optional[int] = None
type: str = "mouse_move" type: Literal["mouse_move"] = "mouse_move"
window: Point2d window: Point2d
@ -477,7 +481,7 @@ class mouse_move(BaseModel):
class mouse_click(BaseModel): class mouse_click(BaseModel):
"""Send a mouse click event. Updates modified/selected entities.""" """Send a mouse click event. Updates modified/selected entities."""
type: str = "mouse_click" type: Literal["mouse_click"] = "mouse_click"
window: Point2d window: Point2d
@ -491,31 +495,31 @@ class sketch_mode_enable(BaseModel):
ortho: bool ortho: bool
plane_id: UUID plane_id: str
type: str = "sketch_mode_enable" type: Literal["sketch_mode_enable"] = "sketch_mode_enable"
class sketch_mode_disable(BaseModel): class sketch_mode_disable(BaseModel):
"""Disable sketch mode.""" """Disable sketch mode."""
type: str = "sketch_mode_disable" type: Literal["sketch_mode_disable"] = "sketch_mode_disable"
class curve_get_type(BaseModel): class curve_get_type(BaseModel):
"""Get type of a given curve.""" """Get type of a given curve."""
curve_id: UUID curve_id: str
type: str = "curve_get_type" type: Literal["curve_get_type"] = "curve_get_type"
class curve_get_control_points(BaseModel): class curve_get_control_points(BaseModel):
"""Get control points of a given curve.""" """Get control points of a given curve."""
curve_id: UUID curve_id: str
type: str = "curve_get_control_points" type: Literal["curve_get_control_points"] = "curve_get_control_points"
class take_snapshot(BaseModel): class take_snapshot(BaseModel):
@ -523,7 +527,7 @@ class take_snapshot(BaseModel):
format: ImageFormat format: ImageFormat
type: str = "take_snapshot" type: Literal["take_snapshot"] = "take_snapshot"
class make_axes_gizmo(BaseModel): class make_axes_gizmo(BaseModel):
@ -533,39 +537,41 @@ class make_axes_gizmo(BaseModel):
gizmo_mode: bool gizmo_mode: bool
type: str = "make_axes_gizmo" type: Literal["make_axes_gizmo"] = "make_axes_gizmo"
class path_get_info(BaseModel): class path_get_info(BaseModel):
"""Query the given path""" """Query the given path"""
path_id: UUID path_id: str
type: str = "path_get_info" type: Literal["path_get_info"] = "path_get_info"
class path_get_curve_uuids_for_vertices(BaseModel): class path_get_curve_uuids_for_vertices(BaseModel):
"""Get curves for vertices within a path""" """Get curves for vertices within a path"""
path_id: UUID path_id: str
type: str = "path_get_curve_uuids_for_vertices" type: Literal[
"path_get_curve_uuids_for_vertices"
] = "path_get_curve_uuids_for_vertices"
vertex_ids: List[UUID] vertex_ids: List[str]
class path_get_vertex_uuids(BaseModel): class path_get_vertex_uuids(BaseModel):
"""Get vertices within a path""" """Get vertices within a path"""
path_id: UUID path_id: str
type: str = "path_get_vertex_uuids" type: Literal["path_get_vertex_uuids"] = "path_get_vertex_uuids"
class handle_mouse_drag_start(BaseModel): class handle_mouse_drag_start(BaseModel):
"""Start dragging mouse.""" """Start dragging mouse."""
type: str = "handle_mouse_drag_start" type: Literal["handle_mouse_drag_start"] = "handle_mouse_drag_start"
window: Point2d window: Point2d
@ -575,7 +581,7 @@ class handle_mouse_drag_move(BaseModel):
sequence: Optional[int] = None sequence: Optional[int] = None
type: str = "handle_mouse_drag_move" type: Literal["handle_mouse_drag_move"] = "handle_mouse_drag_move"
window: Point2d window: Point2d
@ -583,7 +589,7 @@ class handle_mouse_drag_move(BaseModel):
class handle_mouse_drag_end(BaseModel): class handle_mouse_drag_end(BaseModel):
"""Stop dragging mouse.""" """Stop dragging mouse."""
type: str = "handle_mouse_drag_end" type: Literal["handle_mouse_drag_end"] = "handle_mouse_drag_end"
window: Point2d window: Point2d
@ -591,17 +597,17 @@ class handle_mouse_drag_end(BaseModel):
class remove_scene_objects(BaseModel): class remove_scene_objects(BaseModel):
"""Remove scene objects.""" """Remove scene objects."""
object_ids: List[UUID] object_ids: List[str]
type: str = "remove_scene_objects" type: Literal["remove_scene_objects"] = "remove_scene_objects"
class plane_intersect_and_project(BaseModel): class plane_intersect_and_project(BaseModel):
"""Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates.""" """Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates."""
plane_id: UUID plane_id: str
type: str = "plane_intersect_and_project" type: Literal["plane_intersect_and_project"] = "plane_intersect_and_project"
window: Point2d window: Point2d
@ -609,9 +615,9 @@ class plane_intersect_and_project(BaseModel):
class curve_get_end_points(BaseModel): class curve_get_end_points(BaseModel):
"""Find the start and end of a curve.""" """Find the start and end of a curve."""
curve_id: UUID curve_id: str
type: str = "curve_get_end_points" type: Literal["curve_get_end_points"] = "curve_get_end_points"
class reconfigure_stream(BaseModel): class reconfigure_stream(BaseModel):
@ -621,7 +627,7 @@ class reconfigure_stream(BaseModel):
height: int height: int
type: str = "reconfigure_stream" type: Literal["reconfigure_stream"] = "reconfigure_stream"
width: int width: int
@ -633,13 +639,13 @@ class import_files(BaseModel):
format: InputFormat format: InputFormat
type: str = "import_files" type: Literal["import_files"] = "import_files"
class mass(BaseModel): class mass(BaseModel):
"""Get the mass of entities in the scene or the default scene.""" """Get the mass of entities in the scene or the default scene."""
entity_ids: List[UUID] entity_ids: List[str]
material_density: float material_density: float
@ -649,13 +655,13 @@ class mass(BaseModel):
source_unit: UnitLength source_unit: UnitLength
type: str = "mass" type: Literal["mass"] = "mass"
class density(BaseModel): class density(BaseModel):
"""Get the density of entities in the scene or the default scene.""" """Get the density of entities in the scene or the default scene."""
entity_ids: List[UUID] entity_ids: List[str]
material_mass: float material_mass: float
@ -665,49 +671,49 @@ class density(BaseModel):
source_unit: UnitLength source_unit: UnitLength
type: str = "density" type: Literal["density"] = "density"
class volume(BaseModel): class volume(BaseModel):
"""Get the volume of entities in the scene or the default scene.""" """Get the volume of entities in the scene or the default scene."""
entity_ids: List[UUID] entity_ids: List[str]
output_unit: UnitVolume output_unit: UnitVolume
source_unit: UnitLength source_unit: UnitLength
type: str = "volume" type: Literal["volume"] = "volume"
class center_of_mass(BaseModel): class center_of_mass(BaseModel):
"""Get the center of mass of entities in the scene or the default scene.""" """Get the center of mass of entities in the scene or the default scene."""
entity_ids: List[UUID] entity_ids: List[str]
output_unit: UnitLength output_unit: UnitLength
source_unit: UnitLength source_unit: UnitLength
type: str = "center_of_mass" type: Literal["center_of_mass"] = "center_of_mass"
class surface_area(BaseModel): class surface_area(BaseModel):
"""Get the surface area of entities in the scene or the default scene.""" """Get the surface area of entities in the scene or the default scene."""
entity_ids: List[UUID] entity_ids: List[str]
output_unit: UnitArea output_unit: UnitArea
source_unit: UnitLength source_unit: UnitLength
type: str = "surface_area" type: Literal["surface_area"] = "surface_area"
class get_sketch_mode_plane(BaseModel): class get_sketch_mode_plane(BaseModel):
"""Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane.""" """Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane."""
type: str = "get_sketch_mode_plane" type: Literal["get_sketch_mode_plane"] = "get_sketch_mode_plane"
class curve_set_constraint(BaseModel): class curve_set_constraint(BaseModel):
@ -717,12 +723,13 @@ class curve_set_constraint(BaseModel):
constraint_type: PathComponentConstraintType constraint_type: PathComponentConstraintType
object_id: UUID object_id: str
type: str = "curve_set_constraint" type: Literal["curve_set_constraint"] = "curve_set_constraint"
ModelingCmd = RootModel[ ModelingCmd = RootModel[
Annotated[
Union[ Union[
start_path, start_path,
move_path_pen, move_path_pen,
@ -795,5 +802,7 @@ ModelingCmd = RootModel[
surface_area, surface_area,
get_sketch_mode_plane, get_sketch_mode_plane,
curve_set_constraint, curve_set_constraint,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,6 +7,6 @@ from pydantic import BaseModel
class MouseClick(BaseModel): class MouseClick(BaseModel):
"""The response from the `MouseClick` command.""" """The response from the `MouseClick` command."""
entities_modified: List[UUID] entities_modified: List[str]
entities_selected: List[UUID] entities_selected: List[str]

View File

@ -1,6 +1,7 @@
from typing import Union from typing import Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.center_of_mass import CenterOfMass from ..models.center_of_mass import CenterOfMass
from ..models.curve_get_control_points import CurveGetControlPoints from ..models.curve_get_control_points import CurveGetControlPoints
@ -37,7 +38,7 @@ from ..models.volume import Volume
class empty(BaseModel): class empty(BaseModel):
"""An empty response, used for any command that does not explicitly have a response defined here.""" """An empty response, used for any command that does not explicitly have a response defined here."""
type: str = "empty" type: Literal["empty"] = "empty"
class export(BaseModel): class export(BaseModel):
@ -45,7 +46,7 @@ class export(BaseModel):
data: Export data: Export
type: str = "export" type: Literal["export"] = "export"
class select_with_point(BaseModel): class select_with_point(BaseModel):
@ -53,7 +54,7 @@ class select_with_point(BaseModel):
data: SelectWithPoint data: SelectWithPoint
type: str = "select_with_point" type: Literal["select_with_point"] = "select_with_point"
class highlight_set_entity(BaseModel): class highlight_set_entity(BaseModel):
@ -61,7 +62,7 @@ class highlight_set_entity(BaseModel):
data: HighlightSetEntity data: HighlightSetEntity
type: str = "highlight_set_entity" type: Literal["highlight_set_entity"] = "highlight_set_entity"
class entity_get_child_uuid(BaseModel): class entity_get_child_uuid(BaseModel):
@ -69,7 +70,7 @@ class entity_get_child_uuid(BaseModel):
data: EntityGetChildUuid data: EntityGetChildUuid
type: str = "entity_get_child_uuid" type: Literal["entity_get_child_uuid"] = "entity_get_child_uuid"
class entity_get_num_children(BaseModel): class entity_get_num_children(BaseModel):
@ -77,7 +78,7 @@ class entity_get_num_children(BaseModel):
data: EntityGetNumChildren data: EntityGetNumChildren
type: str = "entity_get_num_children" type: Literal["entity_get_num_children"] = "entity_get_num_children"
class entity_get_parent_id(BaseModel): class entity_get_parent_id(BaseModel):
@ -85,7 +86,7 @@ class entity_get_parent_id(BaseModel):
data: EntityGetParentId data: EntityGetParentId
type: str = "entity_get_parent_id" type: Literal["entity_get_parent_id"] = "entity_get_parent_id"
class entity_get_all_child_uuids(BaseModel): class entity_get_all_child_uuids(BaseModel):
@ -93,7 +94,7 @@ class entity_get_all_child_uuids(BaseModel):
data: EntityGetAllChildUuids data: EntityGetAllChildUuids
type: str = "entity_get_all_child_uuids" type: Literal["entity_get_all_child_uuids"] = "entity_get_all_child_uuids"
class select_get(BaseModel): class select_get(BaseModel):
@ -101,7 +102,7 @@ class select_get(BaseModel):
data: SelectGet data: SelectGet
type: str = "select_get" type: Literal["select_get"] = "select_get"
class get_entity_type(BaseModel): class get_entity_type(BaseModel):
@ -109,7 +110,7 @@ class get_entity_type(BaseModel):
data: GetEntityType data: GetEntityType
type: str = "get_entity_type" type: Literal["get_entity_type"] = "get_entity_type"
class solid3d_get_all_edge_faces(BaseModel): class solid3d_get_all_edge_faces(BaseModel):
@ -117,7 +118,7 @@ class solid3d_get_all_edge_faces(BaseModel):
data: Solid3dGetAllEdgeFaces data: Solid3dGetAllEdgeFaces
type: str = "solid3d_get_all_edge_faces" type: Literal["solid3d_get_all_edge_faces"] = "solid3d_get_all_edge_faces"
class solid3d_get_all_opposite_edges(BaseModel): class solid3d_get_all_opposite_edges(BaseModel):
@ -125,7 +126,7 @@ class solid3d_get_all_opposite_edges(BaseModel):
data: Solid3dGetAllOppositeEdges data: Solid3dGetAllOppositeEdges
type: str = "solid3d_get_all_opposite_edges" type: Literal["solid3d_get_all_opposite_edges"] = "solid3d_get_all_opposite_edges"
class solid3d_get_opposite_edge(BaseModel): class solid3d_get_opposite_edge(BaseModel):
@ -133,7 +134,7 @@ class solid3d_get_opposite_edge(BaseModel):
data: Solid3dGetOppositeEdge data: Solid3dGetOppositeEdge
type: str = "solid3d_get_opposite_edge" type: Literal["solid3d_get_opposite_edge"] = "solid3d_get_opposite_edge"
class solid3d_get_prev_adjacent_edge(BaseModel): class solid3d_get_prev_adjacent_edge(BaseModel):
@ -141,7 +142,7 @@ class solid3d_get_prev_adjacent_edge(BaseModel):
data: Solid3dGetPrevAdjacentEdge data: Solid3dGetPrevAdjacentEdge
type: str = "solid3d_get_prev_adjacent_edge" type: Literal["solid3d_get_prev_adjacent_edge"] = "solid3d_get_prev_adjacent_edge"
class solid3d_get_next_adjacent_edge(BaseModel): class solid3d_get_next_adjacent_edge(BaseModel):
@ -149,7 +150,7 @@ class solid3d_get_next_adjacent_edge(BaseModel):
data: Solid3dGetNextAdjacentEdge data: Solid3dGetNextAdjacentEdge
type: str = "solid3d_get_next_adjacent_edge" type: Literal["solid3d_get_next_adjacent_edge"] = "solid3d_get_next_adjacent_edge"
class mouse_click(BaseModel): class mouse_click(BaseModel):
@ -157,7 +158,7 @@ class mouse_click(BaseModel):
data: MouseClick data: MouseClick
type: str = "mouse_click" type: Literal["mouse_click"] = "mouse_click"
class curve_get_type(BaseModel): class curve_get_type(BaseModel):
@ -165,7 +166,7 @@ class curve_get_type(BaseModel):
data: CurveGetType data: CurveGetType
type: str = "curve_get_type" type: Literal["curve_get_type"] = "curve_get_type"
class curve_get_control_points(BaseModel): class curve_get_control_points(BaseModel):
@ -173,7 +174,7 @@ class curve_get_control_points(BaseModel):
data: CurveGetControlPoints data: CurveGetControlPoints
type: str = "curve_get_control_points" type: Literal["curve_get_control_points"] = "curve_get_control_points"
class take_snapshot(BaseModel): class take_snapshot(BaseModel):
@ -181,7 +182,7 @@ class take_snapshot(BaseModel):
data: TakeSnapshot data: TakeSnapshot
type: str = "take_snapshot" type: Literal["take_snapshot"] = "take_snapshot"
class path_get_info(BaseModel): class path_get_info(BaseModel):
@ -189,7 +190,7 @@ class path_get_info(BaseModel):
data: PathGetInfo data: PathGetInfo
type: str = "path_get_info" type: Literal["path_get_info"] = "path_get_info"
class path_get_curve_uuids_for_vertices(BaseModel): class path_get_curve_uuids_for_vertices(BaseModel):
@ -197,7 +198,9 @@ class path_get_curve_uuids_for_vertices(BaseModel):
data: PathGetCurveUuidsForVertices data: PathGetCurveUuidsForVertices
type: str = "path_get_curve_uuids_for_vertices" type: Literal[
"path_get_curve_uuids_for_vertices"
] = "path_get_curve_uuids_for_vertices"
class path_get_vertex_uuids(BaseModel): class path_get_vertex_uuids(BaseModel):
@ -205,7 +208,7 @@ class path_get_vertex_uuids(BaseModel):
data: PathGetVertexUuids data: PathGetVertexUuids
type: str = "path_get_vertex_uuids" type: Literal["path_get_vertex_uuids"] = "path_get_vertex_uuids"
class plane_intersect_and_project(BaseModel): class plane_intersect_and_project(BaseModel):
@ -213,7 +216,7 @@ class plane_intersect_and_project(BaseModel):
data: PlaneIntersectAndProject data: PlaneIntersectAndProject
type: str = "plane_intersect_and_project" type: Literal["plane_intersect_and_project"] = "plane_intersect_and_project"
class curve_get_end_points(BaseModel): class curve_get_end_points(BaseModel):
@ -221,7 +224,7 @@ class curve_get_end_points(BaseModel):
data: CurveGetEndPoints data: CurveGetEndPoints
type: str = "curve_get_end_points" type: Literal["curve_get_end_points"] = "curve_get_end_points"
class import_files(BaseModel): class import_files(BaseModel):
@ -229,7 +232,7 @@ class import_files(BaseModel):
data: ImportFiles data: ImportFiles
type: str = "import_files" type: Literal["import_files"] = "import_files"
class mass(BaseModel): class mass(BaseModel):
@ -237,7 +240,7 @@ class mass(BaseModel):
data: Mass data: Mass
type: str = "mass" type: Literal["mass"] = "mass"
class volume(BaseModel): class volume(BaseModel):
@ -245,7 +248,7 @@ class volume(BaseModel):
data: Volume data: Volume
type: str = "volume" type: Literal["volume"] = "volume"
class density(BaseModel): class density(BaseModel):
@ -253,7 +256,7 @@ class density(BaseModel):
data: Density data: Density
type: str = "density" type: Literal["density"] = "density"
class surface_area(BaseModel): class surface_area(BaseModel):
@ -261,7 +264,7 @@ class surface_area(BaseModel):
data: SurfaceArea data: SurfaceArea
type: str = "surface_area" type: Literal["surface_area"] = "surface_area"
class center_of_mass(BaseModel): class center_of_mass(BaseModel):
@ -269,7 +272,7 @@ class center_of_mass(BaseModel):
data: CenterOfMass data: CenterOfMass
type: str = "center_of_mass" type: Literal["center_of_mass"] = "center_of_mass"
class get_sketch_mode_plane(BaseModel): class get_sketch_mode_plane(BaseModel):
@ -277,10 +280,11 @@ class get_sketch_mode_plane(BaseModel):
data: GetSketchModePlane data: GetSketchModePlane
type: str = "get_sketch_mode_plane" type: Literal["get_sketch_mode_plane"] = "get_sketch_mode_plane"
OkModelingCmdResponse = RootModel[ OkModelingCmdResponse = RootModel[
Annotated[
Union[ Union[
empty, empty,
export, export,
@ -313,5 +317,7 @@ OkModelingCmdResponse = RootModel[
surface_area, surface_area,
center_of_mass, center_of_mass,
get_sketch_mode_plane, get_sketch_mode_plane,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,6 +1,7 @@
from typing import List, Union from typing import List, Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.ice_server import IceServer from ..models.ice_server import IceServer
from ..models.ok_modeling_cmd_response import OkModelingCmdResponse from ..models.ok_modeling_cmd_response import OkModelingCmdResponse
@ -20,7 +21,7 @@ class ice_server_info(BaseModel):
data: IceServerInfoData data: IceServerInfoData
type: str = "ice_server_info" type: Literal["ice_server_info"] = "ice_server_info"
class TrickleIceData(BaseModel): class TrickleIceData(BaseModel):
@ -34,7 +35,7 @@ class trickle_ice(BaseModel):
data: TrickleIceData data: TrickleIceData
type: str = "trickle_ice" type: Literal["trickle_ice"] = "trickle_ice"
class SdpAnswerData(BaseModel): class SdpAnswerData(BaseModel):
@ -48,7 +49,7 @@ class sdp_answer(BaseModel):
data: SdpAnswerData data: SdpAnswerData
type: str = "sdp_answer" type: Literal["sdp_answer"] = "sdp_answer"
class ModelingData(BaseModel): class ModelingData(BaseModel):
@ -62,7 +63,7 @@ class modeling(BaseModel):
data: ModelingData data: ModelingData
type: str = "modeling" type: Literal["modeling"] = "modeling"
class ExportData(BaseModel): class ExportData(BaseModel):
@ -76,7 +77,7 @@ class export(BaseModel):
data: ExportData data: ExportData
type: str = "export" type: Literal["export"] = "export"
class MetricsRequestData(BaseModel): class MetricsRequestData(BaseModel):
@ -88,10 +89,11 @@ class metrics_request(BaseModel):
data: MetricsRequestData data: MetricsRequestData
type: str = "metrics_request" type: Literal["metrics_request"] = "metrics_request"
OkWebSocketResponseData = RootModel[ OkWebSocketResponseData = RootModel[
Annotated[
Union[ Union[
ice_server_info, ice_server_info,
trickle_ice, trickle_ice,
@ -99,5 +101,7 @@ OkWebSocketResponseData = RootModel[
modeling, modeling,
export, export,
metrics_request, metrics_request,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,6 +1,7 @@
from typing import Union from typing import Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.fbx_storage import FbxStorage from ..models.fbx_storage import FbxStorage
from ..models.gltf_presentation import GltfPresentation from ..models.gltf_presentation import GltfPresentation
@ -17,7 +18,7 @@ class fbx(BaseModel):
storage: FbxStorage storage: FbxStorage
type: str = "fbx" type: Literal["fbx"] = "fbx"
class gltf(BaseModel): class gltf(BaseModel):
@ -27,7 +28,7 @@ class gltf(BaseModel):
storage: GltfStorage storage: GltfStorage
type: str = "gltf" type: Literal["gltf"] = "gltf"
class obj(BaseModel): class obj(BaseModel):
@ -35,7 +36,7 @@ class obj(BaseModel):
coords: System coords: System
type: str = "obj" type: Literal["obj"] = "obj"
units: UnitLength units: UnitLength
@ -49,7 +50,7 @@ class ply(BaseModel):
storage: PlyStorage storage: PlyStorage
type: str = "ply" type: Literal["ply"] = "ply"
units: UnitLength units: UnitLength
@ -59,7 +60,7 @@ class step(BaseModel):
coords: System coords: System
type: str = "step" type: Literal["step"] = "step"
class stl(BaseModel): class stl(BaseModel):
@ -71,12 +72,13 @@ class stl(BaseModel):
storage: StlStorage storage: StlStorage
type: str = "stl" type: Literal["stl"] = "stl"
units: UnitLength units: UnitLength
OutputFormat = RootModel[ OutputFormat = RootModel[
Annotated[
Union[ Union[
fbx, fbx,
gltf, gltf,
@ -84,5 +86,7 @@ OutputFormat = RootModel[
ply, ply,
step, step,
stl, stl,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class PathGetCurveUuidsForVertices(BaseModel): class PathGetCurveUuidsForVertices(BaseModel):
"""The response from the `PathGetCurveUuidsForVertices` command.""" """The response from the `PathGetCurveUuidsForVertices` command."""
curve_ids: List[UUID] curve_ids: List[str]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class PathGetVertexUuids(BaseModel): class PathGetVertexUuids(BaseModel):
"""The response from the `PathGetVertexUuids` command.""" """The response from the `PathGetVertexUuids` command."""
vertex_ids: List[UUID] vertex_ids: List[str]

View File

@ -1,6 +1,7 @@
from typing import Optional, Union from typing import Literal, Optional, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.angle import Angle from ..models.angle import Angle
from ..models.point2d import Point2d from ..models.point2d import Point2d
@ -14,7 +15,7 @@ class line(BaseModel):
relative: bool relative: bool
type: str = "line" type: Literal["line"] = "line"
class arc(BaseModel): class arc(BaseModel):
@ -34,7 +35,7 @@ class arc(BaseModel):
start: Optional[Angle] = None start: Optional[Angle] = None
type: str = "arc" type: Literal["arc"] = "arc"
class bezier(BaseModel): class bezier(BaseModel):
@ -48,7 +49,7 @@ class bezier(BaseModel):
relative: bool relative: bool
type: str = "bezier" type: Literal["bezier"] = "bezier"
class tangential_arc(BaseModel): class tangential_arc(BaseModel):
@ -58,7 +59,7 @@ class tangential_arc(BaseModel):
radius: float radius: float
type: str = "tangential_arc" type: Literal["tangential_arc"] = "tangential_arc"
class tangential_arc_to(BaseModel): class tangential_arc_to(BaseModel):
@ -68,15 +69,18 @@ class tangential_arc_to(BaseModel):
to: Point3d to: Point3d
type: str = "tangential_arc_to" type: Literal["tangential_arc_to"] = "tangential_arc_to"
PathSegment = RootModel[ PathSegment = RootModel[
Annotated[
Union[ Union[
line, line,
arc, arc,
bezier, bezier,
tangential_arc, tangential_arc,
tangential_arc_to, tangential_arc_to,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class SelectGet(BaseModel): class SelectGet(BaseModel):
"""The response from the `SelectGet` command.""" """The response from the `SelectGet` command."""
entity_ids: List[UUID] entity_ids: List[str]

View File

@ -1,5 +1,4 @@
from typing import Optional from typing import Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class SelectWithPoint(BaseModel): class SelectWithPoint(BaseModel):
"""The response from the `SelectWithPoint` command.""" """The response from the `SelectWithPoint` command."""
entity_id: Optional[UUID] = None entity_id: Optional[str] = None

View File

@ -1,13 +1,14 @@
from typing import Union from typing import Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
class default_scene(BaseModel): class default_scene(BaseModel):
"""Visit the default scene.""" """Visit the default scene."""
type: str = "default_scene" type: Literal["default_scene"] = "default_scene"
class scene_by_index(BaseModel): class scene_by_index(BaseModel):
@ -15,7 +16,7 @@ class scene_by_index(BaseModel):
index: int index: int
type: str = "scene_by_index" type: Literal["scene_by_index"] = "scene_by_index"
class scene_by_name(BaseModel): class scene_by_name(BaseModel):
@ -23,7 +24,7 @@ class scene_by_name(BaseModel):
name: str name: str
type: str = "scene_by_name" type: Literal["scene_by_name"] = "scene_by_name"
class mesh_by_index(BaseModel): class mesh_by_index(BaseModel):
@ -31,7 +32,7 @@ class mesh_by_index(BaseModel):
index: int index: int
type: str = "mesh_by_index" type: Literal["mesh_by_index"] = "mesh_by_index"
class mesh_by_name(BaseModel): class mesh_by_name(BaseModel):
@ -39,15 +40,18 @@ class mesh_by_name(BaseModel):
name: str name: str
type: str = "mesh_by_name" type: Literal["mesh_by_name"] = "mesh_by_name"
Selection = RootModel[ Selection = RootModel[
Annotated[
Union[ Union[
default_scene, default_scene,
scene_by_index, scene_by_index,
scene_by_name, scene_by_name,
mesh_by_index, mesh_by_index,
mesh_by_name, mesh_by_name,
],
Field(discriminator="type"),
] ]
] ]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class Solid3dGetAllEdgeFaces(BaseModel): class Solid3dGetAllEdgeFaces(BaseModel):
"""The response from the `Solid3dGetAllEdgeFaces` command.""" """The response from the `Solid3dGetAllEdgeFaces` command."""
faces: List[UUID] faces: List[str]

View File

@ -1,5 +1,4 @@
from typing import List from typing import List
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class Solid3dGetAllOppositeEdges(BaseModel): class Solid3dGetAllOppositeEdges(BaseModel):
"""The response from the `Solid3dGetAllOppositeEdges` command.""" """The response from the `Solid3dGetAllOppositeEdges` command."""
edges: List[UUID] edges: List[str]

View File

@ -1,5 +1,4 @@
from typing import Optional from typing import Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class Solid3dGetNextAdjacentEdge(BaseModel): class Solid3dGetNextAdjacentEdge(BaseModel):
"""The response from the `Solid3dGetNextAdjacentEdge` command.""" """The response from the `Solid3dGetNextAdjacentEdge` command."""
edge: Optional[UUID] = None edge: Optional[str] = None

View File

@ -1,4 +1,3 @@
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -7,4 +6,4 @@ from pydantic import BaseModel
class Solid3dGetOppositeEdge(BaseModel): class Solid3dGetOppositeEdge(BaseModel):
"""The response from the `Solid3dGetOppositeEdge` command.""" """The response from the `Solid3dGetOppositeEdge` command."""
edge: UUID edge: str

View File

@ -1,5 +1,4 @@
from typing import Optional from typing import Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -8,4 +7,4 @@ from pydantic import BaseModel
class Solid3dGetPrevAdjacentEdge(BaseModel): class Solid3dGetPrevAdjacentEdge(BaseModel):
"""The response from the `Solid3dGetPrevAdjacentEdge` command.""" """The response from the `Solid3dGetPrevAdjacentEdge` command."""
edge: Optional[UUID] = None edge: Optional[str] = None

View File

@ -1,5 +1,4 @@
from typing import Optional from typing import Optional
from uuid import UUID
from pydantic import BaseModel from pydantic import BaseModel
@ -9,7 +8,7 @@ from ..models.ok_web_socket_response_data import OkWebSocketResponseData
class SuccessWebSocketResponse(BaseModel): class SuccessWebSocketResponse(BaseModel):
"""Successful Websocket response.""" """Successful Websocket response."""
request_id: Optional[UUID] = None request_id: Optional[str] = None
resp: OkWebSocketResponseData resp: OkWebSocketResponseData

View File

@ -1,6 +1,7 @@
from typing import List, Union from typing import List, Literal, Union
from pydantic import BaseModel, RootModel from pydantic import BaseModel, Field, RootModel
from typing_extensions import Annotated
from ..models.client_metrics import ClientMetrics from ..models.client_metrics import ClientMetrics
from ..models.modeling_cmd import ModelingCmd from ..models.modeling_cmd import ModelingCmd
@ -15,7 +16,7 @@ class trickle_ice(BaseModel):
candidate: RtcIceCandidateInit candidate: RtcIceCandidateInit
type: str = "trickle_ice" type: Literal["trickle_ice"] = "trickle_ice"
class sdp_offer(BaseModel): class sdp_offer(BaseModel):
@ -23,7 +24,7 @@ class sdp_offer(BaseModel):
offer: RtcSessionDescription offer: RtcSessionDescription
type: str = "sdp_offer" type: Literal["sdp_offer"] = "sdp_offer"
class modeling_cmd_req(BaseModel): class modeling_cmd_req(BaseModel):
@ -33,7 +34,7 @@ class modeling_cmd_req(BaseModel):
cmd_id: ModelingCmdId cmd_id: ModelingCmdId
type: str = "modeling_cmd_req" type: Literal["modeling_cmd_req"] = "modeling_cmd_req"
class modeling_cmd_batch_req(BaseModel): class modeling_cmd_batch_req(BaseModel):
@ -41,13 +42,13 @@ class modeling_cmd_batch_req(BaseModel):
requests: List[ModelingCmdReq] requests: List[ModelingCmdReq]
type: str = "modeling_cmd_batch_req" type: Literal["modeling_cmd_batch_req"] = "modeling_cmd_batch_req"
class ping(BaseModel): class ping(BaseModel):
"""The client-to-server Ping to ensure the WebSocket stays alive.""" """The client-to-server Ping to ensure the WebSocket stays alive."""
type: str = "ping" type: Literal["ping"] = "ping"
class metrics_response(BaseModel): class metrics_response(BaseModel):
@ -55,10 +56,11 @@ class metrics_response(BaseModel):
metrics: ClientMetrics metrics: ClientMetrics
type: str = "metrics_response" type: Literal["metrics_response"] = "metrics_response"
WebSocketRequest = RootModel[ WebSocketRequest = RootModel[
Annotated[
Union[ Union[
trickle_ice, trickle_ice,
sdp_offer, sdp_offer,
@ -66,5 +68,7 @@ WebSocketRequest = RootModel[
modeling_cmd_batch_req, modeling_cmd_batch_req,
ping, ping,
metrics_response, metrics_response,
],
Field(discriminator="type"),
] ]
] ]