Compare commits

...

7 Commits

Author SHA1 Message Date
3467a5d5dd updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-29 10:41:21 -08:00
a93e30c3e8 Update api spec (#174)
YOYO NEW API SPEC!

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-29 10:37:42 -08:00
d5dbeadda3 fix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-29 10:33:22 -08:00
ed36086040 working samples
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-29 10:32:31 -08:00
9f8069decb one working
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-29 09:04:49 -08:00
faaeb3a472 pydantic
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-29 00:39:14 -08:00
bc3d698539 switch to pydantic
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2023-11-28 23:50:50 -08:00
232 changed files with 3698 additions and 25916 deletions

2
.gitignore vendored
View File

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

16
generate/float.py.jinja2 Normal file
View File

@ -0,0 +1,16 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class {{name}}(float):
"""{{description}}"""
def __float__(self) -> float:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(float))

View File

@ -93,7 +93,7 @@ def sync(
client=client,
)
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, 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,
)
return await ws_connect_async(kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"])
return await ws_connect_async(kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"], close_timeout=120, max_size=None)
{% if has_request_body %}
@ -179,20 +179,20 @@ class WebSocket:
"""
for message in self.ws:
yield {{response_type}}.from_dict(json.loads(message))
yield {{response_type}}(**json.loads(message))
def send(self, data:{% for arg in args %}{%if arg.name == "body" %}{{arg.type}}{% endif %}{% endfor %}):
"""Send data to the websocket."""
self.ws.send(json.dumps(data.to_dict()))
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 %}):
"""Send data as bson to the websocket."""
self.ws.send(bson.BSON.encode(data.to_dict()))
self.ws.send(bson.encode(data.model_dump())) # type: ignore
def recv(self) -> {{response_type}}:
"""Receive data from the websocket."""
message = self.ws.recv()
return {{response_type}}.from_dict(json.loads(message))
message = self.ws.recv(timeout=60)
return {{response_type}}(**json.loads(message))
def close(self):
"""Close the websocket."""

File diff suppressed because it is too large Load Diff

16
generate/int.py.jinja2 Normal file
View File

@ -0,0 +1,16 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class {{name}}(int):
"""{{description}}"""
def __int__(self) -> int:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(int))

21
generate/object.py.jinja2 Normal file
View File

@ -0,0 +1,21 @@
import datetime
from typing import List, Optional, Dict, Union, Any, Literal
from uuid import UUID
from pydantic import BaseModel, Base64Bytes, AnyUrl
from pydantic_extra_types.phone_numbers import PhoneNumber
from .base64data import Base64Data
{% for import in imports %}
{{ import }}
{% endfor %}
class {{ name }}(BaseModel):
"""{{ description }}"""
{% for field in fields %}
{% if field.value %}
{{ field.name }}: Literal[{{ field.value }}] = {{ field.value }}
{% else %}
{{ field.name }}: {{ field.type }}
{% endif %}
{% endfor %}

View File

@ -8,6 +8,7 @@ git config --global --add safe.directory /home/user/src
git add kittycad/models/base64data.py
git add kittycad/models/empty.py
# Cleanup old stuff.
rm -rf kittycad/models
rm -rf kittycad/api
@ -21,7 +22,7 @@ poetry run python generate/generate.py
poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
poetry run ruff check --fix .
poetry run mypy . || true
poetry run mypy .
# Run the tests.

16
generate/str.py.jinja2 Normal file
View File

@ -0,0 +1,16 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class {{name}}(str):
"""{{description}}"""
def __str__(self) -> str:
return self
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(str))

View File

@ -1,50 +1,21 @@
from typing import Dict, Any, Union, Type, TypeVar
from typing_extensions import Self
import attr
from ..types import UNSET, Unset
from pydantic import RootModel, Field
GY = TypeVar("GY", bound="{{name}}")
from typing_extensions import Annotated
@attr.s(auto_attribs=True)
class {{name}}:
{% if description %}
"""{{description}}"""
{% endif %}
type: Union[
{% if tag %}
{{name}} = RootModel[Annotated[Union[
{% for type in types %}
{{type.name}},
{% endfor %}
]
], Field(discriminator='{{tag}}')]]
{% else %}
{{name}} = RootModel[Union[
{% for type in types %}
{{type.name}},
{% endfor %}
]]
{% endif %}
def __init__(self,
type: Union[
{% for type in types %}
{{type.name}},
{% endfor %}
]):
self.type = type
def to_dict(self) -> Dict[str, Any]:
{% for type in types %}{% if loop.first %}
if isinstance(self.type, {{type.name}}):
{{type.var0}} : {{type.name}} = self.type
return {{type.var0}}.to_dict()
{% else %}elif isinstance(self.type, {{type.name}}):
{{type.var0}} : {{type.name}} = self.type
return {{type.var0}}.to_dict()
{% endif %}{% endfor %}
raise Exception("Unknown type")
@classmethod
def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY:
{% for type in types %}{% if loop.first %}
if d.get("{{type.check}}") == {{type.value}}:
{{type.var1}} : {{type.name}} = {{type.name}}()
{{type.var1}}.from_dict(d)
return cls(type={{type.var1}})
{% else %}elif d.get("{{type.check}}") == {{type.value}}:
{{type.var1}} : {{type.name}} = {{type.name}}()
{{type.var1}}.from_dict(d)
return cls(type={{type.var1}})
{% endif %}{% endfor %}
raise Exception("Unknown type")

View File

@ -7,6 +7,30 @@
"install": "pip install kittycad"
}
},
{
"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~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/~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/~1users-extended~1{id}/get/x-python",
@ -17,26 +41,66 @@
},
{
"op": "add",
"path": "/paths/~1file~1volume/post/x-python",
"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.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"
"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/~1ai-prompts~1{id}/get/x-python",
"path": "/paths/~1apps~1github~1consent/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"
"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~1angle~1{input_unit}~1{output_unit}/get/x-python",
"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_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.unit.get_angle_unit_conversion.html"
"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~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/~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~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~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~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"
}
},
{
@ -49,10 +113,10 @@
},
{
"op": "add",
"path": "/paths/~1user~1payment~1intent/post/x-python",
"path": "/paths/~1auth~1email/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"
"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"
}
},
{
@ -71,6 +135,86 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.ai.get_text_to_cad_model_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1auth~1email~1callback/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"<string>\",\n token=\"<string>\",\n callback_url=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: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-tokens~1{token}/delete/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\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.api_tokens.delete_api_token_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-tokens~1{token}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\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.api_tokens.get_api_token_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1async~1operations/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\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: AsyncApiCallResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.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/~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~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/~1user~1api-tokens/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_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: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-tokens/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_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: ApiTokenResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1session~1{token}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_for_user.html"
}
},
{
"op": "add",
"path": "/paths/~1ai-prompts/get/x-python",
@ -81,18 +225,66 @@
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-python",
"path": "/paths/~1file~1surface-area/post/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"
"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/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-python",
"path": "/paths/~1user~1front-hash/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"
"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"
}
},
{
"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~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=\"<uuid>\",\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/~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/~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~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"
}
},
{
@ -113,58 +305,34 @@
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-python",
"path": "/paths/~1file~1mass/post/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"
"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~1api-calls/get/x-python",
"path": "/paths/~1apps~1github~1webhook/post/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"
"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/~1ws~1executor~1term/get/x-python",
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/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 websocket = create_executor_term.sync(\n client=client,\n )\n\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"
"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/~1user~1payment~1tax/get/x-python",
"path": "/paths/~1user~1payment~1invoices/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/~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/~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 websocket = 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 )\n\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/~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"
"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"
}
},
{
@ -177,58 +345,18 @@
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-python",
"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_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\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: UnitTemperatureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"
"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/~1user~1api-calls~1{id}/get/x-python",
"path": "/paths/~1async~1operations~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/~1async~1operations/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import list_async_operations\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import AsyncApiCallResultsPage, Error\nfrom kittycad.models.api_call_status import ApiCallStatus\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_async_operations():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[AsyncApiCallResultsPage, Error]\n ] = list_async_operations.sync(\n client=client,\n sort_by=CreatedAtSortMode.CREATED_AT_ASCENDING,\n status=ApiCallStatus.QUEUED,\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: AsyncApiCallResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.list_async_operations.html"
}
},
{
"op": "add",
"path": "/paths/~1openai~1openapi.json/get/x-python",
"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",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.meta.get_openai_schema.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1session~1{token}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_session_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Session\nfrom kittycad.types import Response\n\n\ndef example_get_session_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Session, Error]] = get_session_for_user.sync(\n client=client,\n token=\"<uuid>\",\n )\n\n if isinstance(result, Error) or result == None:\n print(result)\n raise Exception(\"Error in response\")\n\n body: Session = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_session_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"
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_calls import get_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n TextToCad,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n Error,\n ]\n ] = get_async_operation.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: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n ] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"
}
},
{
@ -247,6 +375,14 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.get_payment_information_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/post/x-python",
@ -255,86 +391,6 @@
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.payments.create_payment_information_for_user.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/~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/~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~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~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~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~1force~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_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.unit.get_force_unit_conversion.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~1onboarding/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_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: Onboarding = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.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/~1api-calls/get/x-python",
@ -345,42 +401,10 @@
},
{
"op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-python",
"path": "/paths/~1openai~1openapi.json/get/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/~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/~1unit~1conversion~1energy~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_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\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: UnitEnergyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_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/~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"
"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.meta.get_openai_schema.html"
}
},
{
@ -409,74 +433,10 @@
},
{
"op": "add",
"path": "/paths/~1apps~1github~1callback/get/x-python",
"path": "/paths/~1ai-prompts~1{id}/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/~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"
}
},
{
"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/~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/~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/~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/~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~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/~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"
"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"
}
},
{
@ -489,74 +449,74 @@
},
{
"op": "add",
"path": "/paths/~1file~1surface-area/post/x-python",
"path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/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"
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.unit import get_temperature_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitTemperatureConversion\nfrom kittycad.models.unit_temperature import UnitTemperature\nfrom kittycad.types import Response\n\n\ndef example_get_temperature_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitTemperatureConversion, Error]\n ] = get_temperature_unit_conversion.sync(\n client=client,\n input_unit=UnitTemperature.CELSIUS,\n output_unit=UnitTemperature.CELSIUS,\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: UnitTemperatureConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_temperature_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1payment~1balance/get/x-python",
"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.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"
"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/~1file~1density/post/x-python",
"path": "/paths/~1user~1onboarding/get/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"
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.users import get_user_onboarding_self\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, Onboarding\nfrom kittycad.types import Response\n\n\ndef example_get_user_onboarding_self():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[Onboarding, Error]] = get_user_onboarding_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: Onboarding = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.users.get_user_onboarding_self.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1api-tokens/post/x-python",
"path": "/paths/~1file~1volume/post/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import create_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_create_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = create_api_token_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: ApiToken = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.create_api_token_for_user.html"
"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/~1user~1api-tokens/get/x-python",
"path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import list_api_tokens_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiTokenResultsPage, Error\nfrom kittycad.models.created_at_sort_mode import CreatedAtSortMode\nfrom kittycad.types import Response\n\n\ndef example_list_api_tokens_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[ApiTokenResultsPage, Error]\n ] = list_api_tokens_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: ApiTokenResultsPage = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_tokens.list_api_tokens_for_user.html"
"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.unit.get_force_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1user~1extended/get/x-python",
"path": "/paths/~1user~1payment~1tax/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"
"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/~1async~1operations~1{id}/get/x-python",
"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_async_operation\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import (\n Error,\n FileCenterOfMass,\n FileConversion,\n FileDensity,\n FileMass,\n FileSurfaceArea,\n FileVolume,\n TextToCad,\n)\nfrom kittycad.types import Response\n\n\ndef example_get_async_operation():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n Error,\n ]\n ] = get_async_operation.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: Union[\n FileConversion,\n FileCenterOfMass,\n FileMass,\n FileVolume,\n FileDensity,\n FileSurfaceArea,\n TextToCad,\n ] = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.api_calls.get_async_operation.html"
"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=\"<uuid>\",\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/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-python",
"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_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"
"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/~1user~1payment~1invoices/get/x-python",
"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.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"
"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"
}
},
{
@ -569,26 +529,66 @@
},
{
"op": "add",
"path": "/paths/~1auth~1email~1callback/get/x-python",
"path": "/paths/~1users-extended/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.hidden import auth_email_callback\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_auth_email_callback():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = auth_email_callback.sync(\n client=client,\n email=\"<string>\",\n token=\"<string>\",\n callback_url=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: Error = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.hidden.auth_email_callback.html"
"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/~1user~1api-tokens~1{token}/delete/x-python",
"path": "/paths/~1user~1text-to-cad/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import delete_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error\nfrom kittycad.types import Response\n\n\ndef example_delete_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Error] = delete_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\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.api_tokens.delete_api_token_for_user.html"
"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/~1user~1api-tokens~1{token}/get/x-python",
"path": "/paths/~1api-call-metrics/get/x-python",
"value": {
"example": "from typing import Any, List, Optional, Tuple, Union\n\nfrom kittycad.api.api_tokens import get_api_token_for_user\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import ApiToken, Error\nfrom kittycad.types import Response\n\n\ndef example_get_api_token_for_user():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[Union[ApiToken, Error]] = get_api_token_for_user.sync(\n client=client,\n token=\"<uuid>\",\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.api_tokens.get_api_token_for_user.html"
"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/~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/~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/~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/~1unit~1conversion~1energy~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_energy_unit_conversion\nfrom kittycad.client import ClientFromEnv\nfrom kittycad.models import Error, UnitEnergyConversion\nfrom kittycad.models.unit_energy import UnitEnergy\nfrom kittycad.types import Response\n\n\ndef example_get_energy_unit_conversion():\n # Create our client.\n client = ClientFromEnv()\n\n result: Optional[\n Union[UnitEnergyConversion, Error]\n ] = get_energy_unit_conversion.sync(\n client=client,\n input_unit=UnitEnergy.BTU,\n output_unit=UnitEnergy.BTU,\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: UnitEnergyConversion = result\n print(body)\n",
"libDocsLink": "https://python.api.docs.kittycad.io/_autosummary/kittycad.api.unit.get_energy_unit_conversion.html"
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1angle~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_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.unit.get_angle_unit_conversion.html"
}
}
]

View File

@ -35,15 +35,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]:
if response.status_code == 201:
response_201 = TextToCad.from_dict(response.json())
response_201 = TextToCad(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -39,12 +39,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[AiPrompt, Error]]:
if response.status_code == 200:
response_200 = AiPrompt.from_dict(response.json())
response_200 = AiPrompt(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[TextToCad, Error]]:
if response.status_code == 200:
response_200 = TextToCad.from_dict(response.json())
response_200 = TextToCad(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AiPromptResultsPage, Error]]:
if response.status_code == 200:
response_200 = AiPromptResultsPage.from_dict(response.json())
response_200 = AiPromptResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[TextToCadResultsPage, Error]]:
if response.status_code == 200:
response_200 = TextToCadResultsPage.from_dict(response.json())
response_200 = TextToCadResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -33,15 +33,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.from_dict(response.json())
response_200 = ApiCallWithPrice(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -33,15 +33,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPrice, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPrice.from_dict(response.json())
response_200 = ApiCallWithPrice(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -39,15 +39,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[ApiCallQueryGroup], Error]]:
if response.status_code == 200:
response_200 = [ApiCallQueryGroup.from_dict(item) for item in response.json()]
response_200 = [ApiCallQueryGroup(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -54,7 +54,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_conversion = FileConversion.from_dict(data)
option_file_conversion = FileConversion(**data)
return option_file_conversion
except ValueError:
pass
@ -63,7 +63,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_center_of_mass = FileCenterOfMass.from_dict(data)
option_file_center_of_mass = FileCenterOfMass(**data)
return option_file_center_of_mass
except ValueError:
pass
@ -72,7 +72,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_mass = FileMass.from_dict(data)
option_file_mass = FileMass(**data)
return option_file_mass
except ValueError:
pass
@ -81,7 +81,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_volume = FileVolume.from_dict(data)
option_file_volume = FileVolume(**data)
return option_file_volume
except ValueError:
pass
@ -90,7 +90,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_density = FileDensity.from_dict(data)
option_file_density = FileDensity(**data)
return option_file_density
except ValueError:
pass
@ -99,7 +99,7 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_file_surface_area = FileSurfaceArea.from_dict(data)
option_file_surface_area = FileSurfaceArea(**data)
return option_file_surface_area
except ValueError:
pass
@ -108,19 +108,19 @@ def _parse_response(
try:
if not isinstance(data, dict):
raise TypeError()
option_text_to_cad = TextToCad.from_dict(data)
option_text_to_cad = TextToCad(**data)
return option_text_to_cad
except ValueError:
raise
except TypeError:
raise
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
response_200 = ApiCallWithPriceResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -55,15 +55,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
response_200 = ApiCallWithPriceResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -61,15 +61,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AsyncApiCallResultsPage, Error]]:
if response.status_code == 200:
response_200 = AsyncApiCallResultsPage.from_dict(response.json())
response_200 = AsyncApiCallResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiCallWithPriceResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiCallWithPriceResultsPage.from_dict(response.json())
response_200 = ApiCallWithPriceResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]:
if response.status_code == 201:
response_201 = ApiToken.from_dict(response.json())
response_201 = ApiToken(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,12 +31,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]:
if response.status_code == 200:
response_200 = ApiToken.from_dict(response.json())
response_200 = ApiToken(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ApiTokenResultsPage, Error]]:
if response.status_code == 200:
response_200 = ApiTokenResultsPage.from_dict(response.json())
response_200 = ApiTokenResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,12 +29,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AppClientInfo, Error]]:
if response.status_code == 200:
response_200 = AppClientInfo.from_dict(response.json())
response_200 = AppClientInfo(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,12 +31,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -33,7 +33,7 @@ def sync(
client=client,
)
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, 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(
@ -47,5 +47,8 @@ async def asyncio(
)
return await ws_connect_async(
kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"]
kwargs["url"].replace("http", "ws"),
extra_headers=kwargs["headers"],
close_timeout=120,
max_size=None,
)

View File

@ -41,15 +41,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[CodeOutput, Error]]:
if response.status_code == 200:
response_200 = CodeOutput.from_dict(response.json())
response_200 = CodeOutput(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -49,15 +49,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileCenterOfMass, Error]]:
if response.status_code == 201:
response_201 = FileCenterOfMass.from_dict(response.json())
response_201 = FileCenterOfMass(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -39,15 +39,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileConversion, Error]]:
if response.status_code == 201:
response_201 = FileConversion.from_dict(response.json())
response_201 = FileConversion(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -62,15 +62,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileDensity, Error]]:
if response.status_code == 201:
response_201 = FileDensity.from_dict(response.json())
response_201 = FileDensity(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -62,15 +62,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileMass, Error]]:
if response.status_code == 201:
response_201 = FileMass.from_dict(response.json())
response_201 = FileMass(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -49,15 +49,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileSurfaceArea, Error]]:
if response.status_code == 201:
response_201 = FileSurfaceArea.from_dict(response.json())
response_201 = FileSurfaceArea(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -47,15 +47,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[FileVolume, Error]]:
if response.status_code == 201:
response_201 = FileVolume.from_dict(response.json())
response_201 = FileVolume(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -34,15 +34,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[VerificationToken, Error]]:
if response.status_code == 201:
response_201 = VerificationToken.from_dict(response.json())
response_201 = VerificationToken(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -50,12 +50,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -29,12 +29,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[AiPluginManifest, Error]]:
if response.status_code == 200:
response_200 = AiPluginManifest.from_dict(response.json())
response_200 = AiPluginManifest(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Metadata, Error]]:
if response.status_code == 200:
response_200 = Metadata.from_dict(response.json())
response_200 = Metadata(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]
response_200 = response.json()
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[dict, Error]]
response_200 = response.json()
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[ApiToken, Error]]:
if response.status_code == 200:
response_200 = ApiToken.from_dict(response.json())
response_200 = ApiToken(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Pong, Error]]:
if response.status_code == 200:
response_200 = Pong.from_dict(response.json())
response_200 = Pong(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -82,7 +82,7 @@ def sync(
client=client,
)
return ws_connect(kwargs["url"].replace("http", "ws"), additional_headers=kwargs["headers"], close_timeout=None, 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(
@ -106,7 +106,10 @@ async def asyncio(
)
return await ws_connect_async(
kwargs["url"].replace("http", "ws"), extra_headers=kwargs["headers"]
kwargs["url"].replace("http", "ws"),
extra_headers=kwargs["headers"],
close_timeout=120,
max_size=None,
)
@ -153,20 +156,20 @@ class WebSocket:
"""
for message in self.ws:
yield WebSocketResponse.from_dict(json.loads(message))
yield WebSocketResponse(**json.loads(message))
def send(self, data: WebSocketRequest):
"""Send data to the websocket."""
self.ws.send(json.dumps(data.to_dict()))
self.ws.send(json.dumps(data.model_dump()))
def send_binary(self, data: WebSocketRequest):
"""Send data as bson to the websocket."""
self.ws.send(bson.BSON.encode(data.to_dict()))
self.ws.send(bson.encode(data.model_dump())) # type: ignore
def recv(self) -> WebSocketResponse:
"""Receive data from the websocket."""
message = self.ws.recv()
return WebSocketResponse.from_dict(json.loads(message))
message = self.ws.recv(timeout=60)
return WebSocketResponse(**json.loads(message))
def close(self):
"""Close the websocket."""

View File

@ -32,15 +32,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 201:
response_201 = Customer.from_dict(response.json())
response_201 = Customer(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[PaymentIntent, Error]]:
if response.status_code == 201:
response_201 = PaymentIntent.from_dict(response.json())
response_201 = PaymentIntent(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,12 +29,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,12 +31,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[CustomerBalance, Error]]:
if response.status_code == 200:
response_200 = CustomerBalance.from_dict(response.json())
response_200 = CustomerBalance(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.from_dict(response.json())
response_200 = Customer(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[Invoice], Error]]:
if response.status_code == 200:
response_200 = [Invoice.from_dict(item) for item in response.json()]
response_200 = [Invoice(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[List[PaymentMethod], Error]]:
if response.status_code == 200:
response_200 = [PaymentMethod.from_dict(item) for item in response.json()]
response_200 = [PaymentMethod(**item) for item in response.json()]
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -32,15 +32,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Customer, Error]]:
if response.status_code == 200:
response_200 = Customer.from_dict(response.json())
response_200 = Customer(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,12 +29,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitAngleConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAngleConversion.from_dict(response.json())
response_200 = UnitAngleConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitAreaConversion, Error]]:
if response.status_code == 200:
response_200 = UnitAreaConversion.from_dict(response.json())
response_200 = UnitAreaConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitCurrentConversion, Error]]:
if response.status_code == 200:
response_200 = UnitCurrentConversion.from_dict(response.json())
response_200 = UnitCurrentConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitEnergyConversion, Error]]:
if response.status_code == 200:
response_200 = UnitEnergyConversion.from_dict(response.json())
response_200 = UnitEnergyConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitForceConversion, Error]]:
if response.status_code == 200:
response_200 = UnitForceConversion.from_dict(response.json())
response_200 = UnitForceConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitFrequencyConversion, Error]]:
if response.status_code == 200:
response_200 = UnitFrequencyConversion.from_dict(response.json())
response_200 = UnitFrequencyConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitLengthConversion, Error]]:
if response.status_code == 200:
response_200 = UnitLengthConversion.from_dict(response.json())
response_200 = UnitLengthConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitMassConversion, Error]]:
if response.status_code == 200:
response_200 = UnitMassConversion.from_dict(response.json())
response_200 = UnitMassConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitPowerConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPowerConversion.from_dict(response.json())
response_200 = UnitPowerConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitPressureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitPressureConversion.from_dict(response.json())
response_200 = UnitPressureConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitTemperatureConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTemperatureConversion.from_dict(response.json())
response_200 = UnitTemperatureConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitTorqueConversion, Error]]:
if response.status_code == 200:
response_200 = UnitTorqueConversion.from_dict(response.json())
response_200 = UnitTorqueConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -43,15 +43,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UnitVolumeConversion, Error]]:
if response.status_code == 200:
response_200 = UnitVolumeConversion.from_dict(response.json())
response_200 = UnitVolumeConversion(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,12 +29,12 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
return None
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Session, Error]]:
if response.status_code == 200:
response_200 = Session.from_dict(response.json())
response_200 = Session(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]:
if response.status_code == 200:
response_200 = User.from_dict(response.json())
response_200 = User(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -33,15 +33,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.from_dict(response.json())
response_200 = ExtendedUser(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,12 +31,12 @@ def _parse_response(*, response: httpx.Response) -> Optional[Union[str, Error]]:
response_200 = response.text
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[Onboarding, Error]]:
if response.status_code == 200:
response_200 = Onboarding.from_dict(response.json())
response_200 = Onboarding(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -29,15 +29,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]:
if response.status_code == 200:
response_200 = User.from_dict(response.json())
response_200 = User(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -31,15 +31,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUser, Error]]:
if response.status_code == 200:
response_200 = ExtendedUser.from_dict(response.json())
response_200 = ExtendedUser(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[UserResultsPage, Error]]:
if response.status_code == 200:
response_200 = UserResultsPage.from_dict(response.json())
response_200 = UserResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -53,15 +53,15 @@ def _parse_response(
*, response: httpx.Response
) -> Optional[Union[ExtendedUserResultsPage, Error]]:
if response.status_code == 200:
response_200 = ExtendedUserResultsPage.from_dict(response.json())
response_200 = ExtendedUserResultsPage(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -32,15 +32,15 @@ def _get_kwargs(
def _parse_response(*, response: httpx.Response) -> Optional[Union[User, Error]]:
if response.status_code == 200:
response_200 = User.from_dict(response.json())
response_200 = User(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error.from_dict(response.json())
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error.from_dict(response.json())
response_5XX = Error(**response.json())
return response_5XX
return Error.from_dict(response.json())
return Error(**response.json())
def _build_response(

View File

@ -1,7 +1,7 @@
import json
import os
import uuid
from typing import Dict, Optional, Union
from typing import Optional, Union
import pytest
@ -14,8 +14,10 @@ from .client import ClientFromEnv
from .models import (
ApiCallStatus,
ApiTokenResultsPage,
Base64Data,
Axis,
AxisDirectionPair,
CreatedAtSortMode,
Direction,
Error,
ExtendedUserResultsPage,
FileConversion,
@ -23,16 +25,28 @@ from .models import (
FileImportFormat,
FileMass,
FileVolume,
ImageFormat,
ImportFile,
InputFormat,
ModelingCmd,
ModelingCmdId,
Pong,
System,
UnitDensity,
UnitLength,
UnitMass,
UnitVolume,
User,
WebSocketRequest,
WebSocketResponse,
)
from .models.input_format import obj
from .models.modeling_cmd import (
default_camera_focus_on,
import_files,
start_path,
take_snapshot,
)
from .models.modeling_cmd import start_path
from .models.web_socket_request import modeling_cmd_req
from .types import Unset
@ -131,10 +145,10 @@ def test_file_convert_stl():
print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
assert fc.outputs is not None
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty.
for key, value in outputs.items():
for key, value in fc.outputs.items():
assert len(value.get_decoded()) > 0
@ -170,10 +184,10 @@ async def test_file_convert_stl_async():
print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
assert fc.outputs is not None
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty.
for key, value in outputs.items():
for key, value in fc.outputs.items():
assert len(value.get_decoded()) > 0
@ -209,10 +223,10 @@ async def test_file_convert_obj_async():
print(f"FileConversion: {fc}")
assert not isinstance(fc.outputs, Unset)
assert fc.outputs is not None
outputs: Dict[str, Base64Data] = fc.outputs
# Make sure the bytes are not empty.
for key, value in outputs.items():
for key, value in fc.outputs.items():
assert len(value.get_decoded()) > 0
@ -244,7 +258,7 @@ def test_file_mass():
assert fm.id is not None
assert fm.mass is not None
assert fm.to_dict() is not None
assert fm.model_dump_json() is not None
assert fm.status == ApiCallStatus.COMPLETED
@ -275,7 +289,7 @@ def test_file_volume():
assert fv.id is not None
assert fv.volume is not None
assert fv.to_dict() is not None
assert fv.model_dump_json() is not None
assert fv.status == ApiCallStatus.COMPLETED
@ -293,7 +307,7 @@ def test_list_users():
print(f"ExtendedUserResultsPage: {response}")
def test_ws():
def test_ws_simple():
# Create our client.
client = ClientFromEnv()
@ -311,11 +325,167 @@ def test_ws():
req = WebSocketRequest(
modeling_cmd_req(cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(id))
)
json.dumps(req.to_dict())
websocket.send(req)
# Get the messages.
while True:
message = websocket.recv()
print(json.dumps(message.to_dict()))
print(json.dumps(message.model_dump_json()))
break
def test_ws_import():
# Create our client.
client = ClientFromEnv()
# Connect to the websocket.
with modeling_commands_ws.WebSocket(
client=client,
fps=30,
unlocked_framerate=False,
video_res_height=360,
video_res_width=480,
webrtc=False,
) as websocket:
# read the content of the file
dir_path = os.path.dirname(os.path.realpath(__file__))
file_name = "ORIGINALVOXEL-3.obj"
file = open(os.path.join(dir_path, "..", "assets", file_name), "rb")
content = file.read()
file.close()
cmd_id = uuid.uuid4()
ImportFile(data=content, path=file_name)
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(
import_files(
files=[ImportFile(data=content, path=file_name)],
format=InputFormat(
obj(
units=UnitLength.M,
coords=System(
forward=AxisDirectionPair(
axis=Axis.Y, direction=Direction.NEGATIVE
),
up=AxisDirectionPair(
axis=Axis.Z, direction=Direction.POSITIVE
),
),
)
),
)
),
cmd_id=ModelingCmdId(cmd_id),
)
)
# Import files request must be sent as binary, because the file contents might be binary.
websocket.send_binary(req)
# Get the success message.
object_id = ""
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"]
!= "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.
cmd_id = uuid.uuid4()
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(default_camera_focus_on(uuid=object_id)),
cmd_id=ModelingCmdId(cmd_id),
)
)
websocket.send(req)
# Get the success message.
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["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.
cmd_id = uuid.uuid4()
# form the request
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)),
cmd_id=ModelingCmdId(cmd_id),
)
)
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

