reactive_graph_client/client/instances/entities/args/
add_property.rs

1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use crate::client::types::property_type::args::PropertyTypeDefinitionArgs;
4use clap::Args;
5use uuid::Uuid;
6
7#[derive(Args, Debug, Clone)]
8pub(crate) struct AddPropertyArgs {
9    /// The id of the reactive instance.
10    pub id: Uuid,
11
12    /// The property to add to the entity instance.
13    #[clap(flatten)]
14    pub property_type: PropertyTypeDefinitionArgs,
15}
16
17impl AddPropertyArgs {
18    pub fn id_not_found(&self) -> CommandError {
19        NotFound(format!("The instance with the id {} was not found", &self.id))
20    }
21}