Skip to content

Commit 71dc1e9

Browse files
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>
1 parent 583d563 commit 71dc1e9

10 files changed

+811
-408
lines changed

kittycad.py.patch.json

Lines changed: 408 additions & 408 deletions
Large diffs are not rendered by default.

kittycad/models/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
from .batch_response import BatchResponse
3434
from .billing_info import BillingInfo
3535
from .block_reason import BlockReason
36+
from .boolean_intersection import BooleanIntersection
37+
from .boolean_subtract import BooleanSubtract
38+
from .boolean_union import BooleanUnion
3639
from .cache_metadata import CacheMetadata
3740
from .camera_drag_end import CameraDragEnd
3841
from .camera_drag_interaction_type import CameraDragInteractionType
@@ -214,6 +217,8 @@
214217
from .ok_modeling_cmd_response import OkModelingCmdResponse
215218
from .ok_web_socket_response_data import OkWebSocketResponseData
216219
from .onboarding import Onboarding
220+
from .opposite_for_angle import OppositeForAngle
221+
from .opposite_for_length_unit import OppositeForLengthUnit
217222
from .org import Org
218223
from .org_details import OrgDetails
219224
from .org_member import OrgMember
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List
2+
3+
from pydantic import BaseModel, ConfigDict
4+
5+
6+
class BooleanIntersection(BaseModel):
7+
"""The response from the 'BooleanIntersection'."""
8+
9+
extra_solid_ids: List[str]
10+
11+
model_config = ConfigDict(protected_namespaces=())

kittycad/models/boolean_subtract.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List
2+
3+
from pydantic import BaseModel, ConfigDict
4+
5+
6+
class BooleanSubtract(BaseModel):
7+
"""The response from the 'BooleanSubtract'."""
8+
9+
extra_solid_ids: List[str]
10+
11+
model_config = ConfigDict(protected_namespaces=())

kittycad/models/boolean_union.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import List
2+
3+
from pydantic import BaseModel, ConfigDict
4+
5+
6+
class BooleanUnion(BaseModel):
7+
"""The response from the 'BooleanUnion'."""
8+
9+
extra_solid_ids: List[str]
10+
11+
model_config = ConfigDict(protected_namespaces=())

kittycad/models/modeling_cmd.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from ..models.input_format3d import InputFormat3d
2121
from ..models.length_unit import LengthUnit
2222
from ..models.modeling_cmd_id import ModelingCmdId
23+
from ..models.opposite_for_angle import OppositeForAngle
24+
from ..models.opposite_for_length_unit import OppositeForLengthUnit
2325
from ..models.output_format2d import OutputFormat2d
2426
from ..models.output_format3d import OutputFormat3d
2527
from ..models.path_component_constraint_bound import PathComponentConstraintBound
@@ -89,6 +91,8 @@ class OptionExtrude(BaseModel):
8991

9092
faces: Optional[ExtrudedFaceInfo] = None
9193

94+
opposite: OppositeForLengthUnit = "None" # type: ignore
95+
9296
target: ModelingCmdId
9397

9498
type: Literal["extrude"] = "extrude"
@@ -121,6 +125,8 @@ class OptionRevolve(BaseModel):
121125

122126
axis_is_2d: bool
123127

128+
opposite: OppositeForAngle = "None" # type: ignore
129+
124130
origin: Point3d
125131

126132
target: ModelingCmdId
@@ -155,6 +161,8 @@ class OptionRevolveAboutEdge(BaseModel):
155161

156162
edge_id: str
157163

164+
opposite: OppositeForAngle = "None" # type: ignore
165+
158166
target: ModelingCmdId
159167

160168
tolerance: LengthUnit
@@ -1514,6 +1522,44 @@ class OptionSetObjectTransform(BaseModel):
15141522
model_config = ConfigDict(protected_namespaces=())
15151523

15161524