@ -562,7 +562,7 @@ def test_get_api_call():
result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call.sync(
client=client,
id="<string>",
id="<uuid>",
)
if isinstance(result, Error) or result is None:
@ -577,7 +577,7 @@ def test_get_api_call():
Optional[Union[ApiCallWithPrice, Error]]
] = get_api_call.sync_detailed(
client=client,
id="<string>",
id="<uuid>",
)
@ -590,7 +590,7 @@ async def test_get_api_call_async():
result: Optional[Union[ApiCallWithPrice, Error]] = await get_api_call.asyncio(
client=client,
id="<string>",
id="<uuid>",
)
# OR run async with more info
@ -598,7 +598,7 @@ async def test_get_api_call_async():
Optional[Union[ApiCallWithPrice, Error]]
] = await get_api_call.asyncio_detailed(
client=client,
id="<string>",
id="<uuid>",
)
@ -2545,7 +2545,7 @@ def test_get_api_call_for_user():
result: Optional[Union[ApiCallWithPrice, Error]] = get_api_call_for_user.sync(
client=client,
id="<string>",
id="<uuid>",
)
if isinstance(result, Error) or result is None:
@ -2560,7 +2560,7 @@ def test_get_api_call_for_user():
Optional[Union[ApiCallWithPrice, Error]]
] = get_api_call_for_user.sync_detailed(
client=client,
id="<string>",
id="<uuid>",
)
@ -2575,7 +2575,7 @@ async def test_get_api_call_for_user_async():
Union[ApiCallWithPrice, Error]
] = await get_api_call_for_user.asyncio(
client=client,
id="<string>",
id="<uuid>",
)
# OR run async with more info
@ -2583,7 +2583,7 @@ async def test_get_api_call_for_user_async():
Optional[Union[ApiCallWithPrice, Error]]
] = await get_api_call_for_user.asyncio_detailed(
client=client,
id="<string>",
id="<uuid>",
)
@ -3854,16 +3854,15 @@ def test_create_executor_term():
client = ClientFromEnv()
# Connect to the websocket.
websocket = create_executor_term.sync(
with create_executor_term.sync(
client=client,
)
) as websocket:
# Send a message.
websocket.send("{}")
# Send a message.
websocket.send("{}")
# Get the messages.
for message in websocket:
print(message)
# Get the messages.
for message in websocket:
print(message)
# OR run async
@ -3892,30 +3891,29 @@ def test_modeling_commands_ws():
client = ClientFromEnv()
# Connect to the websocket.
websocket = modeling_commands_ws.WebSocket(
with modeling_commands_ws.WebSocket(
client=client,
fps=10,
unlocked_framerate=False,
video_res_height=10,
video_res_width=10,
webrtc=False,
)
# Send a message.
websocket.send(
WebSocketRequest(
sdp_offer(
offer=RtcSessionDescription(
sdp="<string>",
type=RtcSdpType.UNSPECIFIED,
),
) as websocket:
# Send a message.
websocket.send(
WebSocketRequest(
sdp_offer(
offer=RtcSessionDescription(
sdp="<string>",
type=RtcSdpType.UNSPECIFIED,
),
)
)
)
)
# Get a message.
message = websocket.recv()
print(message)
# Get a message.
message = websocket.recv()
print(message)
# OR run async

View File

@ -34,7 +34,6 @@ from .async_api_call_results_page import AsyncApiCallResultsPage
from .async_api_call_type import AsyncApiCallType
from .axis import Axis
from .axis_direction_pair import AxisDirectionPair
from .base64data import Base64Data
from .billing_info import BillingInfo
from .cache_metadata import CacheMetadata
from .camera_drag_interaction_type import CameraDragInteractionType
@ -193,7 +192,6 @@ from .update_user import UpdateUser
from .user import User
from .user_results_page import UserResultsPage
from .uuid import Uuid
from .uuid_binary import UuidBinary
from .verification_token import VerificationToken
from .volume import Volume
from .web_socket_request import WebSocketRequest

View File

@ -1,79 +1,15 @@
from typing import Any, Dict, List, Type, TypeVar, Union
from typing import Optional
import attr
from pydantic import BaseModel
from ..models.ai_plugin_api_type import AiPluginApiType
from ..types import UNSET, Unset
SB = TypeVar("SB", bound="AiPluginApi")
@attr.s(auto_attribs=True)
class AiPluginApi:
"""AI plugin api information.""" # noqa: E501
class AiPluginApi(BaseModel):
"""AI plugin api information."""
is_user_authenticated: Union[Unset, bool] = False
type: Union[Unset, AiPluginApiType] = UNSET
url: Union[Unset, str] = UNSET
is_user_authenticated: Optional[bool] = None
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
type: Optional[AiPluginApiType] = None
def to_dict(self) -> Dict[str, Any]:
is_user_authenticated = self.is_user_authenticated
type: Union[Unset, AiPluginApiType] = UNSET
if not isinstance(self.type, Unset):
type = self.type
url = self.url
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if is_user_authenticated is not UNSET:
field_dict["is_user_authenticated"] = is_user_authenticated
if type is not UNSET:
field_dict["type"] = type
if url is not UNSET:
field_dict["url"] = url
return field_dict
@classmethod
def from_dict(cls: Type[SB], src_dict: Dict[str, Any]) -> SB:
d = src_dict.copy()
is_user_authenticated = d.pop("is_user_authenticated", UNSET)
_type = d.pop("type", UNSET)
type: Union[Unset, AiPluginApiType]
if isinstance(_type, Unset):
type = UNSET
if _type is None:
type = UNSET
else:
type = _type
url = d.pop("url", UNSET)
ai_plugin_api = cls(
is_user_authenticated=is_user_authenticated,
type=type,
url=url,
)
ai_plugin_api.additional_properties = d
return ai_plugin_api
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
url: str

View File

@ -1,82 +1,14 @@
from typing import Any, Dict, List, Type, TypeVar, Union
from typing import Optional
import attr
from pydantic import BaseModel
from ..models.ai_plugin_auth_type import AiPluginAuthType
from ..models.ai_plugin_http_auth_type import AiPluginHttpAuthType
from ..types import UNSET, Unset
NP = TypeVar("NP", bound="AiPluginAuth")
@attr.s(auto_attribs=True)
class AiPluginAuth:
"""AI plugin auth information.""" # noqa: E501
class AiPluginAuth(BaseModel):
"""AI plugin auth information."""
authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET
type: Union[Unset, AiPluginAuthType] = UNSET
authorization_type: Optional[AiPluginHttpAuthType] = None
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
authorization_type: Union[Unset, AiPluginHttpAuthType] = UNSET
if not isinstance(self.authorization_type, Unset):
authorization_type = self.authorization_type
type: Union[Unset, AiPluginAuthType] = UNSET
if not isinstance(self.type, Unset):
type = self.type
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if authorization_type is not UNSET:
field_dict["authorization_type"] = authorization_type
if type is not UNSET:
field_dict["type"] = type
return field_dict
@classmethod
def from_dict(cls: Type[NP], src_dict: Dict[str, Any]) -> NP:
d = src_dict.copy()
_authorization_type = d.pop("authorization_type", UNSET)
authorization_type: Union[Unset, AiPluginHttpAuthType]
if isinstance(_authorization_type, Unset):
authorization_type = UNSET
if _authorization_type is None:
authorization_type = UNSET
else:
authorization_type = _authorization_type
_type = d.pop("type", UNSET)
type: Union[Unset, AiPluginAuthType]
if isinstance(_type, Unset):
type = UNSET
if _type is None:
type = UNSET
else:
type = _type
ai_plugin_auth = cls(
authorization_type=authorization_type,
type=type,
)
ai_plugin_auth.additional_properties = d
return ai_plugin_auth
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
type: Optional[AiPluginAuthType] = None

View File

@ -1,143 +1,33 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
from typing import Optional
import attr
from pydantic import BaseModel
from ..models.ai_plugin_api import AiPluginApi
from ..models.ai_plugin_auth import AiPluginAuth
from ..types import UNSET, Unset
SA = TypeVar("SA", bound="AiPluginManifest")
@attr.s(auto_attribs=True)
class AiPluginManifest:
class AiPluginManifest(BaseModel):
"""AI plugin manifest.
This is used for OpenAI's ChatGPT plugins. You can read more about them [here](https://platform.openai.com/docs/plugins/getting-started/plugin-manifest).
""" # noqa: E501
"""
api: Union[Unset, AiPluginApi] = UNSET
auth: Union[Unset, AiPluginAuth] = UNSET
contact_email: Union[Unset, str] = UNSET
description_for_human: Union[Unset, str] = UNSET
description_for_model: Union[Unset, str] = UNSET
legal_info_url: Union[Unset, str] = UNSET
logo_url: Union[Unset, str] = UNSET
name_for_human: Union[Unset, str] = UNSET
name_for_model: Union[Unset, str] = UNSET
schema_version: Union[Unset, str] = UNSET
api: AiPluginApi
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
auth: AiPluginAuth
def to_dict(self) -> Dict[str, Any]:
api: Union[Unset, AiPluginApi] = UNSET
if not isinstance(self.api, Unset):
api = self.api
auth: Union[Unset, AiPluginAuth] = UNSET
if not isinstance(self.auth, Unset):
auth = self.auth
contact_email = self.contact_email
description_for_human = self.description_for_human
description_for_model = self.description_for_model
legal_info_url = self.legal_info_url
logo_url = self.logo_url
name_for_human = self.name_for_human
name_for_model = self.name_for_model
schema_version = self.schema_version
contact_email: Optional[str] = None
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if api is not UNSET:
_api: AiPluginApi = cast(AiPluginApi, api)
field_dict["api"] = _api.to_dict()
if auth is not UNSET:
_auth: AiPluginAuth = cast(AiPluginAuth, auth)
field_dict["auth"] = _auth.to_dict()
if contact_email is not UNSET:
field_dict["contact_email"] = contact_email
if description_for_human is not UNSET:
field_dict["description_for_human"] = description_for_human
if description_for_model is not UNSET:
field_dict["description_for_model"] = description_for_model
if legal_info_url is not UNSET:
field_dict["legal_info_url"] = legal_info_url
if logo_url is not UNSET:
field_dict["logo_url"] = logo_url
if name_for_human is not UNSET:
field_dict["name_for_human"] = name_for_human
if name_for_model is not UNSET:
field_dict["name_for_model"] = name_for_model
if schema_version is not UNSET:
field_dict["schema_version"] = schema_version
description_for_human: Optional[str] = None
return field_dict
description_for_model: Optional[str] = None
@classmethod
def from_dict(cls: Type[SA], src_dict: Dict[str, Any]) -> SA:
d = src_dict.copy()
_api = d.pop("api", UNSET)
api: Union[Unset, AiPluginApi]
if isinstance(_api, Unset):
api = UNSET
if _api is None:
api = UNSET
else:
api = AiPluginApi.from_dict(_api)
legal_info_url: str
_auth = d.pop("auth", UNSET)
auth: Union[Unset, AiPluginAuth]
if isinstance(_auth, Unset):
auth = UNSET
if _auth is None:
auth = UNSET
else:
auth = AiPluginAuth.from_dict(_auth)
logo_url: str
contact_email = d.pop("contact_email", UNSET)
name_for_human: Optional[str] = None
description_for_human = d.pop("description_for_human", UNSET)
name_for_model: Optional[str] = None
description_for_model = d.pop("description_for_model", UNSET)
legal_info_url = d.pop("legal_info_url", UNSET)
logo_url = d.pop("logo_url", UNSET)
name_for_human = d.pop("name_for_human", UNSET)
name_for_model = d.pop("name_for_model", UNSET)
schema_version = d.pop("schema_version", UNSET)
ai_plugin_manifest = cls(
api=api,
auth=auth,
contact_email=contact_email,
description_for_human=description_for_human,
description_for_model=description_for_model,
legal_info_url=legal_info_url,
logo_url=logo_url,
name_for_human=name_for_human,
name_for_model=name_for_model,
schema_version=schema_version,
)
ai_plugin_manifest.additional_properties = d
return ai_plugin_manifest
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
schema_version: Optional[str] = None

View File

@ -1,223 +1,41 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
from typing import Any, Optional
import attr
from dateutil.parser import isoparse
from pydantic import BaseModel
from ..models.ai_feedback import AiFeedback
from ..models.ai_prompt_type import AiPromptType
from ..models.api_call_status import ApiCallStatus
from ..models.uuid import Uuid
from ..models.uuid_binary import UuidBinary
from ..types import UNSET, Unset
GO = TypeVar("GO", bound="AiPrompt")
@attr.s(auto_attribs=True)
class AiPrompt:
"""An AI prompt.""" # noqa: E501
class AiPrompt(BaseModel):
"""An AI prompt."""
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
error: Union[Unset, str] = UNSET
feedback: Union[Unset, AiFeedback] = UNSET
id: Union[Unset, UuidBinary] = UNSET
metadata: Union[Unset, Any] = UNSET
model_version: Union[Unset, str] = UNSET
output_file: Union[Unset, str] = UNSET
prompt: Union[Unset, str] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status: Union[Unset, ApiCallStatus] = UNSET
type: Union[Unset, AiPromptType] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
completed_at: Optional[datetime.datetime] = None
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
created_at: datetime.datetime
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
error = self.error
feedback: Union[Unset, AiFeedback] = UNSET
if not isinstance(self.feedback, Unset):
feedback = self.feedback
id: Union[Unset, UuidBinary] = UNSET
if not isinstance(self.id, Unset):
id = self.id
metadata = self.metadata
model_version = self.model_version
output_file = self.output_file
prompt = self.prompt
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status: Union[Unset, ApiCallStatus] = UNSET
if not isinstance(self.status, Unset):
status = self.status
type: Union[Unset, AiPromptType] = UNSET
if not isinstance(self.type, Unset):
type = self.type
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
error: Optional[str] = None
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict["completed_at"] = completed_at
if created_at is not UNSET:
field_dict["created_at"] = created_at
if error is not UNSET:
field_dict["error"] = error
if feedback is not UNSET:
field_dict["feedback"] = feedback
if id is not UNSET:
field_dict["id"] = id
if metadata is not UNSET:
field_dict["metadata"] = metadata
if model_version is not UNSET:
field_dict["model_version"] = model_version
if output_file is not UNSET:
field_dict["output_file"] = output_file
if prompt is not UNSET:
field_dict["prompt"] = prompt
if started_at is not UNSET:
field_dict["started_at"] = started_at
if status is not UNSET:
field_dict["status"] = status
if type is not UNSET:
field_dict["type"] = type
if updated_at is not UNSET:
field_dict["updated_at"] = updated_at
if user_id is not UNSET:
field_dict["user_id"] = user_id
feedback: Optional[AiFeedback] = None
return field_dict
id: Uuid
@classmethod
def from_dict(cls: Type[GO], src_dict: Dict[str, Any]) -> GO:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
metadata: Optional[Any] = None
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
model_version: str
error = d.pop("error", UNSET)
output_file: Optional[str] = None
_feedback = d.pop("feedback", UNSET)
feedback: Union[Unset, AiFeedback]
if isinstance(_feedback, Unset):
feedback = UNSET
if _feedback is None:
feedback = UNSET
else:
feedback = _feedback
prompt: str
_id = d.pop("id", UNSET)
id: Union[Unset, UuidBinary]
if isinstance(_id, Unset):
id = UNSET
if _id is None:
id = UNSET
else:
id = _id
started_at: Optional[datetime.datetime] = None
metadata = d.pop("metadata", UNSET)
model_version = d.pop("model_version", UNSET)
status: ApiCallStatus
output_file = d.pop("output_file", UNSET)
type: AiPromptType
prompt = d.pop("prompt", UNSET)
updated_at: datetime.datetime
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
_status = d.pop("status", UNSET)
status: Union[Unset, ApiCallStatus]
if isinstance(_status, Unset):
status = UNSET
if _status is None:
status = UNSET
else:
status = _status
_type = d.pop("type", UNSET)
type: Union[Unset, AiPromptType]
if isinstance(_type, Unset):
type = UNSET
if _type is None:
type = UNSET
else:
type = _type
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
_user_id = d.pop("user_id", UNSET)
user_id: Union[Unset, Uuid]
if isinstance(_user_id, Unset):
user_id = UNSET
if _user_id is None:
user_id = UNSET
else:
user_id = _user_id
ai_prompt = cls(
completed_at=completed_at,
created_at=created_at,
error=error,
feedback=feedback,
id=id,
metadata=metadata,
model_version=model_version,
output_file=output_file,
prompt=prompt,
started_at=started_at,
status=status,
type=type,
updated_at=updated_at,
user_id=user_id,
)
ai_prompt.additional_properties = d
return ai_prompt
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
user_id: Uuid

View File

@ -1,70 +1,13 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
from typing import List, Optional
import attr
from pydantic import BaseModel
from ..types import UNSET, Unset
PI = TypeVar("PI", bound="AiPromptResultsPage")
from ..models.ai_prompt import AiPrompt
@attr.s(auto_attribs=True)
class AiPromptResultsPage:
"""A single page of results""" # noqa: E501
class AiPromptResultsPage(BaseModel):
"""A single page of results"""
from ..models.ai_prompt import AiPrompt
items: List[AiPrompt]
items: Union[Unset, List[AiPrompt]] = UNSET
next_page: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
from ..models.ai_prompt import AiPrompt
items: Union[Unset, List[AiPrompt]] = UNSET
if not isinstance(self.items, Unset):
items = self.items
next_page = self.next_page
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if items is not UNSET:
field_dict["items"] = items
if next_page is not UNSET:
field_dict["next_page"] = next_page
return field_dict
@classmethod
def from_dict(cls: Type[PI], src_dict: Dict[str, Any]) -> PI:
d = src_dict.copy()
from ..models.ai_prompt import AiPrompt
items = cast(List[AiPrompt], d.pop("items", UNSET))
next_page = d.pop("next_page", UNSET)
ai_prompt_results_page = cls(
items=items,
next_page=next_page,
)
ai_prompt_results_page.additional_properties = d
return ai_prompt_results_page
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
next_page: Optional[str] = None

View File

@ -1,72 +1,12 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from pydantic import BaseModel
from ..models.unit_angle import UnitAngle
from ..types import UNSET, Unset
UZ = TypeVar("UZ", bound="Angle")
@attr.s(auto_attribs=True)
class Angle:
"""An angle, with a specific unit.""" # noqa: E501
class Angle(BaseModel):
"""An angle, with a specific unit."""
unit: Union[Unset, UnitAngle] = UNSET
value: Union[Unset, float] = UNSET
unit: UnitAngle
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
unit: Union[Unset, UnitAngle] = UNSET
if not isinstance(self.unit, Unset):
unit = self.unit
value = self.value
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if unit is not UNSET:
field_dict["unit"] = unit
if value is not UNSET:
field_dict["value"] = value
return field_dict
@classmethod
def from_dict(cls: Type[UZ], src_dict: Dict[str, Any]) -> UZ:
d = src_dict.copy()
_unit = d.pop("unit", UNSET)
unit: Union[Unset, UnitAngle]
if isinstance(_unit, Unset):
unit = UNSET
if _unit is None:
unit = UNSET
else:
unit = _unit
value = d.pop("value", UNSET)
angle = cls(
unit=unit,
value=value,
)
angle.additional_properties = d
return angle
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
value: float

View File

@ -1,81 +1,12 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from pydantic import BaseModel
from ..models.annotation_line_end import AnnotationLineEnd
from ..types import UNSET, Unset
FB = TypeVar("FB", bound="AnnotationLineEndOptions")
@attr.s(auto_attribs=True)
class AnnotationLineEndOptions:
"""Options for annotation text""" # noqa: E501
class AnnotationLineEndOptions(BaseModel):
"""Options for annotation text"""
end: Union[Unset, AnnotationLineEnd] = UNSET
start: Union[Unset, AnnotationLineEnd] = UNSET
end: AnnotationLineEnd
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
end: Union[Unset, AnnotationLineEnd] = UNSET
if not isinstance(self.end, Unset):
end = self.end
start: Union[Unset, AnnotationLineEnd] = UNSET
if not isinstance(self.start, Unset):
start = self.start
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if end is not UNSET:
field_dict["end"] = end
if start is not UNSET:
field_dict["start"] = start
return field_dict
@classmethod
def from_dict(cls: Type[FB], src_dict: Dict[str, Any]) -> FB:
d = src_dict.copy()
_end = d.pop("end", UNSET)
end: Union[Unset, AnnotationLineEnd]
if isinstance(_end, Unset):
end = UNSET
if _end is None:
end = UNSET
else:
end = _end
_start = d.pop("start", UNSET)
start: Union[Unset, AnnotationLineEnd]
if isinstance(_start, Unset):
start = UNSET
if _start is None:
start = UNSET
else:
start = _start
annotation_line_end_options = cls(
end=end,
start=start,
)
annotation_line_end_options.additional_properties = d
return annotation_line_end_options
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
start: AnnotationLineEnd

View File

@ -1,129 +1,22 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
from typing import Optional
import attr
from pydantic import BaseModel
from ..models.annotation_line_end_options import AnnotationLineEndOptions
from ..models.annotation_text_options import AnnotationTextOptions
from ..models.color import Color
from ..models.point3d import Point3d
from ..types import UNSET, Unset
QP = TypeVar("QP", bound="AnnotationOptions")
@attr.s(auto_attribs=True)
class AnnotationOptions:
"""Options for annotations""" # noqa: E501
class AnnotationOptions(BaseModel):
"""Options for annotations"""
color: Union[Unset, Color] = UNSET
line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET
line_width: Union[Unset, float] = UNSET
position: Union[Unset, Point3d] = UNSET
text: Union[Unset, AnnotationTextOptions] = UNSET
color: Optional[Color] = None
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
line_ends: Optional[AnnotationLineEndOptions] = None
def to_dict(self) -> Dict[str, Any]:
color: Union[Unset, Color] = UNSET
if not isinstance(self.color, Unset):
color = self.color
line_ends: Union[Unset, AnnotationLineEndOptions] = UNSET
if not isinstance(self.line_ends, Unset):
line_ends = self.line_ends
line_width = self.line_width
position: Union[Unset, Point3d] = UNSET
if not isinstance(self.position, Unset):
position = self.position
text: Union[Unset, AnnotationTextOptions] = UNSET
if not isinstance(self.text, Unset):
text = self.text
line_width: Optional[float] = None
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if color is not UNSET:
_color: Color = cast(Color, color)
field_dict["color"] = _color.to_dict()
if line_ends is not UNSET:
_line_ends: AnnotationLineEndOptions = cast(
AnnotationLineEndOptions, line_ends
)
field_dict["line_ends"] = _line_ends.to_dict()
if line_width is not UNSET:
field_dict["line_width"] = line_width
if position is not UNSET:
_position: Point3d = cast(Point3d, position)
field_dict["position"] = _position.to_dict()
if text is not UNSET:
_text: AnnotationTextOptions = cast(AnnotationTextOptions, text)
field_dict["text"] = _text.to_dict()
position: Optional[Point3d] = None
return field_dict
@classmethod
def from_dict(cls: Type[QP], src_dict: Dict[str, Any]) -> QP:
d = src_dict.copy()
_color = d.pop("color", UNSET)
color: Union[Unset, Color]
if isinstance(_color, Unset):
color = UNSET
if _color is None:
color = UNSET
else:
color = Color.from_dict(_color)
_line_ends = d.pop("line_ends", UNSET)
line_ends: Union[Unset, AnnotationLineEndOptions]
if isinstance(_line_ends, Unset):
line_ends = UNSET
if _line_ends is None:
line_ends = UNSET
else:
line_ends = AnnotationLineEndOptions.from_dict(_line_ends)
line_width = d.pop("line_width", UNSET)
_position = d.pop("position", UNSET)
position: Union[Unset, Point3d]
if isinstance(_position, Unset):
position = UNSET
if _position is None:
position = UNSET
else:
position = Point3d.from_dict(_position)
_text = d.pop("text", UNSET)
text: Union[Unset, AnnotationTextOptions]
if isinstance(_text, Unset):
text = UNSET
if _text is None:
text = UNSET
else:
text = AnnotationTextOptions.from_dict(_text)
annotation_options = cls(
color=color,
line_ends=line_ends,
line_width=line_width,
position=position,
text=text,
)
annotation_options.additional_properties = d
return annotation_options
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
text: Optional[AnnotationTextOptions] = None

View File

@ -1,96 +1,17 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from pydantic import BaseModel
from ..models.annotation_text_alignment_x import AnnotationTextAlignmentX
from ..models.annotation_text_alignment_y import AnnotationTextAlignmentY
from ..types import UNSET, Unset
KC = TypeVar("KC", bound="AnnotationTextOptions")
@attr.s(auto_attribs=True)
class AnnotationTextOptions:
"""Options for annotation text""" # noqa: E501
class AnnotationTextOptions(BaseModel):
"""Options for annotation text"""
point_size: Union[Unset, int] = UNSET
text: Union[Unset, str] = UNSET
x: Union[Unset, AnnotationTextAlignmentX] = UNSET
y: Union[Unset, AnnotationTextAlignmentY] = UNSET
point_size: int
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
text: str
def to_dict(self) -> Dict[str, Any]:
point_size = self.point_size
text = self.text
x: Union[Unset, AnnotationTextAlignmentX] = UNSET
if not isinstance(self.x, Unset):
x = self.x
y: Union[Unset, AnnotationTextAlignmentY] = UNSET
if not isinstance(self.y, Unset):
y = self.y
x: AnnotationTextAlignmentX
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if point_size is not UNSET:
field_dict["point_size"] = point_size
if text is not UNSET:
field_dict["text"] = text
if x is not UNSET:
field_dict["x"] = x
if y is not UNSET:
field_dict["y"] = y
return field_dict
@classmethod
def from_dict(cls: Type[KC], src_dict: Dict[str, Any]) -> KC:
d = src_dict.copy()
point_size = d.pop("point_size", UNSET)
text = d.pop("text", UNSET)
_x = d.pop("x", UNSET)
x: Union[Unset, AnnotationTextAlignmentX]
if isinstance(_x, Unset):
x = UNSET
if _x is None:
x = UNSET
else:
x = _x
_y = d.pop("y", UNSET)
y: Union[Unset, AnnotationTextAlignmentY]
if isinstance(_y, Unset):
y = UNSET
if _y is None:
y = UNSET
else:
y = _y
annotation_text_options = cls(
point_size=point_size,
text=text,
x=x,
y=y,
)
annotation_text_options.additional_properties = d
return annotation_text_options
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
y: AnnotationTextAlignmentY

View File

@ -1,62 +1,11 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
HX = TypeVar("HX", bound="ApiCallQueryGroup")
from pydantic import BaseModel
@attr.s(auto_attribs=True)
class ApiCallQueryGroup:
"""A response for a query on the API call table that is grouped by something.""" # noqa: E501
count: Union[Unset, int] = UNSET
query: Union[Unset, str] = UNSET
class ApiCallQueryGroup(BaseModel):
"""A response for a query on the API call table that is grouped by something."""
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
count: int
def to_dict(self) -> Dict[str, Any]:
count = self.count
query = self.query
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if count is not UNSET:
field_dict["count"] = count
if query is not UNSET:
field_dict["query"] = query
return field_dict
@classmethod
def from_dict(cls: Type[HX], src_dict: Dict[str, Any]) -> HX:
d = src_dict.copy()
count = d.pop("count", UNSET)
query = d.pop("query", UNSET)
api_call_query_group = cls(
count=count,
query=query,
)
api_call_query_group.additional_properties = d
return api_call_query_group
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
query: str

View File

@ -1,266 +1,57 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
from typing import Optional
import attr
from dateutil.parser import isoparse
from pydantic import BaseModel
from ..models.method import Method
from ..models.uuid import Uuid
from ..types import UNSET, Unset
LB = TypeVar("LB", bound="ApiCallWithPrice")
@attr.s(auto_attribs=True)
class ApiCallWithPrice:
class ApiCallWithPrice(BaseModel):
"""An API call with the price.
This is a join of the `ApiCall` and `ApiCallPrice` tables.""" # noqa: E501
This is a join of the `ApiCall` and `ApiCallPrice` tables."""
completed_at: Union[Unset, datetime.datetime] = UNSET
created_at: Union[Unset, datetime.datetime] = UNSET
duration: Union[Unset, int] = UNSET
email: Union[Unset, str] = UNSET
endpoint: Union[Unset, str] = UNSET
id: Union[Unset, str] = UNSET
ip_address: Union[Unset, str] = UNSET
litterbox: Union[Unset, bool] = False
method: Union[Unset, Method] = UNSET
minutes: Union[Unset, int] = UNSET
origin: Union[Unset, str] = UNSET
price: Union[Unset, float] = UNSET
request_body: Union[Unset, str] = UNSET
request_query_params: Union[Unset, str] = UNSET
response_body: Union[Unset, str] = UNSET
started_at: Union[Unset, datetime.datetime] = UNSET
status_code: Union[Unset, int] = UNSET
stripe_invoice_item_id: Union[Unset, str] = UNSET
token: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_agent: Union[Unset, str] = UNSET
user_id: Union[Unset, str] = UNSET
completed_at: Optional[datetime.datetime] = None
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
created_at: datetime.datetime
def to_dict(self) -> Dict[str, Any]:
completed_at: Union[Unset, str] = UNSET
if not isinstance(self.completed_at, Unset):
completed_at = self.completed_at.isoformat()
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
duration = self.duration
email = self.email
endpoint = self.endpoint
id = self.id
ip_address = self.ip_address
litterbox = self.litterbox
method: Union[Unset, Method] = UNSET
if not isinstance(self.method, Unset):
method = self.method
minutes = self.minutes
origin = self.origin
price = self.price
request_body = self.request_body
request_query_params = self.request_query_params
response_body = self.response_body
started_at: Union[Unset, str] = UNSET
if not isinstance(self.started_at, Unset):
started_at = self.started_at.isoformat()
status_code = self.status_code
stripe_invoice_item_id = self.stripe_invoice_item_id
token = self.token
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_agent = self.user_agent
user_id = self.user_id
duration: Optional[int] = None
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if completed_at is not UNSET:
field_dict["completed_at"] = completed_at
if created_at is not UNSET:
field_dict["created_at"] = created_at
if duration is not UNSET:
field_dict["duration"] = duration
if email is not UNSET:
field_dict["email"] = email
if endpoint is not UNSET:
field_dict["endpoint"] = endpoint
if id is not UNSET:
field_dict["id"] = id
if ip_address is not UNSET:
field_dict["ip_address"] = ip_address
if litterbox is not UNSET:
field_dict["litterbox"] = litterbox
if method is not UNSET:
field_dict["method"] = method
if minutes is not UNSET:
field_dict["minutes"] = minutes
if origin is not UNSET:
field_dict["origin"] = origin
if price is not UNSET:
field_dict["price"] = price
if request_body is not UNSET:
field_dict["request_body"] = request_body
if request_query_params is not UNSET:
field_dict["request_query_params"] = request_query_params
if response_body is not UNSET:
field_dict["response_body"] = response_body
if started_at is not UNSET:
field_dict["started_at"] = started_at
if status_code is not UNSET:
field_dict["status_code"] = status_code
if stripe_invoice_item_id is not UNSET:
field_dict["stripe_invoice_item_id"] = stripe_invoice_item_id
if token is not UNSET:
field_dict["token"] = token
if updated_at is not UNSET:
field_dict["updated_at"] = updated_at
if user_agent is not UNSET:
field_dict["user_agent"] = user_agent
if user_id is not UNSET:
field_dict["user_id"] = user_id
email: Optional[str] = None
return field_dict
endpoint: Optional[str] = None
@classmethod
def from_dict(cls: Type[LB], src_dict: Dict[str, Any]) -> LB:
d = src_dict.copy()
_completed_at = d.pop("completed_at", UNSET)
completed_at: Union[Unset, datetime.datetime]
if isinstance(_completed_at, Unset):
completed_at = UNSET
else:
completed_at = isoparse(_completed_at)
id: Uuid
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
ip_address: Optional[str] = None
duration = d.pop("duration", UNSET)
litterbox: Optional[bool] = None
email = d.pop("email", UNSET)
method: Method
endpoint = d.pop("endpoint", UNSET)
minutes: Optional[int] = None
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
if _id is None:
id = UNSET
else:
id = _id
origin: Optional[str] = None
ip_address = d.pop("ip_address", UNSET)
price: Optional[float] = None
litterbox = d.pop("litterbox", UNSET)
request_body: Optional[str] = None
_method = d.pop("method", UNSET)
method: Union[Unset, Method]
if isinstance(_method, Unset):
method = UNSET
if _method is None:
method = UNSET
else:
method = _method
request_query_params: Optional[str] = None
minutes = d.pop("minutes", UNSET)
response_body: Optional[str] = None
origin = d.pop("origin", UNSET)
started_at: Optional[datetime.datetime] = None
price = d.pop("price", UNSET)
status_code: Optional[int] = None
request_body = d.pop("request_body", UNSET)
stripe_invoice_item_id: Optional[str] = None
request_query_params = d.pop("request_query_params", UNSET)
token: Uuid
response_body = d.pop("response_body", UNSET)
updated_at: datetime.datetime
_started_at = d.pop("started_at", UNSET)
started_at: Union[Unset, datetime.datetime]
if isinstance(_started_at, Unset):
started_at = UNSET
else:
started_at = isoparse(_started_at)
user_agent: str
status_code = d.pop("status_code", UNSET)
stripe_invoice_item_id = d.pop("stripe_invoice_item_id", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
if _token is None:
token = UNSET
else:
token = _token
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
user_agent = d.pop("user_agent", UNSET)
_user_id = d.pop("user_id", UNSET)
user_id: Union[Unset, Uuid]
if isinstance(_user_id, Unset):
user_id = UNSET
if _user_id is None:
user_id = UNSET
else:
user_id = _user_id
api_call_with_price = cls(
completed_at=completed_at,
created_at=created_at,
duration=duration,
email=email,
endpoint=endpoint,
id=id,
ip_address=ip_address,
litterbox=litterbox,
method=method,
minutes=minutes,
origin=origin,
price=price,
request_body=request_body,
request_query_params=request_query_params,
response_body=response_body,
started_at=started_at,
status_code=status_code,
stripe_invoice_item_id=stripe_invoice_item_id,
token=token,
updated_at=updated_at,
user_agent=user_agent,
user_id=user_id,
)
api_call_with_price.additional_properties = d
return api_call_with_price
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
user_id: Uuid

View File

@ -1,70 +1,13 @@
from typing import Any, Dict, List, Type, TypeVar, Union, cast
from typing import List, Optional
import attr
from pydantic import BaseModel
from ..types import UNSET, Unset
NE = TypeVar("NE", bound="ApiCallWithPriceResultsPage")
from ..models.api_call_with_price import ApiCallWithPrice
@attr.s(auto_attribs=True)
class ApiCallWithPriceResultsPage:
"""A single page of results""" # noqa: E501
class ApiCallWithPriceResultsPage(BaseModel):
"""A single page of results"""
from ..models.api_call_with_price import ApiCallWithPrice
items: List[ApiCallWithPrice]
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
next_page: Union[Unset, str] = UNSET
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
from ..models.api_call_with_price import ApiCallWithPrice
items: Union[Unset, List[ApiCallWithPrice]] = UNSET
if not isinstance(self.items, Unset):
items = self.items
next_page = self.next_page
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if items is not UNSET:
field_dict["items"] = items
if next_page is not UNSET:
field_dict["next_page"] = next_page
return field_dict
@classmethod
def from_dict(cls: Type[NE], src_dict: Dict[str, Any]) -> NE:
d = src_dict.copy()
from ..models.api_call_with_price import ApiCallWithPrice
items = cast(List[ApiCallWithPrice], d.pop("items", UNSET))
next_page = d.pop("next_page", UNSET)
api_call_with_price_results_page = cls(
items=items,
next_page=next_page,
)
api_call_with_price_results_page.additional_properties = d
return api_call_with_price_results_page
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
next_page: Optional[str] = None

View File

@ -1,72 +1,12 @@
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from pydantic import BaseModel
from ..models.error_code import ErrorCode
from ..types import UNSET, Unset
TL = TypeVar("TL", bound="ApiError")
@attr.s(auto_attribs=True)
class ApiError:
"""An error.""" # noqa: E501
class ApiError(BaseModel):
"""An error."""
error_code: Union[Unset, ErrorCode] = UNSET
message: Union[Unset, str] = UNSET
error_code: ErrorCode
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
error_code: Union[Unset, ErrorCode] = UNSET
if not isinstance(self.error_code, Unset):
error_code = self.error_code
message = self.message
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if error_code is not UNSET:
field_dict["error_code"] = error_code
if message is not UNSET:
field_dict["message"] = message
return field_dict
@classmethod
def from_dict(cls: Type[TL], src_dict: Dict[str, Any]) -> TL:
d = src_dict.copy()
_error_code = d.pop("error_code", UNSET)
error_code: Union[Unset, ErrorCode]
if isinstance(_error_code, Unset):
error_code = UNSET
if _error_code is None:
error_code = UNSET
else:
error_code = _error_code
message = d.pop("message", UNSET)
api_error = cls(
error_code=error_code,
message=message,
)
api_error.additional_properties = d
return api_error
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
message: str

View File

@ -1,130 +1,23 @@
import datetime
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from dateutil.parser import isoparse
from pydantic import BaseModel
from ..models.uuid import Uuid
from ..types import UNSET, Unset
MN = TypeVar("MN", bound="ApiToken")
@attr.s(auto_attribs=True)
class ApiToken:
class ApiToken(BaseModel):
"""An API token.
These are used to authenticate users with Bearer authentication.""" # noqa: E501
These are used to authenticate users with Bearer authentication."""
created_at: Union[Unset, datetime.datetime] = UNSET
id: Union[Unset, str] = UNSET
is_valid: Union[Unset, bool] = False
token: Union[Unset, str] = UNSET
updated_at: Union[Unset, datetime.datetime] = UNSET
user_id: Union[Unset, str] = UNSET
created_at: datetime.datetime
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
id: Uuid
def to_dict(self) -> Dict[str, Any]:
created_at: Union[Unset, str] = UNSET
if not isinstance(self.created_at, Unset):
created_at = self.created_at.isoformat()
id = self.id
is_valid = self.is_valid
token = self.token
updated_at: Union[Unset, str] = UNSET
if not isinstance(self.updated_at, Unset):
updated_at = self.updated_at.isoformat()
user_id = self.user_id
is_valid: bool
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update({})
if created_at is not UNSET:
field_dict["created_at"] = created_at
if id is not UNSET:
field_dict["id"] = id
if is_valid is not UNSET:
field_dict["is_valid"] = is_valid
if token is not UNSET:
field_dict["token"] = token
if updated_at is not UNSET:
field_dict["updated_at"] = updated_at
if user_id is not UNSET:
field_dict["user_id"] = user_id
token: Uuid
return field_dict
updated_at: datetime.datetime
@classmethod
def from_dict(cls: Type[MN], src_dict: Dict[str, Any]) -> MN:
d = src_dict.copy()
_created_at = d.pop("created_at", UNSET)
created_at: Union[Unset, datetime.datetime]
if isinstance(_created_at, Unset):
created_at = UNSET
else:
created_at = isoparse(_created_at)
_id = d.pop("id", UNSET)
id: Union[Unset, Uuid]
if isinstance(_id, Unset):
id = UNSET
if _id is None:
id = UNSET
else:
id = _id
is_valid = d.pop("is_valid", UNSET)
_token = d.pop("token", UNSET)
token: Union[Unset, Uuid]
if isinstance(_token, Unset):
token = UNSET
if _token is None:
token = UNSET
else:
token = _token
_updated_at = d.pop("updated_at", UNSET)
updated_at: Union[Unset, datetime.datetime]
if isinstance(_updated_at, Unset):
updated_at = UNSET
else:
updated_at = isoparse(_updated_at)
_user_id = d.pop("user_id", UNSET)
user_id: Union[Unset, Uuid]
if isinstance(_user_id, Unset):
user_id = UNSET
if _user_id is None:
user_id = UNSET
else:
user_id = _user_id
api_token = cls(
created_at=created_at,
id=id,
is_valid=is_valid,
token=token,
updated_at=updated_at,
user_id=user_id,
)
api_token.additional_properties = d
return api_token
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]
def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties
user_id: Uuid

Some files were not shown because too many files have changed in this diff Show More