Update api spec (#362)

* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
zoo-github-actions-auth[bot]
2025-01-27 13:13:12 -08:00
committed by GitHub
parent 525456428a
commit cf7e20536c
12 changed files with 931 additions and 637 deletions

View File

@ -47,6 +47,7 @@ from .cluster import Cluster
from .code_language import CodeLanguage
from .code_output import CodeOutput
from .color import Color
from .component_transform import ComponentTransform
from .connection import Connection
from .country_code import CountryCode
from .coupon import Coupon
@ -100,6 +101,7 @@ from .entity_get_sketch_paths import EntityGetSketchPaths
from .entity_linear_pattern import EntityLinearPattern
from .entity_linear_pattern_transform import EntityLinearPatternTransform
from .entity_make_helix import EntityMakeHelix
from .entity_make_helix_from_edge import EntityMakeHelixFromEdge
from .entity_make_helix_from_params import EntityMakeHelixFromParams
from .entity_mirror import EntityMirror
from .entity_mirror_across_edge import EntityMirrorAcrossEdge
@ -268,6 +270,7 @@ 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_object_transform import SetObjectTransform
from .set_scene_units import SetSceneUnits
from .set_selection_filter import SetSelectionFilter
from .set_selection_type import SetSelectionType
@ -310,6 +313,8 @@ from .text_to_cad_model import TextToCadModel
from .text_to_cad_results_page import TextToCadResultsPage
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 .unit_angle import UnitAngle
from .unit_angle_conversion import UnitAngleConversion
from .unit_area import UnitArea

View File

@ -0,0 +1,20 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.transform_by_for_point3d import TransformByForPoint3d
from ..models.transform_by_for_point4d import TransformByForPoint4d
class ComponentTransform(BaseModel):
"""Container that holds a translate, rotate and scale."""
rotate_angle_axis: Optional[TransformByForPoint4d] = None
rotate_rpy: Optional[TransformByForPoint3d] = None
scale: Optional[TransformByForPoint3d] = None
translate: Optional[TransformByForPoint3d] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -4,6 +4,4 @@ from pydantic import BaseModel, ConfigDict
class EntityMakeHelix(BaseModel):
"""The response from the `EntityMakeHelix` endpoint."""
helix_id: str
model_config = ConfigDict(protected_namespaces=())

View File

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

View File

@ -4,6 +4,4 @@ from pydantic import BaseModel, ConfigDict
class EntityMakeHelixFromParams(BaseModel):
"""The response from the `EntityMakeHelixFromParams` endpoint."""
helix_id: str
model_config = ConfigDict(protected_namespaces=())

View File

@ -9,6 +9,7 @@ from ..models.annotation_type import AnnotationType
from ..models.camera_drag_interaction_type import CameraDragInteractionType
from ..models.camera_movement import CameraMovement
from ..models.color import Color
from ..models.component_transform import ComponentTransform
from ..models.cut_type import CutType
from ..models.distance_type import DistanceType
from ..models.entity_type import EntityType
@ -442,7 +443,7 @@ class OptionEntityMakeHelixFromParams(BaseModel):
length: LengthUnit
radius: float
radius: LengthUnit
revolutions: float
@ -453,6 +454,26 @@ class OptionEntityMakeHelixFromParams(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMakeHelixFromEdge(BaseModel):
"""Create a helix using the specified parameters."""
edge_id: str
is_clockwise: bool
length: Optional[LengthUnit] = None
radius: LengthUnit
revolutions: float
start_angle: Angle = {"unit": "degrees", "value": 0.0} # type: ignore
type: Literal["entity_make_helix_from_edge"] = "entity_make_helix_from_edge"
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMirror(BaseModel):
"""Mirror the input entities over the specified axis. (Currently only supports sketches)"""
@ -1387,6 +1408,18 @@ class OptionGetNumObjects(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetObjectTransform(BaseModel):
"""Set the transform of an object."""
object_id: str
transforms: List[ComponentTransform]
type: Literal["set_object_transform"] = "set_object_transform"
model_config = ConfigDict(protected_namespaces=())
class OptionMakeOffsetPath(BaseModel):
"""Make a new path by offsetting an object by a given distance. The new path's ID will be the ID of this command."""
@ -1446,6 +1479,7 @@ ModelingCmd = RootModel[
OptionEntityCircularPattern,
OptionEntityMakeHelix,
OptionEntityMakeHelixFromParams,
OptionEntityMakeHelixFromEdge,
OptionEntityMirror,
OptionEntityMirrorAcrossEdge,
OptionSelectWithPoint,
@ -1527,6 +1561,7 @@ ModelingCmd = RootModel[
OptionSelectClear,
OptionSelectGet,
OptionGetNumObjects,
OptionSetObjectTransform,
OptionMakeOffsetPath,
OptionAddHoleFromOffset,
],

View File

@ -41,6 +41,7 @@ from ..models.entity_get_sketch_paths import EntityGetSketchPaths
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.entity_linear_pattern_transform import EntityLinearPatternTransform
from ..models.entity_make_helix import EntityMakeHelix
from ..models.entity_make_helix_from_edge import EntityMakeHelixFromEdge
from ..models.entity_make_helix_from_params import EntityMakeHelixFromParams
from ..models.entity_mirror import EntityMirror
from ..models.entity_mirror_across_edge import EntityMirrorAcrossEdge
@ -98,6 +99,7 @@ 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_object_transform import SetObjectTransform
from ..models.set_scene_units import SetSceneUnits
from ..models.set_selection_filter import SetSelectionFilter
from ..models.set_selection_type import SetSelectionType
@ -855,6 +857,16 @@ class OptionMakeOffsetPath(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionSetObjectTransform(BaseModel):
""""""
data: SetObjectTransform
type: Literal["set_object_transform"] = "set_object_transform"
model_config = ConfigDict(protected_namespaces=())
class OptionAddHoleFromOffset(BaseModel):
""""""
@ -1277,6 +1289,16 @@ class OptionEntityMakeHelixFromParams(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionEntityMakeHelixFromEdge(BaseModel):
""""""
data: EntityMakeHelixFromEdge
type: Literal["entity_make_helix_from_edge"] = "entity_make_helix_from_edge"
model_config = ConfigDict(protected_namespaces=())
class OptionSolid3DGetExtrusionFaceInfo(BaseModel):
""""""
@ -1373,6 +1395,7 @@ OkModelingCmdResponse = RootModel[
OptionViewIsometric,
OptionGetNumObjects,
OptionMakeOffsetPath,
OptionSetObjectTransform,
OptionAddHoleFromOffset,
OptionDefaultCameraFocusOn,
OptionSelectGet,
@ -1415,6 +1438,7 @@ OkModelingCmdResponse = RootModel[
OptionEntityMirrorAcrossEdge,
OptionEntityMakeHelix,
OptionEntityMakeHelixFromParams,
OptionEntityMakeHelixFromEdge,
OptionSolid3DGetExtrusionFaceInfo,
OptionExtrusionFaceInfo,
],

View File

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

View File

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class TransformByForPoint3d(str):
""""""
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

@ -0,0 +1,17 @@
from typing import Any
from pydantic import GetCoreSchemaHandler
from pydantic_core import CoreSchema, core_schema
class TransformByForPoint4d(str):
""""""
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))