Proper class names (#272)

* towards proper class names

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mypy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jess Frazelle
2024-09-10 15:24:19 -07:00
committed by GitHub
parent 65d40767fa
commit 4ee77bb1cf
21 changed files with 1286 additions and 1266 deletions

View File

@ -412,7 +412,7 @@ def generateTypeAndExamplePython(
and "enum" in one_of["properties"]["type"]
):
return generateTypeAndExamplePython(
one_of["properties"]["type"]["enum"][0],
snake_to_title("option_" + one_of["properties"]["type"]["enum"][0]),
one_of,
data,
camel_to_snake(name),
@ -1508,7 +1508,7 @@ def generateUnionType(
else:
template_info["types"].append(
{
"name": rename_if_keyword(type),
"name": snake_to_title(type),
"var0": randletter(),
"var1": randletter(),
"check": "type",
@ -1625,27 +1625,37 @@ def generateOneOfType(path: str, name: str, schema: dict, data: dict):
f.write(content_code)
f.write("\n")
object_code = generateObjectTypeCode(
object_name, one_of, "object", data, tag, content
object_name, one_of, "object", data, tag, content, True
)
f.write(object_code)
f.write("\n")
all_options.append(object_name)
all_options.append("option_" + object_name)
elif tag is not None:
# Generate each of the options from the tag.
for one_of in schema["oneOf"]:
# Get the value of the tag.
object_name = one_of["properties"][tag]["enum"][0]
object_code = generateObjectTypeCode(
object_name,
one_of,
object_name, one_of, "object", data, tag, None, True
)
f.write(object_code)
f.write("\n")
all_options.append("option_" + object_name)
elif schema["oneOf"].__len__() == 1:
description = getOneOfDescription(schema)
object_code = generateObjectTypeCode(
name,
schema["oneOf"][0],
"object",
data,
tag,
None,
None,
)
f.write(object_code)
f.write("\n")
all_options.append(object_name)
f.close()
# return early.
return
else:
# Generate each of the options from the tag.
i = 0
@ -1688,6 +1698,7 @@ def generateObjectTypeCode(
data: dict,
tag: Optional[str],
content: Optional[str],
is_option: bool = False,
) -> str:
FieldType = TypedDict(
"FieldType",
@ -1765,10 +1776,13 @@ def generateObjectTypeCode(
}
fields.append(field2)
name = snake_to_title(name)
if is_option:
name = "Option" + name
template_info: TemplateType = {
"fields": fields,
"description": description,
"name": rename_if_keyword(name),
"name": name,
"imports": imports,
}
@ -2049,7 +2063,9 @@ def camel_to_screaming_snake(name: str):
# Change `file_conversion` to `FileConversion`
def snake_to_title(name: str):
return name.title().replace("_", "").replace("3D", "3d")
if "_" in name or name.islower():
return "".join([word.title() for word in name.split("_")])
return name
def get_function_parameters(

File diff suppressed because it is too large Load Diff

View File

@ -51,14 +51,14 @@ from .models import (
WebSocketRequest,
WebSocketResponse,
)
from .models.input_format import obj
from .models.input_format import OptionObj
from .models.modeling_cmd import (
default_camera_focus_on,
import_files,
start_path,
take_snapshot,
OptionDefaultCameraFocusOn,
OptionImportFiles,
OptionStartPath,
OptionTakeSnapshot,
)
from .models.web_socket_request import modeling_cmd_req
from .models.web_socket_request import OptionModelingCmdReq
from .types import Unset
@ -367,7 +367,9 @@ def test_ws_simple():
# Send a message.
id = uuid.uuid4()
req = WebSocketRequest(
modeling_cmd_req(cmd=ModelingCmd(start_path()), cmd_id=ModelingCmdId(id))
OptionModelingCmdReq(
cmd=ModelingCmd(OptionStartPath()), cmd_id=ModelingCmdId(id)
)
)
websocket.send(req)
@ -403,12 +405,12 @@ def test_ws_import():
ImportFile(data=content, path=file_name)
# form the request
req = WebSocketRequest(
modeling_cmd_req(
OptionModelingCmdReq(
cmd=ModelingCmd(
import_files(
OptionImportFiles(
files=[ImportFile(data=content, path=file_name)],
format=InputFormat(
obj(
OptionObj(
units=UnitLength.M,
coords=System(
forward=AxisDirectionPair(
@ -457,8 +459,8 @@ def test_ws_import():
cmd_id = uuid.uuid4()
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(default_camera_focus_on(uuid=object_id)),
OptionModelingCmdReq(
cmd=ModelingCmd(OptionDefaultCameraFocusOn(uuid=object_id)),
cmd_id=ModelingCmdId(cmd_id),
)
)
@ -482,8 +484,8 @@ def test_ws_import():
# form the request
# form the request
req = WebSocketRequest(
modeling_cmd_req(
cmd=ModelingCmd(take_snapshot(format=ImageFormat.PNG)),
OptionModelingCmdReq(
cmd=ModelingCmd(OptionTakeSnapshot(format=ImageFormat.PNG)),
cmd_id=ModelingCmdId(cmd_id),
)
)

View File

@ -226,10 +226,13 @@ from kittycad.models.billing_info import BillingInfo
from kittycad.models.code_language import CodeLanguage
from kittycad.models.created_at_sort_mode import CreatedAtSortMode
from kittycad.models.email_authentication_form import EmailAuthenticationForm
from kittycad.models.event import Event, modeling_app_event
from kittycad.models.event import Event, OptionModelingAppEvent
from kittycad.models.file_export_format import FileExportFormat
from kittycad.models.file_import_format import FileImportFormat
from kittycad.models.idp_metadata_source import IdpMetadataSource, base64_encoded_xml
from kittycad.models.idp_metadata_source import (
IdpMetadataSource,
OptionBase64EncodedXml,
)
from kittycad.models.kcl_code_completion_params import KclCodeCompletionParams
from kittycad.models.kcl_code_completion_request import KclCodeCompletionRequest
from kittycad.models.ml_feedback import MlFeedback
@ -253,7 +256,7 @@ from kittycad.models.source_position import SourcePosition
from kittycad.models.source_range import SourceRange
from kittycad.models.source_range_prompt import SourceRangePrompt
from kittycad.models.store_coupon_params import StoreCouponParams
from kittycad.models.subscription_tier_price import SubscriptionTierPrice, per_user
from kittycad.models.subscription_tier_price import OptionPerUser, SubscriptionTierPrice
from kittycad.models.text_to_cad_create_body import TextToCadCreateBody
from kittycad.models.text_to_cad_iteration_body import TextToCadIterationBody
from kittycad.models.unit_angle import UnitAngle
@ -275,7 +278,7 @@ from kittycad.models.update_payment_balance import UpdatePaymentBalance
from kittycad.models.update_user import UpdateUser
from kittycad.models.user_org_role import UserOrgRole
from kittycad.models.uuid import Uuid
from kittycad.models.web_socket_request import sdp_offer
from kittycad.models.web_socket_request import OptionSdpOffer
from kittycad.models.zoo_product_subscriptions_org_request import (
ZooProductSubscriptionsOrgRequest,
)
@ -1160,7 +1163,7 @@ def test_create_event():
result: Optional[Error] = create_event.sync(
client=client,
body=Event(
modeling_app_event(
OptionModelingAppEvent(
created_at=datetime.datetime.now(),
event_type=ModelingAppEventType.SUCCESSFUL_COMPILE_BEFORE_CLOSE,
project_name="<string>",
@ -1181,7 +1184,7 @@ def test_create_event():
response: Response[Optional[Error]] = create_event.sync_detailed(
client=client,
body=Event(
modeling_app_event(
OptionModelingAppEvent(
created_at=datetime.datetime.now(),
event_type=ModelingAppEventType.SUCCESSFUL_COMPILE_BEFORE_CLOSE,
project_name="<string>",
@ -1202,7 +1205,7 @@ async def test_create_event_async():
result: Optional[Error] = await create_event.asyncio(
client=client,
body=Event(
modeling_app_event(
OptionModelingAppEvent(
created_at=datetime.datetime.now(),
event_type=ModelingAppEventType.SUCCESSFUL_COMPILE_BEFORE_CLOSE,
project_name="<string>",
@ -1216,7 +1219,7 @@ async def test_create_event_async():
response: Response[Optional[Error]] = await create_event.asyncio_detailed(
client=client,
body=Event(
modeling_app_event(
OptionModelingAppEvent(
created_at=datetime.datetime.now(),
event_type=ModelingAppEventType.SUCCESSFUL_COMPILE_BEFORE_CLOSE,
project_name="<string>",
@ -3401,7 +3404,7 @@ def test_update_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3423,7 +3426,7 @@ def test_update_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3447,7 +3450,7 @@ async def test_update_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3463,7 +3466,7 @@ async def test_update_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3482,7 +3485,7 @@ def test_create_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3504,7 +3507,7 @@ def test_create_org_saml_idp():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3528,7 +3531,7 @@ async def test_create_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3544,7 +3547,7 @@ async def test_create_org_saml_idp_async():
body=SamlIdentityProviderCreate(
idp_entity_id="<string>",
idp_metadata_source=IdpMetadataSource(
base64_encoded_xml(
OptionBase64EncodedXml(
data=Base64Data(b"<bytes>"),
)
),
@ -3906,7 +3909,7 @@ def test_update_enterprise_pricing_for_org():
client=client,
id=Uuid("<string>"),
body=SubscriptionTierPrice(
per_user(
OptionPerUser(
interval=PlanInterval.DAY,
price=3.14,
)
@ -3927,7 +3930,7 @@ def test_update_enterprise_pricing_for_org():
client=client,
id=Uuid("<string>"),
body=SubscriptionTierPrice(
per_user(
OptionPerUser(
interval=PlanInterval.DAY,
price=3.14,
)
@ -3949,7 +3952,7 @@ async def test_update_enterprise_pricing_for_org_async():
client=client,
id=Uuid("<string>"),
body=SubscriptionTierPrice(
per_user(
OptionPerUser(
interval=PlanInterval.DAY,
price=3.14,
)
@ -3963,7 +3966,7 @@ async def test_update_enterprise_pricing_for_org_async():
client=client,
id=Uuid("<string>"),
body=SubscriptionTierPrice(
per_user(
OptionPerUser(
interval=PlanInterval.DAY,
price=3.14,
)
@ -6989,7 +6992,7 @@ def test_modeling_commands_ws():
# Send a message.
websocket.send(
WebSocketRequest(
sdp_offer(
OptionSdpOffer(
offer=RtcSessionDescription(
sdp="<string>",
type=RtcSdpType.UNSPECIFIED,

View File

@ -22,7 +22,7 @@ from ..models.uuid import Uuid
from .base64data import Base64Data
class file_conversion(BaseModel):
class OptionFileConversion(BaseModel):
"""A file conversion."""
completed_at: Optional[datetime.datetime] = None
@ -56,7 +56,7 @@ class file_conversion(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class file_center_of_mass(BaseModel):
class OptionFileCenterOfMass(BaseModel):
"""File center of mass."""
center_of_mass: Optional[Point3d] = None
@ -86,7 +86,7 @@ class file_center_of_mass(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class file_mass(BaseModel):
class OptionFileMass(BaseModel):
"""A file mass."""
completed_at: Optional[datetime.datetime] = None
@ -120,7 +120,7 @@ class file_mass(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class file_volume(BaseModel):
class OptionFileVolume(BaseModel):
"""A file volume."""
completed_at: Optional[datetime.datetime] = None
@ -150,7 +150,7 @@ class file_volume(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class file_density(BaseModel):
class OptionFileDensity(BaseModel):
"""A file density."""
completed_at: Optional[datetime.datetime] = None
@ -184,7 +184,7 @@ class file_density(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class file_surface_area(BaseModel):
class OptionFileSurfaceArea(BaseModel):
"""A file surface area."""
completed_at: Optional[datetime.datetime] = None
@ -214,7 +214,7 @@ class file_surface_area(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class text_to_cad(BaseModel):
class OptionTextToCad(BaseModel):
"""Text to CAD."""
code: Optional[str] = None
@ -252,7 +252,7 @@ class text_to_cad(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class text_to_cad_iteration(BaseModel):
class OptionTextToCadIteration(BaseModel):
"""Text to CAD iteration."""
code: str
@ -293,14 +293,14 @@ class text_to_cad_iteration(BaseModel):
AsyncApiCallOutput = RootModel[
Annotated[
Union[
file_conversion,
file_center_of_mass,
file_mass,
file_volume,
file_density,
file_surface_area,
text_to_cad,
text_to_cad_iteration,
OptionFileConversion,
OptionFileCenterOfMass,
OptionFileMass,
OptionFileVolume,
OptionFileDensity,
OptionFileSurfaceArea,
OptionTextToCad,
OptionTextToCadIteration,
],
Field(discriminator="type"),
]

View File

@ -3,13 +3,13 @@ from typing import Union
from pydantic import BaseModel, ConfigDict, RootModel
class response(BaseModel):
class Response(BaseModel):
"""Response to the modeling command."""
model_config = ConfigDict(protected_namespaces=())
class errors(BaseModel):
class Errors(BaseModel):
"""Errors that occurred during the modeling command."""
model_config = ConfigDict(protected_namespaces=())
@ -17,7 +17,7 @@ class errors(BaseModel):
BatchResponse = RootModel[
Union[
response,
errors,
Response,
Errors,
]
]

View File

@ -6,7 +6,7 @@ from typing_extensions import Annotated
from ..models.global_axis import GlobalAxis
class euclidean(BaseModel):
class OptionEuclidean(BaseModel):
"""Euclidean Distance."""
type: Literal["euclidean"] = "euclidean"
@ -14,7 +14,7 @@ class euclidean(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class on_axis(BaseModel):
class OptionOnAxis(BaseModel):
"""The distance between objects along the specified axis"""
axis: GlobalAxis
@ -27,8 +27,8 @@ class on_axis(BaseModel):
DistanceType = RootModel[
Annotated[
Union[
euclidean,
on_axis,
OptionEuclidean,
OptionOnAxis,
],
Field(discriminator="type"),
]

View File

@ -7,7 +7,7 @@ from typing_extensions import Annotated
from ..models.modeling_app_event_type import ModelingAppEventType
class modeling_app_event(BaseModel):
class OptionModelingAppEvent(BaseModel):
"""An event related to modeling app files"""
attachment_uri: Optional[str] = None
@ -31,4 +31,6 @@ class modeling_app_event(BaseModel):
model_config = ConfigDict(protected_namespaces=())
Event = RootModel[Annotated[Union[modeling_app_event,], Field(discriminator="type")]]
Event = RootModel[
Annotated[Union[OptionModelingAppEvent,], Field(discriminator="type")]
]

View File

@ -6,7 +6,7 @@ from typing_extensions import Annotated
from .base64data import Base64Data
class url(BaseModel):
class OptionUrl(BaseModel):
"""A URL to the identity provider metadata descriptor."""
type: Literal["url"] = "url"
@ -16,7 +16,7 @@ class url(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class base64_encoded_xml(BaseModel):
class OptionBase64EncodedXml(BaseModel):
"""A base64 encoded XML document containing the identity provider metadata descriptor."""
data: Base64Data
@ -29,8 +29,8 @@ class base64_encoded_xml(BaseModel):
IdpMetadataSource = RootModel[
Annotated[
Union[
url,
base64_encoded_xml,
OptionUrl,
OptionBase64EncodedXml,
],
Field(discriminator="type"),
]

View File

@ -7,7 +7,7 @@ from ..models.system import System
from ..models.unit_length import UnitLength
class fbx(BaseModel):
class OptionFbx(BaseModel):
"""Autodesk Filmbox (FBX) format."""
type: Literal["fbx"] = "fbx"
@ -15,7 +15,7 @@ class fbx(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class gltf(BaseModel):
class OptionGltf(BaseModel):
"""Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb)."""
type: Literal["gltf"] = "gltf"
@ -23,7 +23,7 @@ class gltf(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class obj(BaseModel):
class OptionObj(BaseModel):
"""Wavefront OBJ format."""
coords: System
@ -35,7 +35,7 @@ class obj(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class ply(BaseModel):
class OptionPly(BaseModel):
"""The PLY Polygon File Format."""
coords: System
@ -47,7 +47,7 @@ class ply(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class sldprt(BaseModel):
class OptionSldprt(BaseModel):
"""SolidWorks part (SLDPRT) format."""
split_closed_faces: bool = False
@ -57,7 +57,7 @@ class sldprt(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class step(BaseModel):
class OptionStep(BaseModel):
"""ISO 10303-21 (STEP) format."""
split_closed_faces: bool = False
@ -67,7 +67,7 @@ class step(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class stl(BaseModel):
class OptionStl(BaseModel):
"""*ST**ereo**L**ithography format."""
coords: System
@ -82,13 +82,13 @@ class stl(BaseModel):
InputFormat = RootModel[
Annotated[
Union[
fbx,
gltf,
obj,
ply,
sldprt,
step,
stl,
OptionFbx,
OptionGltf,
OptionObj,
OptionPly,
OptionSldprt,
OptionStep,
OptionStl,
],
Field(discriminator="type"),
]

File diff suppressed because it is too large Load Diff

View File

@ -60,7 +60,7 @@ from ..models.volume import Volume
from ..models.zoom_to_fit import ZoomToFit
class empty(BaseModel):
class OptionEmpty(BaseModel):
"""An empty response, used for any command that does not explicitly have a response defined here."""
type: Literal["empty"] = "empty"
@ -68,7 +68,7 @@ class empty(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class export(BaseModel):
class OptionExport(BaseModel):
"""The response to the 'Export' endpoint"""
data: Export
@ -78,7 +78,7 @@ class export(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class select_with_point(BaseModel):
class OptionSelectWithPoint(BaseModel):
"""The response to the 'SelectWithPoint' endpoint"""
data: SelectWithPoint
@ -88,7 +88,7 @@ class select_with_point(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class highlight_set_entity(BaseModel):
class OptionHighlightSetEntity(BaseModel):
"""The response to the 'HighlightSetEntity' endpoint"""
data: HighlightSetEntity
@ -98,7 +98,7 @@ class highlight_set_entity(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_child_uuid(BaseModel):
class OptionEntityGetChildUuid(BaseModel):
"""The response to the 'EntityGetChildUuid' endpoint"""
data: EntityGetChildUuid
@ -108,7 +108,7 @@ class entity_get_child_uuid(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_num_children(BaseModel):
class OptionEntityGetNumChildren(BaseModel):
"""The response to the 'EntityGetNumChildren' endpoint"""
data: EntityGetNumChildren
@ -118,7 +118,7 @@ class entity_get_num_children(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_parent_id(BaseModel):
class OptionEntityGetParentId(BaseModel):
"""The response to the 'EntityGetParentId' endpoint"""
data: EntityGetParentId
@ -128,7 +128,7 @@ class entity_get_parent_id(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_all_child_uuids(BaseModel):
class OptionEntityGetAllChildUuids(BaseModel):
"""The response to the 'EntityGetAllChildUuids' endpoint"""
data: EntityGetAllChildUuids
@ -138,7 +138,7 @@ class entity_get_all_child_uuids(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_sketch_paths(BaseModel):
class OptionEntityGetSketchPaths(BaseModel):
"""The response to the 'EntityGetSketchPaths' endpoint"""
data: EntityGetSketchPaths
@ -148,7 +148,7 @@ class entity_get_sketch_paths(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class loft(BaseModel):
class OptionLoft(BaseModel):
"""The response to the 'Loft' endpoint"""
data: Loft
@ -158,7 +158,7 @@ class loft(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class close_path(BaseModel):
class OptionClosePath(BaseModel):
"""The response to the 'ClosePath' endpoint"""
data: ClosePath
@ -168,7 +168,7 @@ class close_path(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class camera_drag_move(BaseModel):
class OptionCameraDragMove(BaseModel):
"""The response to the 'CameraDragMove' endpoint"""
data: CameraDragMove
@ -178,7 +178,7 @@ class camera_drag_move(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class camera_drag_end(BaseModel):
class OptionCameraDragEnd(BaseModel):
"""The response to the 'CameraDragEnd' endpoint"""
data: CameraDragEnd
@ -188,7 +188,7 @@ class camera_drag_end(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_get_settings(BaseModel):
class OptionDefaultCameraGetSettings(BaseModel):
"""The response to the 'DefaultCameraGetSettings' endpoint"""
data: DefaultCameraGetSettings
@ -198,7 +198,7 @@ class default_camera_get_settings(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_zoom(BaseModel):
class OptionDefaultCameraZoom(BaseModel):
"""The response to the 'DefaultCameraZoom' endpoint"""
data: DefaultCameraZoom
@ -208,7 +208,7 @@ class default_camera_zoom(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class zoom_to_fit(BaseModel):
class OptionZoomToFit(BaseModel):
"""The response to the 'ZoomToFit' endpoint"""
data: ZoomToFit
@ -218,7 +218,7 @@ class zoom_to_fit(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class view_isometric(BaseModel):
class OptionViewIsometric(BaseModel):
"""The response to the 'ViewIsometric' endpoint"""
data: ViewIsometric
@ -228,7 +228,7 @@ class view_isometric(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class get_num_objects(BaseModel):
class OptionGetNumObjects(BaseModel):
"""The response to the 'GetNumObjects' endpoint"""
data: GetNumObjects
@ -238,7 +238,7 @@ class get_num_objects(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_focus_on(BaseModel):
class OptionDefaultCameraFocusOn(BaseModel):
"""The response to the 'DefaultCameraFocusOn' endpoint"""
data: DefaultCameraFocusOn
@ -248,7 +248,7 @@ class default_camera_focus_on(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class select_get(BaseModel):
class OptionSelectGet(BaseModel):
"""The response to the 'SelectGet' endpoint"""
data: SelectGet
@ -258,7 +258,7 @@ class select_get(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_all_edge_faces(BaseModel):
class OptionSolid3DGetAllEdgeFaces(BaseModel):
"""The response to the 'Solid3dGetAllEdgeFaces' endpoint"""
data: Solid3dGetAllEdgeFaces
@ -268,7 +268,7 @@ class solid3d_get_all_edge_faces(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_all_opposite_edges(BaseModel):
class OptionSolid3DGetAllOppositeEdges(BaseModel):
"""The response to the 'Solid3dGetAllOppositeEdges' endpoint"""
data: Solid3dGetAllOppositeEdges
@ -278,7 +278,7 @@ class solid3d_get_all_opposite_edges(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_opposite_edge(BaseModel):
class OptionSolid3DGetOppositeEdge(BaseModel):
"""The response to the 'Solid3dGetOppositeEdge' endpoint"""
data: Solid3dGetOppositeEdge
@ -288,7 +288,7 @@ class solid3d_get_opposite_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_next_adjacent_edge(BaseModel):
class OptionSolid3DGetNextAdjacentEdge(BaseModel):
"""The response to the 'Solid3dGetNextAdjacentEdge' endpoint"""
data: Solid3dGetNextAdjacentEdge
@ -298,7 +298,7 @@ class solid3d_get_next_adjacent_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_prev_adjacent_edge(BaseModel):
class OptionSolid3DGetPrevAdjacentEdge(BaseModel):
"""The response to the 'Solid3dGetPrevAdjacentEdge' endpoint"""
data: Solid3dGetPrevAdjacentEdge
@ -308,7 +308,7 @@ class solid3d_get_prev_adjacent_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class get_entity_type(BaseModel):
class OptionGetEntityType(BaseModel):
"""The response to the 'GetEntityType' endpoint"""
data: GetEntityType
@ -318,7 +318,7 @@ class get_entity_type(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class curve_get_control_points(BaseModel):
class OptionCurveGetControlPoints(BaseModel):
"""The response to the 'CurveGetControlPoints' endpoint"""
data: CurveGetControlPoints
@ -328,7 +328,7 @@ class curve_get_control_points(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class curve_get_type(BaseModel):
class OptionCurveGetType(BaseModel):
"""The response to the 'CurveGetType' endpoint"""
data: CurveGetType
@ -338,7 +338,7 @@ class curve_get_type(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class mouse_click(BaseModel):
class OptionMouseClick(BaseModel):
"""The response to the 'MouseClick' endpoint"""
data: MouseClick
@ -348,7 +348,7 @@ class mouse_click(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class take_snapshot(BaseModel):
class OptionTakeSnapshot(BaseModel):
"""The response to the 'TakeSnapshot' endpoint"""
data: TakeSnapshot
@ -358,7 +358,7 @@ class take_snapshot(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_get_info(BaseModel):
class OptionPathGetInfo(BaseModel):
"""The response to the 'PathGetInfo' endpoint"""
data: PathGetInfo
@ -368,7 +368,7 @@ class path_get_info(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_segment_info(BaseModel):
class OptionPathSegmentInfo(BaseModel):
"""The response to the 'PathSegmentInfo' endpoint"""
data: PathSegmentInfo
@ -378,7 +378,7 @@ class path_segment_info(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_get_curve_uuids_for_vertices(BaseModel):
class OptionPathGetCurveUuidsForVertices(BaseModel):
"""The response to the 'PathGetCurveUuidsForVertices' endpoint"""
data: PathGetCurveUuidsForVertices
@ -390,7 +390,7 @@ class path_get_curve_uuids_for_vertices(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_get_curve_uuid(BaseModel):
class OptionPathGetCurveUuid(BaseModel):
"""The response to the 'PathGetCurveUuid' endpoint"""
data: PathGetCurveUuid
@ -400,7 +400,7 @@ class path_get_curve_uuid(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_get_vertex_uuids(BaseModel):
class OptionPathGetVertexUuids(BaseModel):
"""The response to the 'PathGetVertexUuids' endpoint"""
data: PathGetVertexUuids
@ -410,7 +410,7 @@ class path_get_vertex_uuids(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class path_get_sketch_target_uuid(BaseModel):
class OptionPathGetSketchTargetUuid(BaseModel):
"""The response to the 'PathGetSketchTargetUuid' endpoint"""
data: PathGetSketchTargetUuid
@ -420,7 +420,7 @@ class path_get_sketch_target_uuid(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class curve_get_end_points(BaseModel):
class OptionCurveGetEndPoints(BaseModel):
"""The response to the 'CurveGetEndPoints' endpoint"""
data: CurveGetEndPoints
@ -430,7 +430,7 @@ class curve_get_end_points(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_is_planar(BaseModel):
class OptionFaceIsPlanar(BaseModel):
"""The response to the 'FaceIsPlanar' endpoint"""
data: FaceIsPlanar
@ -440,7 +440,7 @@ class face_is_planar(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_position(BaseModel):
class OptionFaceGetPosition(BaseModel):
"""The response to the 'FaceGetPosition' endpoint"""
data: FaceGetPosition
@ -450,7 +450,7 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_center(BaseModel):
class OptionFaceGetCenter(BaseModel):
"""The response to the 'FaceGetCenter' endpoint"""
data: FaceGetCenter
@ -460,7 +460,7 @@ class face_get_center(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_gradient(BaseModel):
class OptionFaceGetGradient(BaseModel):
"""The response to the 'FaceGetGradient' endpoint"""
data: FaceGetGradient
@ -470,7 +470,7 @@ class face_get_gradient(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class plane_intersect_and_project(BaseModel):
class OptionPlaneIntersectAndProject(BaseModel):
"""The response to the 'PlaneIntersectAndProject' endpoint"""
data: PlaneIntersectAndProject
@ -480,7 +480,7 @@ class plane_intersect_and_project(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class import_files(BaseModel):
class OptionImportFiles(BaseModel):
"""The response to the 'ImportFiles' endpoint"""
data: ImportFiles
@ -490,7 +490,7 @@ class import_files(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class imported_geometry(BaseModel):
class OptionImportedGeometry(BaseModel):
"""The response to the 'ImportedGeometry' endpoint"""
data: ImportedGeometry
@ -500,7 +500,7 @@ class imported_geometry(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class mass(BaseModel):
class OptionMass(BaseModel):
"""The response to the 'Mass' endpoint"""
data: Mass
@ -510,7 +510,7 @@ class mass(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class volume(BaseModel):
class OptionVolume(BaseModel):
"""The response to the 'Volume' endpoint"""
data: Volume
@ -520,7 +520,7 @@ class volume(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class density(BaseModel):
class OptionDensity(BaseModel):
"""The response to the 'Density' endpoint"""
data: Density
@ -530,7 +530,7 @@ class density(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class surface_area(BaseModel):
class OptionSurfaceArea(BaseModel):
"""The response to the 'SurfaceArea' endpoint"""
data: SurfaceArea
@ -540,7 +540,7 @@ class surface_area(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class center_of_mass(BaseModel):
class OptionCenterOfMass(BaseModel):
"""The response to the 'CenterOfMass' endpoint"""
data: CenterOfMass
@ -550,7 +550,7 @@ class center_of_mass(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class get_sketch_mode_plane(BaseModel):
class OptionGetSketchModePlane(BaseModel):
"""The response to the 'GetSketchModePlane' endpoint"""
data: GetSketchModePlane
@ -560,7 +560,7 @@ class get_sketch_mode_plane(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_get_distance(BaseModel):
class OptionEntityGetDistance(BaseModel):
"""The response to the 'EntityGetDistance' endpoint"""
data: EntityGetDistance
@ -570,7 +570,7 @@ class entity_get_distance(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern_transform(BaseModel):
class OptionEntityLinearPatternTransform(BaseModel):
"""The response to the 'EntityLinearPatternTransform' endpoint"""
data: EntityLinearPatternTransform
@ -580,7 +580,7 @@ class entity_linear_pattern_transform(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
class OptionEntityLinearPattern(BaseModel):
"""The response to the 'EntityLinearPattern' endpoint"""
data: EntityLinearPattern
@ -590,7 +590,7 @@ class entity_linear_pattern(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_circular_pattern(BaseModel):
class OptionEntityCircularPattern(BaseModel):
"""The response to the 'EntityCircularPattern' endpoint"""
data: EntityCircularPattern
@ -600,7 +600,7 @@ class entity_circular_pattern(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_extrusion_face_info(BaseModel):
class OptionSolid3DGetExtrusionFaceInfo(BaseModel):
"""The response to the 'Solid3dGetExtrusionFaceInfo' endpoint"""
data: Solid3dGetExtrusionFaceInfo
@ -610,7 +610,7 @@ class solid3d_get_extrusion_face_info(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class extrusion_face_info(BaseModel):
class OptionExtrusionFaceInfo(BaseModel):
"""The response to the 'ExtrusionFaceInfo' endpoint"""
data: ExtrusionFaceInfo
@ -623,62 +623,62 @@ class extrusion_face_info(BaseModel):
OkModelingCmdResponse = RootModel[
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,
entity_get_sketch_paths,
loft,
close_path,
camera_drag_move,
camera_drag_end,
default_camera_get_settings,
default_camera_zoom,
zoom_to_fit,
view_isometric,
get_num_objects,
default_camera_focus_on,
select_get,
solid3d_get_all_edge_faces,
solid3d_get_all_opposite_edges,
solid3d_get_opposite_edge,
solid3d_get_next_adjacent_edge,
solid3d_get_prev_adjacent_edge,
get_entity_type,
curve_get_control_points,
curve_get_type,
mouse_click,
take_snapshot,
path_get_info,
path_segment_info,
path_get_curve_uuids_for_vertices,
path_get_curve_uuid,
path_get_vertex_uuids,
path_get_sketch_target_uuid,
curve_get_end_points,
face_is_planar,
face_get_position,
face_get_center,
face_get_gradient,
plane_intersect_and_project,
import_files,
imported_geometry,
mass,
volume,
density,
surface_area,
center_of_mass,
get_sketch_mode_plane,
entity_get_distance,
entity_linear_pattern_transform,
entity_linear_pattern,
entity_circular_pattern,
solid3d_get_extrusion_face_info,
extrusion_face_info,
OptionEmpty,
OptionExport,
OptionSelectWithPoint,
OptionHighlightSetEntity,
OptionEntityGetChildUuid,
OptionEntityGetNumChildren,
OptionEntityGetParentId,
OptionEntityGetAllChildUuids,
OptionEntityGetSketchPaths,
OptionLoft,
OptionClosePath,
OptionCameraDragMove,
OptionCameraDragEnd,
OptionDefaultCameraGetSettings,
OptionDefaultCameraZoom,
OptionZoomToFit,
OptionViewIsometric,
OptionGetNumObjects,
OptionDefaultCameraFocusOn,
OptionSelectGet,
OptionSolid3DGetAllEdgeFaces,
OptionSolid3DGetAllOppositeEdges,
OptionSolid3DGetOppositeEdge,
OptionSolid3DGetNextAdjacentEdge,
OptionSolid3DGetPrevAdjacentEdge,
OptionGetEntityType,
OptionCurveGetControlPoints,
OptionCurveGetType,
OptionMouseClick,
OptionTakeSnapshot,
OptionPathGetInfo,
OptionPathSegmentInfo,
OptionPathGetCurveUuidsForVertices,
OptionPathGetCurveUuid,
OptionPathGetVertexUuids,
OptionPathGetSketchTargetUuid,
OptionCurveGetEndPoints,
OptionFaceIsPlanar,
OptionFaceGetPosition,
OptionFaceGetCenter,
OptionFaceGetGradient,
OptionPlaneIntersectAndProject,
OptionImportFiles,
OptionImportedGeometry,
OptionMass,
OptionVolume,
OptionDensity,
OptionSurfaceArea,
OptionCenterOfMass,
OptionGetSketchModePlane,
OptionEntityGetDistance,
OptionEntityLinearPatternTransform,
OptionEntityLinearPattern,
OptionEntityCircularPattern,
OptionSolid3DGetExtrusionFaceInfo,
OptionExtrusionFaceInfo,
],
Field(discriminator="type"),
]

View File

@ -20,7 +20,7 @@ class IceServerInfoData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class ice_server_info(BaseModel):
class OptionIceServerInfo(BaseModel):
"""Information about the ICE servers."""
data: IceServerInfoData
@ -38,7 +38,7 @@ class TrickleIceData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class trickle_ice(BaseModel):
class OptionTrickleIce(BaseModel):
"""The trickle ICE candidate response."""
data: TrickleIceData
@ -56,7 +56,7 @@ class SdpAnswerData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class sdp_answer(BaseModel):
class OptionSdpAnswer(BaseModel):
"""The SDP answer response."""
data: SdpAnswerData
@ -74,7 +74,7 @@ class ModelingData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class modeling(BaseModel):
class OptionModeling(BaseModel):
"""The modeling command response."""
data: ModelingData
@ -92,7 +92,7 @@ class ModelingBatchData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class modeling_batch(BaseModel):
class OptionModelingBatch(BaseModel):
"""Response to a ModelingBatch."""
data: ModelingBatchData
@ -110,7 +110,7 @@ class ExportData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class export(BaseModel):
class OptionExport(BaseModel):
"""The exported files."""
data: ExportData
@ -126,7 +126,7 @@ class MetricsRequestData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class metrics_request(BaseModel):
class OptionMetricsRequest(BaseModel):
"""Request a collection of metrics, to include WebRTC."""
data: MetricsRequestData
@ -144,7 +144,7 @@ class ModelingSessionDataData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class modeling_session_data(BaseModel):
class OptionModelingSessionData(BaseModel):
"""Data about the Modeling Session (application-level)."""
data: ModelingSessionDataData
@ -160,7 +160,7 @@ class PongData(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class pong(BaseModel):
class OptionPong(BaseModel):
"""Pong response to a Ping message."""
data: PongData
@ -173,15 +173,15 @@ class pong(BaseModel):
OkWebSocketResponseData = RootModel[
Annotated[
Union[
ice_server_info,
trickle_ice,
sdp_answer,
modeling,
modeling_batch,
export,
metrics_request,
modeling_session_data,
pong,
OptionIceServerInfo,
OptionTrickleIce,
OptionSdpAnswer,
OptionModeling,
OptionModelingBatch,
OptionExport,
OptionMetricsRequest,
OptionModelingSessionData,
OptionPong,
],
Field(discriminator="type"),
]

View File

@ -6,7 +6,7 @@ from typing_extensions import Annotated
from ..models.point3d import Point3d
class local(BaseModel):
class OptionLocal(BaseModel):
"""Local Origin (center of object bounding box)."""
type: Literal["local"] = "local"
@ -14,7 +14,7 @@ class local(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class global_(BaseModel):
class OptionGlobal(BaseModel):
"""Global Origin (0, 0, 0)."""
type: Literal["global"] = "global"
@ -22,7 +22,7 @@ class global_(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class custom(BaseModel):
class OptionCustom(BaseModel):
"""Custom Origin (user specified point)."""
origin: Point3d
@ -35,9 +35,9 @@ class custom(BaseModel):
OriginType = RootModel[
Annotated[
Union[
local,
global_,
custom,
OptionLocal,
OptionGlobal,
OptionCustom,
],
Field(discriminator="type"),
]

View File

@ -13,7 +13,7 @@ from ..models.system import System
from ..models.unit_length import UnitLength
class fbx(BaseModel):
class OptionFbx(BaseModel):
"""Autodesk Filmbox (FBX) format."""
storage: FbxStorage
@ -23,7 +23,7 @@ class fbx(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class gltf(BaseModel):
class OptionGltf(BaseModel):
"""glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ASCII output, you can set that option for the export."""
presentation: GltfPresentation
@ -35,7 +35,7 @@ class gltf(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class obj(BaseModel):
class OptionObj(BaseModel):
"""Wavefront OBJ format."""
coords: System
@ -47,7 +47,7 @@ class obj(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class ply(BaseModel):
class OptionPly(BaseModel):
"""The PLY Polygon File Format."""
coords: System
@ -63,7 +63,7 @@ class ply(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class step(BaseModel):
class OptionStep(BaseModel):
"""ISO 10303-21 (STEP) format."""
coords: System
@ -73,7 +73,7 @@ class step(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class stl(BaseModel):
class OptionStl(BaseModel):
"""*ST**ereo**L**ithography format."""
coords: System
@ -92,12 +92,12 @@ class stl(BaseModel):
OutputFormat = RootModel[
Annotated[
Union[
fbx,
gltf,
obj,
ply,
step,
stl,
OptionFbx,
OptionGltf,
OptionObj,
OptionPly,
OptionStep,
OptionStl,
],
Field(discriminator="type"),
]

View File

@ -9,7 +9,7 @@ from ..models.point2d import Point2d
from ..models.point3d import Point3d
class line(BaseModel):
class OptionLine(BaseModel):
"""A straight line segment. Goes from the current path \"pen\" to the given endpoint."""
end: Point3d
@ -21,7 +21,7 @@ class line(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class arc(BaseModel):
class OptionArc(BaseModel):
"""A circular arc segment. Arcs can be drawn clockwise when start > end."""
center: Point2d
@ -39,7 +39,7 @@ class arc(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class bezier(BaseModel):
class OptionBezier(BaseModel):
"""A cubic bezier curve segment. Start at the end of the current line, go through control point 1 and 2, then end at a given point."""
control1: Point3d
@ -55,7 +55,7 @@ class bezier(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class tangential_arc(BaseModel):
class OptionTangentialArc(BaseModel):
"""Adds a tangent arc from current pen position with the given radius and angle."""
offset: Angle
@ -67,7 +67,7 @@ class tangential_arc(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class tangential_arc_to(BaseModel):
class OptionTangentialArcTo(BaseModel):
"""Adds a tangent arc from current pen position to the new position. Arcs will choose a clockwise or counter-clockwise direction based on the arc end position."""
angle_snap_increment: Optional[Angle] = None
@ -82,11 +82,11 @@ class tangential_arc_to(BaseModel):
PathSegment = RootModel[
Annotated[
Union[
line,
arc,
bezier,
tangential_arc,
tangential_arc_to,
OptionLine,
OptionArc,
OptionBezier,
OptionTangentialArc,
OptionTangentialArcTo,
],
Field(discriminator="type"),
]

View File

@ -4,7 +4,7 @@ from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
class default_scene(BaseModel):
class OptionDefaultScene(BaseModel):
"""Visit the default scene."""
type: Literal["default_scene"] = "default_scene"
@ -12,7 +12,7 @@ class default_scene(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class scene_by_index(BaseModel):
class OptionSceneByIndex(BaseModel):
"""Visit the indexed scene."""
index: int
@ -22,7 +22,7 @@ class scene_by_index(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class scene_by_name(BaseModel):
class OptionSceneByName(BaseModel):
"""Visit the first scene with the given name."""
name: str
@ -32,7 +32,7 @@ class scene_by_name(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class mesh_by_index(BaseModel):
class OptionMeshByIndex(BaseModel):
"""Visit the indexed mesh."""
index: int
@ -42,7 +42,7 @@ class mesh_by_index(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class mesh_by_name(BaseModel):
class OptionMeshByName(BaseModel):
"""Visit the first mesh with the given name."""
name: str
@ -55,11 +55,11 @@ class mesh_by_name(BaseModel):
Selection = RootModel[
Annotated[
Union[
default_scene,
scene_by_index,
scene_by_name,
mesh_by_index,
mesh_by_name,
OptionDefaultScene,
OptionSceneByIndex,
OptionSceneByName,
OptionMeshByIndex,
OptionMeshByName,
],
Field(discriminator="type"),
]

View File

@ -6,7 +6,7 @@ from typing_extensions import Annotated
from ..models.plan_interval import PlanInterval
class flat(BaseModel):
class OptionFlat(BaseModel):
"""A flat price that we publicly list."""
interval: PlanInterval
@ -18,7 +18,7 @@ class flat(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class per_user(BaseModel):
class OptionPerUser(BaseModel):
"""A per user price that we publicly list."""
interval: PlanInterval
@ -30,7 +30,7 @@ class per_user(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class enterprise(BaseModel):
class OptionEnterprise(BaseModel):
"""Enterprise: The price is not listed and the user needs to contact sales."""
type: Literal["enterprise"] = "enterprise"
@ -41,9 +41,9 @@ class enterprise(BaseModel):
SubscriptionTierPrice = RootModel[
Annotated[
Union[
flat,
per_user,
enterprise,
OptionFlat,
OptionPerUser,
OptionEnterprise,
],
Field(discriminator="type"),
]

View File

@ -4,7 +4,7 @@ from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
class individual(BaseModel):
class OptionIndividual(BaseModel):
"""A subscription tier that can be applied to individuals only."""
type: Literal["individual"] = "individual"
@ -12,7 +12,7 @@ class individual(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class organization(BaseModel):
class OptionOrganization(BaseModel):
"""An subscription tier that can be applied to organizations only."""
saml_sso: bool
@ -25,8 +25,8 @@ class organization(BaseModel):
SubscriptionTierType = RootModel[
Annotated[
Union[
individual,
organization,
OptionIndividual,
OptionOrganization,
],
Field(discriminator="type"),
]

View File

@ -11,7 +11,7 @@ from ..models.rtc_ice_candidate_init import RtcIceCandidateInit
from ..models.rtc_session_description import RtcSessionDescription
class trickle_ice(BaseModel):
class OptionTrickleIce(BaseModel):
"""The trickle ICE candidate request."""
candidate: RtcIceCandidateInit
@ -21,7 +21,7 @@ class trickle_ice(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class sdp_offer(BaseModel):
class OptionSdpOffer(BaseModel):
"""The SDP offer request."""
offer: RtcSessionDescription
@ -31,7 +31,7 @@ class sdp_offer(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class modeling_cmd_req(BaseModel):
class OptionModelingCmdReq(BaseModel):
"""The modeling command request."""
cmd: ModelingCmd
@ -43,7 +43,7 @@ class modeling_cmd_req(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class modeling_cmd_batch_req(BaseModel):
class OptionModelingCmdBatchReq(BaseModel):
"""A sequence of modeling requests. If any request fails, following requests will not be tried."""
batch_id: ModelingCmdId
@ -57,7 +57,7 @@ class modeling_cmd_batch_req(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class ping(BaseModel):
class OptionPing(BaseModel):
"""The client-to-server Ping to ensure the WebSocket stays alive."""
type: Literal["ping"] = "ping"
@ -65,7 +65,7 @@ class ping(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class metrics_response(BaseModel):
class OptionMetricsResponse(BaseModel):
"""The response to a metrics collection request from the server."""
metrics: ClientMetrics
@ -75,7 +75,7 @@ class metrics_response(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class headers(BaseModel):
class OptionHeaders(BaseModel):
"""Authentication header request."""
headers: Dict[str, str]
@ -88,13 +88,13 @@ class headers(BaseModel):
WebSocketRequest = RootModel[
Annotated[
Union[
trickle_ice,
sdp_offer,
modeling_cmd_req,
modeling_cmd_batch_req,
ping,
metrics_response,
headers,
OptionTrickleIce,
OptionSdpOffer,
OptionModelingCmdReq,
OptionModelingCmdBatchReq,
OptionPing,
OptionMetricsResponse,
OptionHeaders,
],
Field(discriminator="type"),
]

View File

@ -1,6 +1,6 @@
from typing import List, Optional, Union
from typing import List, Optional
from pydantic import BaseModel, ConfigDict, RootModel
from pydantic import BaseModel, ConfigDict
from ..models.modeling_app_subscription_tier_name import ModelingAppSubscriptionTierName
from ..models.subscription_tier_feature import SubscriptionTierFeature
@ -13,7 +13,7 @@ from ..models.support_tier import SupportTier
from ..models.zoo_tool import ZooTool
class ZooProductSubscription0(BaseModel):
class ZooProductSubscription(BaseModel):
"""A subscription to the modeling app."""
description: str
@ -35,6 +35,3 @@ class ZooProductSubscription0(BaseModel):
zoo_tools_included: Optional[List[ZooTool]] = None
model_config = ConfigDict(protected_namespaces=())
ZooProductSubscription = RootModel[Union[ZooProductSubscription0,]]