1525+
class OptionBooleanUnion(BaseModel):
1526+
"""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."""
1527+
1528+
solid_ids: List[str]
1529+
1530+
tolerance: LengthUnit
1531+
1532+
type: Literal["boolean_union"] = "boolean_union"
1533+
1534+
model_config = ConfigDict(protected_namespaces=())
1535+
1536+
1537+
class OptionBooleanIntersection(BaseModel):
1538+
"""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."""
1539+
1540+
solid_ids: List[str]
1541+
1542+
tolerance: LengthUnit
1543+
1544+
type: Literal["boolean_intersection"] = "boolean_intersection"
1545+
1546+
model_config = ConfigDict(protected_namespaces=())
1547+
1548+
1549+
class OptionBooleanSubtract(BaseModel):
1550+
"""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'."""
1551+
1552+
target_ids: List[str]
1553+
1554+
tolerance: LengthUnit
1555+
1556+
tool_ids: List[str]
1557+
1558+
type: Literal["boolean_subtract"] = "boolean_subtract"
1559+
1560+
model_config = ConfigDict(protected_namespaces=())
1561+
1562+
15171563
class OptionMakeOffsetPath(BaseModel):
15181564
"""Make a new path by offsetting an object by a given distance. The new path's ID will be the ID of this command."""
15191565

@@ -1676,6 +1722,9 @@ class OptionSetGridReferencePlane(BaseModel):
16761722
OptionSelectGet,
16771723
OptionGetNumObjects,
16781724
OptionSetObjectTransform,
1725+
OptionBooleanUnion,
1726+
OptionBooleanIntersection,
1727+
OptionBooleanSubtract,
16791728
OptionMakeOffsetPath,
16801729
OptionAddHoleFromOffset,
16811730
OptionSetGridReferencePlane,

kittycad/models/ok_modeling_cmd_response.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from typing_extensions import Annotated
55

66
from ..models.add_hole_from_offset import AddHoleFromOffset
7+
from ..models.boolean_intersection import BooleanIntersection
8+
from ..models.boolean_subtract import BooleanSubtract
9+
from ..models.boolean_union import BooleanUnion
710
from ..models.camera_drag_end import CameraDragEnd
811
from ..models.camera_drag_move import CameraDragMove
912
from ..models.camera_drag_start import CameraDragStart
@@ -1418,6 +1421,36 @@ class OptionSetGridReferencePlane(BaseModel):
14181421
model_config = ConfigDict(protected_namespaces=())
14191422

14201423

1424+
class OptionBooleanUnion(BaseModel):
1425+
""""""
1426+
1427+
data: BooleanUnion
1428+
1429+
type: Literal["boolean_union"] = "boolean_union"
1430+
1431+
model_config = ConfigDict(protected_namespaces=())
1432+
1433+
1434+
class OptionBooleanIntersection(BaseModel):
1435+
""""""
1436+
1437+
data: BooleanIntersection
1438+
1439+
type: Literal["boolean_intersection"] = "boolean_intersection"
1440+
1441+
model_config = ConfigDict(protected_namespaces=())
1442+
1443+
1444+
class OptionBooleanSubtract(BaseModel):
1445+
""""""
1446+
1447+
data: BooleanSubtract
1448+
1449+
type: Literal["boolean_subtract"] = "boolean_subtract"
1450+
1451+
model_config = ConfigDict(protected_namespaces=())
1452+
1453+
14211454
OkModelingCmdResponse = RootModel[
14221455
Annotated[
14231456
Union[
@@ -1549,6 +1582,9 @@ class OptionSetGridReferencePlane(BaseModel):
15491582
OptionSolid3DGetExtrusionFaceInfo,
15501583
OptionExtrusionFaceInfo,
15511584
OptionSetGridReferencePlane,
1585+
OptionBooleanUnion,
1586+
OptionBooleanIntersection,
1587+
OptionBooleanSubtract,
15521588
],
15531589
Field(discriminator="type"),
15541590
]

kittycad/models/opposite_for_angle.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from typing import Any
2+
3+
from pydantic import GetCoreSchemaHandler
4+
from pydantic_core import CoreSchema, core_schema
5+
6+
7+
class OppositeForAngle(str):
8+
""""""
9+
10+
def __str__(self) -> str:
11+
return self
12+
13+
@classmethod
14+
def __get_pydantic_core_schema__(
15+
cls, source_type: Any, handler: GetCoreSchemaHandler
16+
) -> CoreSchema:
17+
return core_schema.no_info_after_validator_function(cls, handler(str))
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from typing import Any
2+
3+
from pydantic import GetCoreSchemaHandler
4+
from pydantic_core import CoreSchema, core_schema
5+
6+
7+
class OppositeForLengthUnit(str):
8+
""""""
9+
10+
def __str__(self) -> str:
11+
return self
12+
13+
@classmethod
14+
def __get_pydantic_core_schema__(
15+
cls, source_type: Any, handler: GetCoreSchemaHandler
16+
) -> CoreSchema:
17+
return core_schema.no_info_after_validator_function(cls, handler(str))

0 commit comments

Comments
 (0)