reactive_graph/client/types/components/
commands.rs

1use crate::client::types::components::args::add_extension::ComponentAddExtensionArgs;
2use crate::client::types::components::args::add_property::ComponentAddPropertyArgs;
3use crate::client::types::components::args::component_extension_type::ComponentExtensionTypeIdArgs;
4use crate::client::types::components::args::component_property::ComponentPropertyArgs;
5use crate::client::types::components::args::create::CreateComponentArgs;
6use crate::client::types::components::args::parse_component_ty;
7use crate::client::types::components::args::update_description::ComponentUpdateDescriptionArgs;
8use clap::Subcommand;
9use reactive_graph_graph::ComponentTypeId;
10
11#[derive(Subcommand, Debug, Clone)]
12pub(crate) enum ComponentsCommands {
13    /// List all components.
14    #[non_exhaustive]
15    List,
16    /// Prints a single component.
17    #[non_exhaustive]
18    Get {
19        #[arg(name = "component", value_parser = parse_component_ty)]
20        component_ty: ComponentTypeId,
21    },
22    /// List the properties of a component.
23    #[non_exhaustive]
24    ListProperties {
25        #[arg(name = "component", value_parser = parse_component_ty)]
26        component_ty: ComponentTypeId,
27    },
28    /// List the extensions of a component.
29    #[non_exhaustive]
30    ListExtensions {
31        #[arg(name = "component", value_parser = parse_component_ty)]
32        component_ty: ComponentTypeId,
33    },
34    /// Prints the JSON Schema of a component.
35    #[non_exhaustive]
36    GetJsonSchema {
37        #[arg(name = "component", value_parser = parse_component_ty)]
38        component_ty: ComponentTypeId,
39    },
40    /// Creates a new component.
41    #[non_exhaustive]
42    Create(CreateComponentArgs),
43    /// Deletes a component.
44    #[non_exhaustive]
45    Delete {
46        #[arg(name = "component", value_parser = parse_component_ty)]
47        component_ty: ComponentTypeId,
48    },
49    /// Adds a property to a component.
50    #[non_exhaustive]
51    AddProperty(ComponentAddPropertyArgs),
52    /// Removes a property from a component.
53    #[non_exhaustive]
54    RemoveProperty(ComponentPropertyArgs),
55    /// Adds an extension to a component.
56    #[non_exhaustive]
57    AddExtension(ComponentAddExtensionArgs),
58    /// Removes an extension from a component.
59    #[non_exhaustive]
60    RemoveExtension(ComponentExtensionTypeIdArgs),
61    /// Updates the description of a component.
62    #[non_exhaustive]
63    UpdateDescription(ComponentUpdateDescriptionArgs),
64    /// Prints the JSON Schema of components.
65    #[non_exhaustive]
66    JsonSchema,
67}