Update api spec (#418)

* 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-04-10 20:13:22 -07:00
committed by GitHub
parent 583d5636aa
commit 71dc1e9e00
10 changed files with 1322 additions and 919 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,9 @@ from .axis_direction_pair import AxisDirectionPair
from .batch_response import BatchResponse
from .billing_info import BillingInfo
from .block_reason import BlockReason
from .boolean_intersection import BooleanIntersection
from .boolean_subtract import BooleanSubtract
from .boolean_union import BooleanUnion
from .cache_metadata import CacheMetadata
from .camera_drag_end import CameraDragEnd
from .camera_drag_interaction_type import CameraDragInteractionType
@ -214,6 +217,8 @@ 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
from .org_details import OrgDetails
from .org_member import OrgMember

View File

@ -0,0 +1,11 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class BooleanIntersection(BaseModel):
"""The response from the 'BooleanIntersection'."""
extra_solid_ids: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,11 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class BooleanSubtract(BaseModel):
"""The response from the 'BooleanSubtract'."""
extra_solid_ids: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,11 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class BooleanUnion(BaseModel):
"""The response from the 'BooleanUnion'."""
extra_solid_ids: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -20,6 +20,8 @@ from ..models.import_file import ImportFile
from ..models.input_format3d import InputFormat3d
from ..models.length_unit import LengthUnit
from ..models.modeling_cmd_id import ModelingCmdId
from ..models.opposite_for_angle import OppositeForAngle
from ..models.opposite_for_length_unit import OppositeForLengthUnit
from ..models.output_format2d import OutputFormat2d
from ..models.output_format3d import OutputFormat3d
from ..models.path_component_constraint_bound import PathComponentConstraintBound
@ -89,6 +91,8 @@ class OptionExtrude(BaseModel):
faces: Optional[ExtrudedFaceInfo] = None
opposite: OppositeForLengthUnit = "None" # type: ignore
target: ModelingCmdId
type: Literal["extrude"] = "extrude"
@ -121,6 +125,8 @@ class OptionRevolve(BaseModel):
axis_is_2d: bool
opposite: OppositeForAngle = "None" # type: ignore
origin: Point3d
target: ModelingCmdId
@ -155,6 +161,8 @@ class OptionRevolveAboutEdge(BaseModel):
edge_id: str
opposite: OppositeForAngle = "None" # type: ignore
target: ModelingCmdId
tolerance: LengthUnit
@ -1514,6 +1522,44 @@ class OptionSetObjectTransform(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanUnion(BaseModel):
"""Create a new solid from combining other smaller solids. In other words, every part of the input solids will be included in the output solid."""
solid_ids: List[str]
tolerance: LengthUnit
type: Literal["boolean_union"] = "boolean_union"
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanIntersection(BaseModel):
"""Create a new solid from intersecting several other solids. In other words, the part of the input solids where they all overlap will be the output solid."""
solid_ids: List[str]
tolerance: LengthUnit
type: Literal["boolean_intersection"] = "boolean_intersection"
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanSubtract(BaseModel):
"""Create a new solid from subtracting several other solids. The 'target' is what will be cut from. The 'tool' is what will be cut out from 'target'."""
target_ids: List[str]
tolerance: LengthUnit
tool_ids: List[str]
type: Literal["boolean_subtract"] = "boolean_subtract"
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."""
@ -1676,6 +1722,9 @@ ModelingCmd = RootModel[
OptionSelectGet,
OptionGetNumObjects,
OptionSetObjectTransform,
OptionBooleanUnion,
OptionBooleanIntersection,
OptionBooleanSubtract,
OptionMakeOffsetPath,
OptionAddHoleFromOffset,
OptionSetGridReferencePlane,

View File

@ -4,6 +4,9 @@ from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
from ..models.add_hole_from_offset import AddHoleFromOffset
from ..models.boolean_intersection import BooleanIntersection
from ..models.boolean_subtract import BooleanSubtract
from ..models.boolean_union import BooleanUnion
from ..models.camera_drag_end import CameraDragEnd
from ..models.camera_drag_move import CameraDragMove
from ..models.camera_drag_start import CameraDragStart
@ -1418,6 +1421,36 @@ class OptionSetGridReferencePlane(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanUnion(BaseModel):
""""""
data: BooleanUnion
type: Literal["boolean_union"] = "boolean_union"
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanIntersection(BaseModel):
""""""
data: BooleanIntersection
type: Literal["boolean_intersection"] = "boolean_intersection"
model_config = ConfigDict(protected_namespaces=())
class OptionBooleanSubtract(BaseModel):
""""""
data: BooleanSubtract
type: Literal["boolean_subtract"] = "boolean_subtract"
model_config = ConfigDict(protected_namespaces=())
OkModelingCmdResponse = RootModel[
Annotated[
Union[
@ -1549,6 +1582,9 @@ OkModelingCmdResponse = RootModel[
OptionSolid3DGetExtrusionFaceInfo,
OptionExtrusionFaceInfo,
OptionSetGridReferencePlane,
OptionBooleanUnion,
OptionBooleanIntersection,
OptionBooleanSubtract,
],
Field(discriminator="type"),
]

View File

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

246
spec.json
View File

@ -16988,6 +16988,57 @@
}
]
},
"BooleanIntersection": {
"description": "The response from the 'BooleanIntersection'.",
"type": "object",
"properties": {
"extra_solid_ids": {
"description": "If the operation produced just one solid, then its ID will be the ID of the modeling command request. But if any extra solids are produced, then their IDs will be included here.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"required": [
"extra_solid_ids"
]
},
"BooleanSubtract": {
"description": "The response from the 'BooleanSubtract'.",
"type": "object",
"properties": {
"extra_solid_ids": {
"description": "If the operation produced just one solid, then its ID will be the ID of the modeling command request. But if any extra solids are produced, then their IDs will be included here.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"required": [
"extra_solid_ids"
]
},
"BooleanUnion": {
"description": "The response from the 'BooleanUnion'.",
"type": "object",
"properties": {
"extra_solid_ids": {
"description": "If the operation produced just one solid, then its ID will be the ID of the modeling command request. But if any extra solids are produced, then their IDs will be included here.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"required": [
"extra_solid_ids"
]
},
"CacheMetadata": {
"description": "Metadata about our cache.\n\nThis is mostly used for internal purposes and debugging.",
"type": "object",
@ -22264,6 +22315,15 @@
}
]
},
"opposite": {
"description": "Should the extrusion also extrude in the opposite direction? If so, this specifies its distance.",
"default": "None",
"allOf": [
{
"$ref": "#/components/schemas/OppositeForLengthUnit"
}
]
},
"target": {
"description": "Which sketch to extrude. Must be a closed 2D solid.",
"allOf": [
@ -22356,6 +22416,15 @@
"description": "If true, the axis is interpreted within the 2D space of the solid 2D's plane",
"type": "boolean"
},
"opposite": {
"description": "Should the revolution also revolve in the opposite direction along the given axis? If so, this specifies its angle.",
"default": "None",
"allOf": [
{
"$ref": "#/components/schemas/OppositeForAngle"
}
]
},
"origin": {
"description": "The origin of the extrusion axis",
"allOf": [
@ -22458,6 +22527,15 @@
"type": "string",
"format": "uuid"
},
"opposite": {
"description": "Should the revolution also revolve in the opposite direction along the given axis? If so, this specifies its angle.",
"default": "None",
"allOf": [
{
"$ref": "#/components/schemas/OppositeForAngle"
}
]
},
"target": {
"description": "Which sketch to revolve. Must be a closed 2D solid.",
"allOf": [
@ -25829,6 +25907,114 @@
"type"
]
},
{
"description": "Create a new solid from combining other smaller solids. In other words, every part of the input solids will be included in the output solid.",
"type": "object",
"properties": {
"solid_ids": {
"description": "Which solids to union together. Cannot be empty.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"tolerance": {
"description": "The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"type": {
"type": "string",
"enum": [
"boolean_union"
]
}
},
"required": [
"solid_ids",
"tolerance",
"type"
]
},
{
"description": "Create a new solid from intersecting several other solids. In other words, the part of the input solids where they all overlap will be the output solid.",
"type": "object",
"properties": {
"solid_ids": {
"description": "Which solids to intersect together",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"tolerance": {
"description": "The maximum acceptable surface gap computed between the joined solids. Must be positive (i.e. greater than zero).",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"type": {
"type": "string",
"enum": [
"boolean_intersection"
]
}
},
"required": [
"solid_ids",
"tolerance",
"type"
]
},
{
"description": "Create a new solid from subtracting several other solids. The 'target' is what will be cut from. The 'tool' is what will be cut out from 'target'.",
"type": "object",
"properties": {
"target_ids": {
"description": "Geometry to cut out from.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"tolerance": {
"description": "The maximum acceptable surface gap computed between the target and the solids cut out from it. Must be positive (i.e. greater than zero).",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"tool_ids": {
"description": "Will be cut out from the 'target'.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"type": {
"type": "string",
"enum": [
"boolean_subtract"
]
}
},
"required": [
"target_ids",
"tolerance",
"tool_ids",
"type"
]
},
{
"description": "Make a new path by offsetting an object by a given distance. The new path's ID will be the ID of this command.",
"type": "object",
@ -28352,6 +28538,60 @@
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BooleanUnion"
},
"type": {
"type": "string",
"enum": [
"boolean_union"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BooleanIntersection"
},
"type": {
"type": "string",
"enum": [
"boolean_intersection"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/BooleanSubtract"
},
"type": {
"type": "string",
"enum": [
"boolean_subtract"
]
}
},
"required": [
"data",
"type"
]
}
]
},
@ -28646,6 +28886,12 @@
}
}
},
"OppositeForAngle": {
"type": "string"
},
"OppositeForLengthUnit": {
"type": "string"
},
"Org": {
"description": "An organization.",
"type": "object",