diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index 082e1a7e..81140b8a 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -5413,6 +5413,44 @@ "type" ] }, + { + "description": "Get the ids of a given entity type.", + "type": "object", + "properties": { + "filter": { + "description": "The entity types to be queried.", + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityType" + } + }, + "skip": { + "description": "Skip the first n returned ids. If multiple filters are provided, this skip will apply to each filter individually.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "take": { + "description": "Take n ids after any ids skipped. This value must be greater than zero and not exceed 1000. If multiple filters are provided, this take will apply to each filter individually. If there are fewer than `take` items of the provided filter type then the returned list's length will be the smaller value.", + "type": "integer", + "format": "uint32", + "minimum": 1, + "maximum": 1000 + }, + "type": { + "type": "string", + "enum": [ + "scene_get_entity_ids" + ] + } + }, + "required": [ + "filter", + "skip", + "take", + "type" + ] + }, { "description": "Use orthographic projection.", "type": "object", diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index c675f022..09e5197e 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1527,6 +1527,26 @@ define_modeling_cmd_enum! { pub filter: Vec, } + /// Get the ids of a given entity type. + #[derive( + Clone, Debug, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, + )] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + pub struct SceneGetEntityIds { + /// The entity types to be queried. + pub filter: Vec, + /// Skip the first n returned ids. If multiple filters are provided, this skip will + /// apply to each filter individually. + pub skip: u32, + /// Take n ids after any ids skipped. This value must be greater than zero and not + /// exceed 1000. If multiple filters are provided, this take will apply to each filter + /// individually. If there are fewer than `take` items of the provided filter type then the + /// returned list's length will be the smaller value. + #[schemars(range(min = 1, max = 1000))] + pub take: u32, + } + /// Use orthographic projection. #[derive( Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Serialize, ModelingCmdVariant, diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 02d28c5d..b3c8b526 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -550,6 +550,14 @@ define_ok_modeling_cmd_response_enum! { /// The type of the entity. pub entity_type: EntityType, } + + /// The response from the `SceneGetEntityIds` command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + pub struct SceneGetEntityIds { + /// The ids of the requested entities. + pub entity_ids: Vec>, + } + /// The response from the `CurveGetControlPoints` command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] pub struct CurveGetControlPoints {