Update api spec (#451)

* YOYO NEW API SPEC!

* updates

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

* I have generated the latest API!

---------

Signed-off-by: Jessie Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jessie Frazelle <github@jessfraz.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2025-06-30 11:40:48 -07:00
committed by GitHub
parent a0e3d35045
commit b70dd57f46
23 changed files with 1834 additions and 1326 deletions

View File

@ -389,9 +389,9 @@ def generateTypeAndExamplePython(
logging.error("schema: %s", json.dumps(schema, indent=4))
raise Exception("Unknown parameter type")
elif "oneOf" in schema and len(schema["oneOf"]) > 0:
one_of = schema["oneOf"][0]
if len(schema["oneOf"]) > 1:
one_of = schema["oneOf"][1]
# Choose a random one.
index = random.randint(0, len(schema["oneOf"]) - 1)
one_of = schema["oneOf"][index]
# Check if this is a nested object.
if isNestedObjectOneOf(schema):
@ -2377,7 +2377,8 @@ letters: List[str] = []
def randletter() -> str:
letter1 = chr(random.randint(ord("A"), ord("Z")))
letter2 = chr(random.randint(ord("A"), ord("Z")))
letter = letter1 + letter2
letter3 = chr(random.randint(ord("A"), ord("Z")))
letter = letter1 + letter2 + letter3
while letter in letters:
return randletter()
letters.append(letter)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,126 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.conversion_params import ConversionParams
from ...models.error import Error
from ...models.file_conversion import FileConversion
from ...types import Response
def _get_kwargs(
body: ConversionParams,
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/file/conversion".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
"content": body.model_dump_json(),
}
def _parse_response(
*, response: httpx.Response
) -> Optional[Union[FileConversion, Error]]:
if response.status_code == 201:
response_201 = FileConversion(**response.json())
return response_201
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[FileConversion, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
body: ConversionParams,
*,
client: Client,
) -> Response[Optional[Union[FileConversion, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
response = httpx.post(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
body: ConversionParams,
*,
client: Client,
) -> Optional[Union[FileConversion, Error]]:
"""This takes a HTTP multipart body with these fields in any order:
- The input and output format options (as JSON), name is 'body'. - The files to convert, in raw binary. Must supply filenames.
This starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return sync_detailed(
body=body,
client=client,
).parsed
async def asyncio_detailed(
body: ConversionParams,
*,
client: Client,
) -> Response[Optional[Union[FileConversion, Error]]]:
kwargs = _get_kwargs(
body=body,
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.post(**kwargs)
return _build_response(response=response)
async def asyncio(
body: ConversionParams,
*,
client: Client,
) -> Optional[Union[FileConversion, Error]]:
"""This takes a HTTP multipart body with these fields in any order:
- The input and output format options (as JSON), name is 'body'. - The files to convert, in raw binary. Must supply filenames.
This starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.""" # noqa: E501
return (
await asyncio_detailed(
body=body,
client=client,
)
).parsed

View File

@ -1,105 +0,0 @@
from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.error import Error
from ...models.onboarding import Onboarding
from ...types import Response
def _get_kwargs(
*,
client: Client,
) -> Dict[str, Any]:
url = "{}/user/onboarding".format(
client.base_url,
) # noqa: E501
headers: Dict[str, Any] = client.get_headers()
cookies: Dict[str, Any] = client.get_cookies()
return {
"url": url,
"headers": headers,
"cookies": cookies,
"timeout": client.get_timeout(),
}
def _parse_response(*, response: httpx.Response) -> Optional[Union[Onboarding, Error]]:
if response.status_code == 200:
response_200 = Onboarding(**response.json())
return response_200
if response.status_code == 400:
response_4XX = Error(**response.json())
return response_4XX
if response.status_code == 500:
response_5XX = Error(**response.json())
return response_5XX
return Error(**response.json())
def _build_response(
*, response: httpx.Response
) -> Response[Optional[Union[Onboarding, Error]]]:
return Response(
status_code=response.status_code,
content=response.content,
headers=response.headers,
parsed=_parse_response(response=response),
)
def sync_detailed(
*,
client: Client,
) -> Response[Optional[Union[Onboarding, Error]]]:
kwargs = _get_kwargs(
client=client,
)
response = httpx.get(
verify=client.verify_ssl,
**kwargs,
)
return _build_response(response=response)
def sync(
*,
client: Client,
) -> Optional[Union[Onboarding, Error]]:
"""Checks key part of their api usage to determine their onboarding progress""" # noqa: E501
return sync_detailed(
client=client,
).parsed
async def asyncio_detailed(
*,
client: Client,
) -> Response[Optional[Union[Onboarding, Error]]]:
kwargs = _get_kwargs(
client=client,
)
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
response = await _client.get(**kwargs)
return _build_response(response=response)
async def asyncio(
*,
client: Client,
) -> Optional[Union[Onboarding, Error]]:
"""Checks key part of their api usage to determine their onboarding progress""" # noqa: E501
return (
await asyncio_detailed(
client=client,
)
).parsed

View File

@ -30,6 +30,7 @@ from kittycad.api.executor import create_executor_term, create_file_execution
from kittycad.api.file import (
create_file_center_of_mass,
create_file_conversion,
create_file_conversion_options,
create_file_density,
create_file_mass,
create_file_surface_area,
@ -150,7 +151,6 @@ from kittycad.api.users import (
get_session_for_user,
get_user,
get_user_extended,
get_user_onboarding_self,
get_user_privacy_settings,
get_user_self,
get_user_self_extended,
@ -196,7 +196,6 @@ from kittycad.models import (
KclModel,
MlPrompt,
MlPromptResultsPage,
Onboarding,
Org,
OrgMember,
OrgMemberResultsPage,
@ -237,13 +236,17 @@ from kittycad.models.add_org_member import AddOrgMember
from kittycad.models.api_call_query_group_by import ApiCallQueryGroupBy
from kittycad.models.api_call_status import ApiCallStatus
from kittycad.models.api_token_uuid import ApiTokenUuid
from kittycad.models.base64data import Base64Data
from kittycad.models.axis import Axis
from kittycad.models.axis_direction_pair import AxisDirectionPair
from kittycad.models.billing_info import BillingInfo
from kittycad.models.client_metrics import ClientMetrics
from kittycad.models.code_language import CodeLanguage
from kittycad.models.code_option import CodeOption
from kittycad.models.conversion_params import ConversionParams
from kittycad.models.create_shortlink_request import CreateShortlinkRequest
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
from kittycad.models.crm_data import CrmData
from kittycad.models.direction import Direction
from kittycad.models.email_authentication_form import EmailAuthenticationForm
from kittycad.models.enterprise_subscription_tier_price import (
EnterpriseSubscriptionTierPrice,
@ -252,10 +255,10 @@ from kittycad.models.enterprise_subscription_tier_price import (
from kittycad.models.event import Event, OptionModelingAppEvent
from kittycad.models.file_export_format import FileExportFormat
from kittycad.models.file_import_format import FileImportFormat
from kittycad.models.idp_metadata_source import (
IdpMetadataSource,
OptionBase64EncodedXml,
)
from kittycad.models.gltf_presentation import GltfPresentation
from kittycad.models.gltf_storage import GltfStorage
from kittycad.models.idp_metadata_source import IdpMetadataSource, OptionUrl
from kittycad.models.input_format3d import InputFormat3d, OptionStl
from kittycad.models.inquiry_form import InquiryForm
from kittycad.models.inquiry_type import InquiryType
from kittycad.models.kcl_code_completion_params import KclCodeCompletionParams
@ -269,11 +272,10 @@ from kittycad.models.modeling_app_organization_subscription_tier import (
ModelingAppOrganizationSubscriptionTier,
)
from kittycad.models.org_details import OrgDetails
from kittycad.models.output_format3d import OptionGltf, OutputFormat3d
from kittycad.models.plan_interval import PlanInterval
from kittycad.models.post_effect_type import PostEffectType
from kittycad.models.privacy_settings import PrivacySettings
from kittycad.models.rtc_sdp_type import RtcSdpType
from kittycad.models.rtc_session_description import RtcSessionDescription
from kittycad.models.saml_identity_provider_create import SamlIdentityProviderCreate
from kittycad.models.service_account_uuid import ServiceAccountUuid
from kittycad.models.session_uuid import SessionUuid
@ -282,6 +284,7 @@ from kittycad.models.source_range import SourceRange
from kittycad.models.source_range_prompt import SourceRangePrompt
from kittycad.models.store_coupon_params import StoreCouponParams
from kittycad.models.subscribe import Subscribe
from kittycad.models.system import System
from kittycad.models.text_to_cad_create_body import TextToCadCreateBody
from kittycad.models.text_to_cad_iteration_body import TextToCadIterationBody
from kittycad.models.text_to_cad_multi_file_iteration_body import (
@ -308,7 +311,7 @@ from kittycad.models.update_user import UpdateUser
from kittycad.models.user_identifier import UserIdentifier
from kittycad.models.user_org_role import UserOrgRole
from kittycad.models.uuid import Uuid
from kittycad.models.web_socket_request import OptionSdpOffer
from kittycad.models.web_socket_request import OptionMetricsResponse
from kittycad.models.zoo_product_subscriptions_org_request import (
ZooProductSubscriptionsOrgRequest,
)
@ -1328,6 +1331,145 @@ async def test_create_file_center_of_mass_async():
)
@pytest.mark.skip
def test_create_file_conversion_options():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[FileConversion, Error]] = (
create_file_conversion_options.sync(
client=client,
body=ConversionParams(
output_format=OutputFormat3d(
OptionGltf(
presentation=GltfPresentation.COMPACT,
storage=GltfStorage.BINARY,
)
),
src_format=InputFormat3d(
OptionStl(
coords=System(
forward=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
up=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
),
units=UnitLength.CM,
)
),
),
)
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: FileConversion = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Union[FileConversion, Error]]] = (
create_file_conversion_options.sync_detailed(
client=client,
body=ConversionParams(
output_format=OutputFormat3d(
OptionGltf(
presentation=GltfPresentation.COMPACT,
storage=GltfStorage.BINARY,
)
),
src_format=InputFormat3d(
OptionStl(
coords=System(
forward=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
up=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
),
units=UnitLength.CM,
)
),
),
)
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_create_file_conversion_options_async():
# Create our client.
client = ClientFromEnv()
result: Optional[
Union[FileConversion, Error]
] = await create_file_conversion_options.asyncio(
client=client,
body=ConversionParams(
output_format=OutputFormat3d(
OptionGltf(
presentation=GltfPresentation.COMPACT,
storage=GltfStorage.BINARY,
)
),
src_format=InputFormat3d(
OptionStl(
coords=System(
forward=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
up=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
),
units=UnitLength.CM,
)
),
),
)
# OR run async with more info
response: Response[
Optional[Union[FileConversion, Error]]
] = await create_file_conversion_options.asyncio_detailed(
client=client,
body=ConversionParams(
output_format=OutputFormat3d(
OptionGltf(
presentation=GltfPresentation.COMPACT,
storage=GltfStorage.BINARY,
)
),
src_format=InputFormat3d(
OptionStl(
coords=System(
forward=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
up=AxisDirectionPair(
axis=Axis.Y,
direction=Direction.POSITIVE,
),
),
units=UnitLength.CM,
)
),
),
)
@pytest.mark.skip
def test_create_file_conversion():
# Create our client.
@ -3611,8 +3753,8 @@ def test_update_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3633,8 +3775,8 @@ def test_update_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3657,8 +3799,8 @@ async def test_update_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3673,8 +3815,8 @@ async def test_update_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3692,8 +3834,8 @@ def test_create_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3714,8 +3856,8 @@ def test_create_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3738,8 +3880,8 @@ async def test_create_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -3754,8 +3896,8 @@ async def test_create_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
OptionUrl(
url="<string>",
)
),
technical_contact_email="<string>",
@ -5902,49 +6044,6 @@ async def test_get_oauth2_providers_for_user_async():
)
@pytest.mark.skip
def test_get_user_onboarding_self():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[Onboarding, Error]] = get_user_onboarding_self.sync(
client=client,
)
if isinstance(result, Error) or result is None:
print(result)
raise Exception("Error in response")
body: Onboarding = result
print(body)
# OR if you need more info (e.g. status_code)
response: Response[Optional[Union[Onboarding, Error]]] = (
get_user_onboarding_self.sync_detailed(
client=client,
)
)
# OR run async
@pytest.mark.asyncio
@pytest.mark.skip
async def test_get_user_onboarding_self_async():
# Create our client.
client = ClientFromEnv()
result: Optional[Union[Onboarding, Error]] = await get_user_onboarding_self.asyncio(
client=client,
)
# OR run async with more info
response: Response[
Optional[Union[Onboarding, Error]]
] = await get_user_onboarding_self.asyncio_detailed(
client=client,
)
@pytest.mark.skip
def test_get_user_org():
# Create our client.
@ -7831,11 +7930,8 @@ def test_modeling_commands_ws():
# Send a message.
websocket.send(
WebSocketRequest(
OptionSdpOffer(
offer=RtcSessionDescription(
sdp="<string>",
type=RtcSdpType.UNSPECIFIED,
),
OptionMetricsResponse(
metrics=ClientMetrics(),
)
)
)

View File

@ -54,6 +54,7 @@ from .code_output import CodeOutput
from .color import Color
from .complementary_edges import ComplementaryEdges
from .component_transform import ComponentTransform
from .conversion_params import ConversionParams
from .country_code import CountryCode
from .coupon import Coupon
from .create_shortlink_request import CreateShortlinkRequest
@ -213,7 +214,6 @@ from .object_set_material_params_pbr import ObjectSetMaterialParamsPbr
from .object_visible import ObjectVisible
from .ok_modeling_cmd_response import OkModelingCmdResponse
from .ok_web_socket_response_data import OkWebSocketResponseData
from .onboarding import Onboarding
from .opposite_for_angle import OppositeForAngle
from .opposite_for_length_unit import OppositeForLengthUnit
from .org import Org
@ -285,7 +285,9 @@ from .session_uuid import SessionUuid
from .set_background_color import SetBackgroundColor
from .set_current_tool_properties import SetCurrentToolProperties
from .set_default_system_properties import SetDefaultSystemProperties
from .set_grid_auto_scale import SetGridAutoScale
from .set_grid_reference_plane import SetGridReferencePlane
from .set_grid_scale import SetGridScale
from .set_object_transform import SetObjectTransform
from .set_scene_units import SetSceneUnits
from .set_selection_filter import SetSelectionFilter
@ -335,6 +337,7 @@ from .token_revoke_request_form import TokenRevokeRequestForm
from .transform import Transform
from .transform_by_for_point3d import TransformByForPoint3d
from .transform_by_for_point4d import TransformByForPoint4d
from .twist_extrude import TwistExtrude
from .unit_angle import UnitAngle
from .unit_angle_conversion import UnitAngleConversion
from .unit_area import UnitArea

View File

@ -0,0 +1,14 @@
from pydantic import BaseModel, ConfigDict
from ..models.input_format3d import InputFormat3d
from ..models.output_format3d import OutputFormat3d
class ConversionParams(BaseModel):
"""Describes the file to convert (src) and what it should be converted into (output)."""
output_format: OutputFormat3d
src_format: InputFormat3d
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,4 @@ class EntityCircularPattern(BaseModel):
entity_face_edge_ids: Optional[List[FaceEdgeInfo]] = None
entity_ids: Optional[List[str]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -8,8 +8,6 @@ from ..models.face_edge_info import FaceEdgeInfo
class EntityClone(BaseModel):
"""The response from the `EntityClone` command."""
entity_ids: Optional[List[str]] = None
face_edge_ids: Optional[List[FaceEdgeInfo]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,4 @@ class EntityLinearPattern(BaseModel):
entity_face_edge_ids: Optional[List[FaceEdgeInfo]] = None
entity_ids: Optional[List[str]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,4 @@ class EntityLinearPatternTransform(BaseModel):
entity_face_edge_ids: Optional[List[FaceEdgeInfo]] = None
entity_ids: Optional[List[str]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,4 @@ class EntityMirror(BaseModel):
entity_face_edge_ids: Optional[List[FaceEdgeInfo]] = None
entity_ids: Optional[List[str]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,4 @@ class EntityMirrorAcrossEdge(BaseModel):
entity_face_edge_ids: Optional[List[FaceEdgeInfo]] = None
entity_ids: Optional[List[str]] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -102,6 +102,28 @@ class OptionExtrude(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionTwistExtrude(BaseModel):
"""Command for twist extruding a solid 2d."""
angle_step_size: Angle = {"unit": "degrees", "value": 15.0} # type: ignore
center_2d: Point2d = {"x": 0.0, "y": 0.0} # type: ignore
distance: LengthUnit
faces: Optional[ExtrudedFaceInfo] = None
target: ModelingCmdId
tolerance: LengthUnit
total_rotation_angle: Angle
type: Literal["twist_extrude"] = "twist_extrude"
model_config = ConfigDict(protected_namespaces=())
class OptionSweep(BaseModel):
"""Extrude the object along a path."""
@ -1620,6 +1642,26 @@ class OptionSetGridReferencePlane(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetGridScale(BaseModel):
"""Set the scale of the grid lines in the video feed."""
type: Literal["set_grid_scale"] = "set_grid_scale"
units: UnitLength
value: float
model_config = ConfigDict(protected_namespaces=())
class OptionSetGridAutoScale(BaseModel):
"""Set the grid lines to auto scale. The grid will get larger the further you zoom out, and smaller the more you zoom in."""
type: Literal["set_grid_auto_scale"] = "set_grid_auto_scale"
model_config = ConfigDict(protected_namespaces=())
ModelingCmd = RootModel[
Annotated[
Union[
@ -1628,6 +1670,7 @@ ModelingCmd = RootModel[
OptionMovePathPen,
OptionExtendPath,
OptionExtrude,
OptionTwistExtrude,
OptionSweep,
OptionRevolve,
OptionSolid3DShellFace,
@ -1751,6 +1794,8 @@ ModelingCmd = RootModel[
OptionMakeOffsetPath,
OptionAddHoleFromOffset,
OptionSetGridReferencePlane,
OptionSetGridScale,
OptionSetGridAutoScale,
],
Field(discriminator="type"),
]

View File

@ -114,7 +114,9 @@ from ..models.send_object import SendObject
from ..models.set_background_color import SetBackgroundColor
from ..models.set_current_tool_properties import SetCurrentToolProperties
from ..models.set_default_system_properties import SetDefaultSystemProperties
from ..models.set_grid_auto_scale import SetGridAutoScale
from ..models.set_grid_reference_plane import SetGridReferencePlane
from ..models.set_grid_scale import SetGridScale
from ..models.set_object_transform import SetObjectTransform
from ..models.set_scene_units import SetSceneUnits
from ..models.set_selection_filter import SetSelectionFilter
@ -136,6 +138,7 @@ from ..models.start_path import StartPath
from ..models.surface_area import SurfaceArea
from ..models.sweep import Sweep
from ..models.take_snapshot import TakeSnapshot
from ..models.twist_extrude import TwistExtrude
from ..models.update_annotation import UpdateAnnotation
from ..models.view_isometric import ViewIsometric
from ..models.volume import Volume
@ -200,6 +203,16 @@ class OptionExtrude(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionTwistExtrude(BaseModel):
""""""
data: TwistExtrude
type: Literal["twist_extrude"] = "twist_extrude"
model_config = ConfigDict(protected_namespaces=())
class OptionSweep(BaseModel):
""""""
@ -1506,6 +1519,26 @@ class OptionBooleanSubtract(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetGridScale(BaseModel):
""""""
data: SetGridScale
type: Literal["set_grid_scale"] = "set_grid_scale"
model_config = ConfigDict(protected_namespaces=())
class OptionSetGridAutoScale(BaseModel):
""""""
data: SetGridAutoScale
type: Literal["set_grid_auto_scale"] = "set_grid_auto_scale"
model_config = ConfigDict(protected_namespaces=())
OkModelingCmdResponse = RootModel[
Annotated[
Union[
@ -1515,6 +1548,7 @@ OkModelingCmdResponse = RootModel[
OptionMovePathPen,
OptionExtendPath,
OptionExtrude,
OptionTwistExtrude,
OptionSweep,
OptionRevolve,
OptionSolid3DShellFace,
@ -1645,6 +1679,8 @@ OkModelingCmdResponse = RootModel[
OptionBooleanUnion,
OptionBooleanIntersection,
OptionBooleanSubtract,
OptionSetGridScale,
OptionSetGridAutoScale,
],
Field(discriminator="type"),
]

View File

@ -1,16 +0,0 @@
import datetime
from typing import Optional
from pydantic import BaseModel, ConfigDict
class Onboarding(BaseModel):
"""Onboarding details"""
first_call_from_modeling_app_date: Optional[datetime.datetime] = None
first_call_from_text_to_cad_date: Optional[datetime.datetime] = None
first_token_date: Optional[datetime.datetime] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,7 @@
from pydantic import BaseModel, ConfigDict
class SetGridAutoScale(BaseModel):
"""The response from the 'SetGridScale'."""
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,7 @@
from pydantic import BaseModel, ConfigDict
class SetGridScale(BaseModel):
"""The response from the 'SetGridScale'."""
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,17 +1,20 @@
from typing import Any
from typing import Optional
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
from pydantic import BaseModel, ConfigDict
from ..models.origin_type import OriginType
from ..models.point3d import Point3d
class TransformByForPoint3d(str):
""""""
class TransformByForPoint3d(BaseModel):
"""How a property of an object should be transformed."""
def __str__(self) -> str:
return self
is_local: bool
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(str))
origin: Optional[OriginType] = None
property: Point3d
set: bool
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,17 +1,20 @@
from typing import Any
from typing import Optional
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
from pydantic import BaseModel, ConfigDict
from ..models.origin_type import OriginType
from ..models.point4d import Point4d
class TransformByForPoint4d(str):
""""""
class TransformByForPoint4d(BaseModel):
"""How a property of an object should be transformed."""
def __str__(self) -> str:
return self
is_local: bool
@classmethod
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> CoreSchema:
return core_schema.no_info_after_validator_function(cls, handler(str))
origin: Optional[OriginType] = None
property: Point4d
set: bool
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,7 @@
from pydantic import BaseModel, ConfigDict
class TwistExtrude(BaseModel):
"""The response from the `TwistExtrude` endpoint."""
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "kittycad"
version = "0.7.8"
version = "0.7.9"
description = "A client library for accessing KittyCAD"
authors = []

605
spec.json
View File

@ -2270,6 +2270,164 @@
}
}
},
"/file/conversion": {
"post": {
"tags": [
"file"
],
"summary": "Convert CAD file from one format to another.",
"description": "This takes a HTTP multipart body with these fields in any order:\n\n - The input and output format options (as JSON), name is 'body'. - The files to convert, in raw binary. Must supply filenames.\n\nThis starts a conversion job and returns the `id` of the operation. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.",
"operationId": "create_file_conversion_options",
"requestBody": {
"description": "Convert files to other formats",
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/ConversionParams"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "successful creation",
"headers": {
"Access-Control-Allow-Credentials": {
"description": "Access-Control-Allow-Credentials header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Headers": {
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Methods": {
"description": "Access-Control-Allow-Methods header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Origin": {
"description": "Access-Control-Allow-Origin header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Set-Cookie": {
"description": "Set-Cookie header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"X-Api-Call-Id": {
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FileConversion"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"options": {
"tags": [
"hidden"
],
"summary": "OPTIONS endpoint.",
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
"operationId": "options_file_conversion_options",
"responses": {
"204": {
"description": "resource updated",
"headers": {
"Access-Control-Allow-Credentials": {
"description": "Access-Control-Allow-Credentials header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Headers": {
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Methods": {
"description": "Access-Control-Allow-Methods header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Origin": {
"description": "Access-Control-Allow-Origin header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Set-Cookie": {
"description": "Set-Cookie header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"X-Api-Call-Id": {
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/file/conversion/{src_format}/{output_format}": {
"post": {
"tags": [
@ -13068,85 +13226,6 @@
}
}
},
"/user/onboarding": {
"get": {
"tags": [
"users",
"hidden"
],
"summary": "Get your user's onboarding status.",
"description": "Checks key part of their api usage to determine their onboarding progress",
"operationId": "get_user_onboarding_self",
"responses": {
"200": {
"description": "successful operation",
"headers": {
"Access-Control-Allow-Credentials": {
"description": "Access-Control-Allow-Credentials header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Headers": {
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Methods": {
"description": "Access-Control-Allow-Methods header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Access-Control-Allow-Origin": {
"description": "Access-Control-Allow-Origin header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"Set-Cookie": {
"description": "Set-Cookie header.",
"style": "simple",
"schema": {
"nullable": true,
"type": "string"
}
},
"X-Api-Call-Id": {
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
"style": "simple",
"required": true,
"schema": {
"type": "string"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Onboarding"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/user/org": {
"get": {
"tags": [
@ -20025,6 +20104,32 @@
}
}
},
"ConversionParams": {
"description": "Describes the file to convert (src) and what it should be converted into (output).",
"type": "object",
"properties": {
"output_format": {
"description": "Describes the output file(s).",
"allOf": [
{
"$ref": "#/components/schemas/OutputFormat3d"
}
]
},
"src_format": {
"description": "Describes the input file(s).",
"allOf": [
{
"$ref": "#/components/schemas/InputFormat3d"
}
]
}
},
"required": [
"output_format",
"src_format"
]
},
"CountryCode": {
"description": "An ISO-3166 alpha-2 country code. Always uppercase.",
"type": "string"
@ -20910,14 +21015,6 @@
"items": {
"$ref": "#/components/schemas/FaceEdgeInfo"
}
},
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
},
@ -20925,14 +21022,6 @@
"description": "The response from the `EntityClone` command.",
"type": "object",
"properties": {
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"face_edge_ids": {
"description": "The Face and Edge Ids of the cloned entity.",
"type": "array",
@ -21059,14 +21148,6 @@
"items": {
"$ref": "#/components/schemas/FaceEdgeInfo"
}
},
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
},
@ -21080,14 +21161,6 @@
"items": {
"$ref": "#/components/schemas/FaceEdgeInfo"
}
},
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
},
@ -21113,14 +21186,6 @@
"items": {
"$ref": "#/components/schemas/FaceEdgeInfo"
}
},
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
},
@ -21134,14 +21199,6 @@
"items": {
"$ref": "#/components/schemas/FaceEdgeInfo"
}
},
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
},
@ -24396,6 +24453,90 @@
"type"
]
},
{
"description": "Command for twist extruding a solid 2d.",
"type": "object",
"properties": {
"angle_step_size": {
"description": "Angle step interval (converted to whole number degrees and bounded between 4° and 90°)",
"default": {
"unit": "degrees",
"value": 15.0
},
"allOf": [
{
"$ref": "#/components/schemas/Angle"
}
]
},
"center_2d": {
"description": "Center to twist about (relative to 2D sketch)",
"default": {
"x": 0.0,
"y": 0.0
},
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
]
},
"distance": {
"description": "How far off the plane to extrude",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"faces": {
"nullable": true,
"description": "Which IDs should the new faces have? If this isn't given, the engine will generate IDs.",
"allOf": [
{
"$ref": "#/components/schemas/ExtrudedFaceInfo"
}
]
},
"target": {
"description": "Which sketch to extrude. Must be a closed 2D solid.",
"allOf": [
{
"$ref": "#/components/schemas/ModelingCmdId"
}
]
},
"tolerance": {
"description": "The twisted surface loft tolerance",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"total_rotation_angle": {
"description": "Total rotation of the section",
"allOf": [
{
"$ref": "#/components/schemas/Angle"
}
]
},
"type": {
"type": "string",
"enum": [
"twist_extrude"
]
}
},
"required": [
"distance",
"target",
"tolerance",
"total_rotation_angle",
"type"
]
},
{
"description": "Extrude the object along a path.",
"type": "object",
@ -28221,6 +28362,51 @@
"reference_id",
"type"
]
},
{
"description": "Set the scale of the grid lines in the video feed.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"set_grid_scale"
]
},
"units": {
"description": "Which units the `value` field uses.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
}
]
},
"value": {
"description": "Distance between grid lines represents this much distance.",
"type": "number",
"format": "float"
}
},
"required": [
"type",
"units",
"value"
]
},
{
"description": "Set the grid lines to auto scale. The grid will get larger the further you zoom out, and smaller the more you zoom in.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"set_grid_auto_scale"
]
}
},
"required": [
"type"
]
}
]
},
@ -28462,6 +28648,24 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TwistExtrude"
},
"type": {
"type": "string",
"enum": [
"twist_extrude"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
@ -30801,6 +31005,42 @@
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SetGridScale"
},
"type": {
"type": "string",
"enum": [
"set_grid_scale"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/SetGridAutoScale"
},
"type": {
"type": "string",
"enum": [
"set_grid_auto_scale"
]
}
},
"required": [
"data",
"type"
]
}
]
},
@ -31096,33 +31336,6 @@
}
]
},
"Onboarding": {
"description": "Onboarding details",
"type": "object",
"properties": {
"first_call_from_modeling_app_date": {
"nullable": true,
"title": "DateTime",
"description": "When the user first used the modeling app.",
"type": "string",
"format": "date-time"
},
"first_call_from_text_to_cad_date": {
"nullable": true,
"title": "DateTime",
"description": "When the user first used text-to-CAD.",
"type": "string",
"format": "date-time"
},
"first_token_date": {
"nullable": true,
"title": "DateTime",
"description": "When the user created their first token.",
"type": "string",
"format": "date-time"
}
}
},
"OppositeForAngle": {
"type": "string"
},
@ -33183,10 +33396,18 @@
"description": "The response from the `SetDefaultSystemProperties` endpoint.",
"type": "object"
},
"SetGridAutoScale": {
"description": "The response from the 'SetGridScale'.",
"type": "object"
},
"SetGridReferencePlane": {
"description": "The response from the 'SetGridReferencePlane'.",
"type": "object"
},
"SetGridScale": {
"description": "The response from the 'SetGridScale'.",
"type": "object"
},
"SetObjectTransform": {
"description": "The response from the `SetObjectTransform` command.",
"type": "object"
@ -34451,10 +34672,82 @@
}
},
"TransformByForPoint3d": {
"type": "string"
"description": "How a property of an object should be transformed.",
"type": "object",
"properties": {
"is_local": {
"deprecated": true,
"description": "If true, the transform is applied in local space. If false, the transform is applied in global space.",
"type": "boolean"
},
"origin": {
"nullable": true,
"description": "What to use as the origin for the transformation. If not provided, will fall back to local or global origin, depending on whatever the `is_local` field was set to.",
"allOf": [
{
"$ref": "#/components/schemas/OriginType"
}
]
},
"property": {
"description": "The scale, or rotation, or translation.",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"set": {
"description": "If true, overwrite the previous value with this. If false, the previous value will be modified. E.g. when translating, `set=true` will set a new location, and `set=false` will translate the current location by the given X/Y/Z.",
"type": "boolean"
}
},
"required": [
"is_local",
"property",
"set"
]
},
"TransformByForPoint4d": {
"type": "string"
"description": "How a property of an object should be transformed.",
"type": "object",
"properties": {
"is_local": {
"deprecated": true,
"description": "If true, the transform is applied in local space. If false, the transform is applied in global space.",
"type": "boolean"
},
"origin": {
"nullable": true,
"description": "What to use as the origin for the transformation. If not provided, will fall back to local or global origin, depending on whatever the `is_local` field was set to.",
"allOf": [
{
"$ref": "#/components/schemas/OriginType"
}
]
},
"property": {
"description": "The scale, or rotation, or translation.",
"allOf": [
{
"$ref": "#/components/schemas/Point4d"
}
]
},
"set": {
"description": "If true, overwrite the previous value with this. If false, the previous value will be modified. E.g. when translating, `set=true` will set a new location, and `set=false` will translate the current location by the given X/Y/Z.",
"type": "boolean"
}
},
"required": [
"is_local",
"property",
"set"
]
},
"TwistExtrude": {
"description": "The response from the `TwistExtrude` endpoint.",
"type": "object"
},
"UnitAngle": {
"description": "The valid types of angle formats.",