reactive_graph/client/types/relations/
commands.rs

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