2023-11-29 10:32:31 -08:00
from typing import Literal , Union
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
from pydantic import BaseModel , Field , RootModel
from typing_extensions import Annotated
2023-08-16 16:31:50 -07:00
2023-09-29 15:51:03 -07:00
from . . models . center_of_mass import CenterOfMass
2023-08-30 15:59:51 -07:00
from . . models . curve_get_control_points import CurveGetControlPoints
2023-09-29 15:51:03 -07:00
from . . models . curve_get_end_points import CurveGetEndPoints
2023-08-30 15:59:51 -07:00
from . . models . curve_get_type import CurveGetType
2023-09-29 15:51:03 -07:00
from . . models . density import Density
2023-08-30 15:59:51 -07:00
from . . models . entity_get_all_child_uuids import EntityGetAllChildUuids
from . . models . entity_get_child_uuid import EntityGetChildUuid
from . . models . entity_get_num_children import EntityGetNumChildren
from . . models . entity_get_parent_id import EntityGetParentId
from . . models . export import Export
from . . models . get_entity_type import GetEntityType
2023-10-12 09:02:59 -07:00
from . . models . get_sketch_mode_plane import GetSketchModePlane
2023-08-30 15:59:51 -07:00
from . . models . highlight_set_entity import HighlightSetEntity
2023-09-29 15:51:03 -07:00
from . . models . import_files import ImportFiles
from . . models . mass import Mass
2023-08-30 15:59:51 -07:00
from . . models . mouse_click import MouseClick
2023-09-29 15:51:03 -07:00
from . . models . path_get_curve_uuids_for_vertices import PathGetCurveUuidsForVertices
2023-08-30 15:59:51 -07:00
from . . models . path_get_info import PathGetInfo
2023-10-17 15:35:56 -07:00
from . . models . path_get_vertex_uuids import PathGetVertexUuids
2023-09-29 15:51:03 -07:00
from . . models . plane_intersect_and_project import PlaneIntersectAndProject
2023-08-30 15:59:51 -07:00
from . . models . select_get import SelectGet
from . . models . select_with_point import SelectWithPoint
from . . models . solid3d_get_all_edge_faces import Solid3dGetAllEdgeFaces
from . . models . solid3d_get_all_opposite_edges import Solid3dGetAllOppositeEdges
from . . models . solid3d_get_next_adjacent_edge import Solid3dGetNextAdjacentEdge
from . . models . solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from . . models . solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
2023-09-29 15:51:03 -07:00
from . . models . surface_area import SurfaceArea
2023-08-30 15:59:51 -07:00
from . . models . take_snapshot import TakeSnapshot
2023-09-29 15:51:03 -07:00
from . . models . volume import Volume
2023-08-16 16:31:50 -07:00
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
class empty ( BaseModel ) :
""" An empty response, used for any command that does not explicitly have a response defined here. """
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " empty " ] = " empty "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class export ( BaseModel ) :
""" The response from the `Export` command. When this is being performed over a websocket, this is sent as binary not JSON. The binary data can be deserialized as `bincode` into a `Vec<ExportFile>`. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Export
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " export " ] = " export "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class select_with_point ( BaseModel ) :
""" The response from the `SelectWithPoint` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : SelectWithPoint
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " select_with_point " ] = " select_with_point "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class highlight_set_entity ( BaseModel ) :
""" The response from the `HighlightSetEntity` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : HighlightSetEntity
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " highlight_set_entity " ] = " highlight_set_entity "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_child_uuid ( BaseModel ) :
""" The response from the `EntityGetChildUuid` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : EntityGetChildUuid
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_child_uuid " ] = " entity_get_child_uuid "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_num_children ( BaseModel ) :
""" The response from the `EntityGetNumChildren` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : EntityGetNumChildren
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_num_children " ] = " entity_get_num_children "
2023-08-16 16:31:50 -07:00
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_parent_id ( BaseModel ) :
""" The response from the `EntityGetParentId` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : EntityGetParentId
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_parent_id " ] = " entity_get_parent_id "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_all_child_uuids ( BaseModel ) :
""" The response from the `EntityGetAllChildUuids` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : EntityGetAllChildUuids
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_all_child_uuids " ] = " entity_get_all_child_uuids "
2023-08-16 16:31:50 -07:00
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
class select_get ( BaseModel ) :
""" The response from the `SelectGet` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : SelectGet
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " select_get " ] = " select_get "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class get_entity_type ( BaseModel ) :
""" The response from the `GetEntityType` command. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
data : GetEntityType
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " get_entity_type " ] = " get_entity_type "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_all_edge_faces ( BaseModel ) :
""" The response from the `Solid3dGetAllEdgeFaces` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Solid3dGetAllEdgeFaces
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_all_edge_faces " ] = " solid3d_get_all_edge_faces "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_all_opposite_edges ( BaseModel ) :
""" The response from the `Solid3dGetAllOppositeEdges` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Solid3dGetAllOppositeEdges
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_all_opposite_edges " ] = " solid3d_get_all_opposite_edges "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_opposite_edge ( BaseModel ) :
""" The response from the `Solid3dGetOppositeEdge` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Solid3dGetOppositeEdge
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_opposite_edge " ] = " solid3d_get_opposite_edge "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_prev_adjacent_edge ( BaseModel ) :
""" The response from the `Solid3dGetPrevAdjacentEdge` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Solid3dGetPrevAdjacentEdge
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_prev_adjacent_edge " ] = " solid3d_get_prev_adjacent_edge "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_next_adjacent_edge ( BaseModel ) :
""" The response from the `Solid3dGetNextAdjacentEdge` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : Solid3dGetNextAdjacentEdge
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_next_adjacent_edge " ] = " solid3d_get_next_adjacent_edge "
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
class mouse_click ( BaseModel ) :
""" The response from the `MouseClick` command. """
2023-08-16 16:31:50 -07:00
2023-11-28 23:50:50 -08:00
data : MouseClick
2023-08-16 16:31:50 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " mouse_click " ] = " mouse_click "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_type ( BaseModel ) :
""" The response from the `CurveGetType` command. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
data : CurveGetType
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_type " ] = " curve_get_type "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_control_points ( BaseModel ) :
""" The response from the `CurveGetControlPoints` command. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
data : CurveGetControlPoints
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_control_points " ] = " curve_get_control_points "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class take_snapshot ( BaseModel ) :
""" The response from the `Take Snapshot` command. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
data : TakeSnapshot
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " take_snapshot " ] = " take_snapshot "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class path_get_info ( BaseModel ) :
""" The response from the `Path Get Info` command. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
data : PathGetInfo
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " path_get_info " ] = " path_get_info "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class path_get_curve_uuids_for_vertices ( BaseModel ) :
""" The response from the `Path Get Curve UUIDs for Vertices` command. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
data : PathGetCurveUuidsForVertices
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [
" path_get_curve_uuids_for_vertices "
] = " path_get_curve_uuids_for_vertices "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class path_get_vertex_uuids ( BaseModel ) :
""" The response from the `Path Get Vertex UUIDs` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : PathGetVertexUuids
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " path_get_vertex_uuids " ] = " path_get_vertex_uuids "
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
class plane_intersect_and_project ( BaseModel ) :
""" The response from the `PlaneIntersectAndProject` command. """
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
data : PlaneIntersectAndProject
2023-10-17 15:35:56 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " plane_intersect_and_project " ] = " plane_intersect_and_project "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_end_points ( BaseModel ) :
""" The response from the `CurveGetEndPoints` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : CurveGetEndPoints
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_end_points " ] = " curve_get_end_points "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class import_files ( BaseModel ) :
""" The response from the `ImportFiles` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : ImportFiles
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " import_files " ] = " import_files "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class mass ( BaseModel ) :
""" The response from the `Mass` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : Mass
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " mass " ] = " mass "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class volume ( BaseModel ) :
""" The response from the `Volume` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : Volume
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " volume " ] = " volume "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class density ( BaseModel ) :
""" The response from the `Density` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : Density
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " density " ] = " density "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class surface_area ( BaseModel ) :
""" The response from the `SurfaceArea` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : SurfaceArea
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " surface_area " ] = " surface_area "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class center_of_mass ( BaseModel ) :
""" The response from the `CenterOfMass` command. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
data : CenterOfMass
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " center_of_mass " ] = " center_of_mass "
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
class get_sketch_mode_plane ( BaseModel ) :
""" The response from the `GetSketchModePlane` command. """
2023-10-12 09:02:59 -07:00
2023-11-28 23:50:50 -08:00
data : GetSketchModePlane
2023-10-12 09:02:59 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " get_sketch_mode_plane " ] = " get_sketch_mode_plane "
2023-11-27 16:01:20 -08:00
2023-11-29 00:39:14 -08:00
OkModelingCmdResponse = RootModel [
2023-11-29 10:32:31 -08:00
Annotated [
Union [
empty ,
export ,
select_with_point ,
highlight_set_entity ,
entity_get_child_uuid ,
entity_get_num_children ,
entity_get_parent_id ,
entity_get_all_child_uuids ,
select_get ,
get_entity_type ,
solid3d_get_all_edge_faces ,
solid3d_get_all_opposite_edges ,
solid3d_get_opposite_edge ,
solid3d_get_prev_adjacent_edge ,
solid3d_get_next_adjacent_edge ,
mouse_click ,
curve_get_type ,
curve_get_control_points ,
take_snapshot ,
path_get_info ,
path_get_curve_uuids_for_vertices ,
path_get_vertex_uuids ,
plane_intersect_and_project ,
curve_get_end_points ,
import_files ,
mass ,
volume ,
density ,
surface_area ,
center_of_mass ,
get_sketch_mode_plane ,
] ,
Field ( discriminator = " type " ) ,
2023-11-28 14:29:16 -08:00
]
2023-11-29 00:39:14 -08:00
]