Update api spec (#220)

* 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]
2024-05-16 12:09:12 -07:00
committed by GitHub
parent dd2e3848cc
commit ca84069e9a
8 changed files with 948 additions and 805 deletions

File diff suppressed because it is too large Load Diff

View File

@ -89,6 +89,7 @@ from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage
from .extrusion_face_cap_type import ExtrusionFaceCapType
from .extrusion_face_info import ExtrusionFaceInfo
from .face_get_center import FaceGetCenter
from .face_get_gradient import FaceGetGradient
from .face_get_position import FaceGetPosition
from .face_is_planar import FaceIsPlanar

View File

@ -1,3 +1,4 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
@ -6,7 +7,7 @@ from pydantic import BaseModel, ConfigDict
class Error(BaseModel):
"""Error information from a response."""
error_code: str
error_code: Optional[str] = None
message: str

View File

@ -10,6 +10,10 @@ class ErrorCode(str, Enum):
INTERNAL_API = "internal_api"
"""# User requested something geometrically or graphically impossible. Don't retry this request, as it's inherently impossible. Instead, read the error message and change your request. """ # noqa: E501
BAD_REQUEST = "bad_request"
"""# Auth token is missing from the request """ # noqa: E501
AUTH_TOKEN_MISSING = "auth_token_missing"
"""# Auth token is invalid in some way (expired, incorrect format, etc) """ # noqa: E501
AUTH_TOKEN_INVALID = "auth_token_invalid"
"""# Client sent invalid JSON. """ # noqa: E501
INVALID_JSON = "invalid_json"
"""# Client sent invalid BSON. """ # noqa: E501

View File

@ -0,0 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.point3d import Point3d
class FaceGetCenter(BaseModel):
"""The 3D center of mass on the surface"""
pos: Point3d
model_config = ConfigDict(protected_namespaces=())

View File

@ -641,6 +641,16 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_center(BaseModel):
"""Obtains the surface \"center of mass\" """
object_id: str
type: Literal["face_get_center"] = "face_get_center"
model_config = ConfigDict(protected_namespaces=())
class face_get_gradient(BaseModel):
"""Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v"""
@ -1137,6 +1147,16 @@ class zoom_to_fit(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class view_isometric(BaseModel):
"""Fit the view to the scene with an isometric view."""
padding: Optional[float] = None
type: Literal["view_isometric"] = "view_isometric"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_extrusion_face_info(BaseModel):
"""Get a concise description of all of an extrusion's faces."""
@ -1232,6 +1252,7 @@ ModelingCmd = RootModel[
solid3d_fillet_edge,
face_is_planar,
face_get_position,
face_get_center,
face_get_gradient,
send_object,
entity_set_opacity,
@ -1275,6 +1296,7 @@ ModelingCmd = RootModel[
default_camera_set_orthographic,
default_camera_set_perspective,
zoom_to_fit,
view_isometric,
solid3d_get_extrusion_face_info,
edit_mode_exit,
select_clear,

View File

@ -22,6 +22,7 @@ from ..models.entity_get_parent_id import EntityGetParentId
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.export import Export
from ..models.extrusion_face_info import ExtrusionFaceInfo
from ..models.face_get_center import FaceGetCenter
from ..models.face_get_gradient import FaceGetGradient
from ..models.face_get_position import FaceGetPosition
from ..models.face_is_planar import FaceIsPlanar
@ -371,6 +372,16 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_center(BaseModel):
"""The response to the 'FaceGetCenter' endpoint"""
data: FaceGetCenter
type: Literal["face_get_center"] = "face_get_center"
model_config = ConfigDict(protected_namespaces=())
class face_get_gradient(BaseModel):
"""The response to the 'FaceGetGradient' endpoint"""
@ -556,6 +567,7 @@ OkModelingCmdResponse = RootModel[
curve_get_end_points,
face_is_planar,
face_get_position,
face_get_center,
face_get_gradient,
plane_intersect_and_project,
import_files,

View File

@ -15797,7 +15797,6 @@
}
},
"required": [
"error_code",
"message",
"request_id"
]
@ -15826,6 +15825,20 @@
"bad_request"
]
},
{
"description": "Auth token is missing from the request",
"type": "string",
"enum": [
"auth_token_missing"
]
},
{
"description": "Auth token is invalid in some way (expired, incorrect format, etc)",
"type": "string",
"enum": [
"auth_token_invalid"
]
},
{
"description": "Client sent invalid JSON.",
"type": "string",
@ -16164,6 +16177,23 @@
"cap"
]
},
"FaceGetCenter": {
"description": "The 3D center of mass on the surface",
"type": "object",
"properties": {
"pos": {
"description": "The 3D position on the surface center of mass",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"pos"
]
},
"FaceGetGradient": {
"description": "The gradient (dFdu, dFdv) + normal vector on a brep face",
"type": "object",
@ -20089,6 +20119,27 @@
"uv"
]
},
{
"description": "Obtains the surface \"center of mass\"",
"type": "object",
"properties": {
"object_id": {
"description": "Which face is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"face_get_center"
]
}
},
"required": [
"object_id",
"type"
]
},
{
"description": "Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v",
"type": "object",
@ -21302,6 +21353,27 @@
"type"
]
},
{
"description": "Fit the view to the scene with an isometric view.",
"type": "object",
"properties": {
"padding": {
"description": "How much to pad the view frame by.",
"default": 0.0,
"type": "number",
"format": "float"
},
"type": {
"type": "string",
"enum": [
"view_isometric"
]
}
},
"required": [
"type"
]
},
{
"description": "Get a concise description of all of an extrusion's faces.",
"type": "object",
@ -22086,6 +22158,25 @@
"type"
]
},
{
"description": "The response to the 'FaceGetCenter' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FaceGetCenter"
},
"type": {
"type": "string",
"enum": [
"face_get_center"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'FaceGetGradient' endpoint",
"type": "object",