reactive_graph/client/instances/entities/args/
id_and_component.rs1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use crate::client::types::components::args::parse_component_ty;
4use clap::Args;
5use reactive_graph_graph::ComponentTypeId;
6use uuid::Uuid;
7
8#[derive(Args, Debug, Clone)]
10pub(crate) struct IdAndComponentArgs {
11 pub id: Uuid,
13
14 #[clap(name = "component", value_parser = parse_component_ty)]
16 pub component_ty: ComponentTypeId,
17}
18
19impl IdAndComponentArgs {
20 pub fn id_not_found(&self) -> CommandError {
21 NotFound(format!("The instance with the id {} was not found", &self.id))
22 }
23}