reactive_graph_client/client/instances/flows/args/
id.rs

1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use clap::Args;
4use uuid::Uuid;
5
6/// CLI argument which identifies a flow instance by its id.
7#[derive(Args, Debug, Clone)]
8pub(crate) struct IdArgs {
9    /// The id of the flow instance.
10    pub id: Uuid,
11}
12
13impl IdArgs {
14    pub fn not_found(&self) -> CommandError {
15        NotFound(format!("The flow instance with the id {} was not found", &self.id))
16    }
17}
18
19impl From<IdArgs> for Uuid {
20    fn from(id: IdArgs) -> Self {
21        id.id
22    }
23}