reactive_graph/client/instances/entities/args/
id_and_property.rs1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use clap::Args;
4use uuid::Uuid;
5
6#[derive(Args, Debug, Clone)]
8pub(crate) struct IdAndPropertyArgs {
9 pub id: Uuid,
11
12 pub property_name: String,
14}
15
16impl IdAndPropertyArgs {
17 pub fn id_not_found(&self) -> CommandError {
18 NotFound(format!("The instance with the id {} was not found", &self.id))
19 }
20
21 pub fn property_not_found(&self) -> CommandError {
22 NotFound(format!("The instance with the id {} has no property {}", &self.id, &self.property_name))
23 }
24}