reactive_graph/client/types/entities/
commands.rs

1use crate::client::types::entities::args::add_extension::EntityTypeAddExtensionArgs;
2use crate::client::types::entities::args::add_property::EntityTypeAddPropertyArgs;
3use crate::client::types::entities::args::create::CreateEntityTypeArgs;
4use crate::client::types::entities::args::entity_component_type::EntityComponentTypeIdArgs;
5use crate::client::types::entities::args::entity_extension_type::EntityExtensionTypeIdArgs;
6use crate::client::types::entities::args::entity_type_property::EntityTypePropertyArgs;
7use crate::client::types::entities::args::parse_entity_ty;
8use crate::client::types::entities::args::update_description::EntityTypeUpdateDescriptionArgs;
9use clap::Subcommand;
10use reactive_graph_graph::EntityTypeId;
11
12#[derive(Subcommand, Debug, Clone)]
13pub(crate) enum EntityTypesCommands {
14    /// List all entity types.
15    #[non_exhaustive]
16    List,
17    /// Prints a single entity type.
18    #[non_exhaustive]
19    Get {
20        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
21        entity_ty: EntityTypeId,
22    },
23    /// List the properties of an entity type.
24    #[non_exhaustive]
25    ListProperties {
26        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
27        entity_ty: EntityTypeId,
28    },
29    /// List the extensions of an entity type.
30    #[non_exhaustive]
31    ListExtensions {
32        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
33        entity_ty: EntityTypeId,
34    },
35    /// List the components of an entity type.
36    #[non_exhaustive]
37    ListComponents {
38        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
39        entity_ty: EntityTypeId,
40    },
41    /// Prints the JSON Schema of an entity type.
42    #[non_exhaustive]
43    GetJsonSchema {
44        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
45        entity_ty: EntityTypeId,
46    },
47    /// Creates a new entity type.
48    #[non_exhaustive]
49    Create(CreateEntityTypeArgs),
50    /// Deletes a entity type.
51    #[non_exhaustive]
52    Delete {
53        #[arg(name = "entity_type", value_parser = parse_entity_ty)]
54        entity_ty: EntityTypeId,
55    },
56    /// Adds a property to an entity type.
57    #[non_exhaustive]
58    AddProperty(EntityTypeAddPropertyArgs),
59    /// Removes a property from an entity type.
60    #[non_exhaustive]
61    RemoveProperty(EntityTypePropertyArgs),
62    /// Adds an extension to an entity type.
63    #[non_exhaustive]
64    AddExtension(EntityTypeAddExtensionArgs),
65    /// Removes an extension from an entity type.
66    #[non_exhaustive]
67    RemoveExtension(EntityExtensionTypeIdArgs),
68    /// Adds a component to an entity type.
69    #[non_exhaustive]
70    AddComponent(EntityComponentTypeIdArgs),
71    /// Removes a component from an entity type.
72    #[non_exhaustive]
73    RemoveComponent(EntityComponentTypeIdArgs),
74    /// Updates the description of an entity type.
75    #[non_exhaustive]
76    UpdateDescription(EntityTypeUpdateDescriptionArgs),
77    /// Prints the JSON Schema of entity types.
78    #[non_exhaustive]
79    JsonSchema,
80}