gamenight/gamenight-cli/src/flows/list_gamenights.rs

31 lines
631 B
Rust

use gamenight_api_client_rs::apis::default_api::get_gamenights;
use super::*;
pub struct ListGamenights {
}
impl ListGamenights {
pub fn new() -> Self {
Self {}
}
}
#[async_trait]
impl<'a> Flow<'a> for ListGamenights {
async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> {
let response = get_gamenights(&state.configuration).await?;
println!("{:?}", response);
Ok((FlowOutcome::Successful, state))
}
}
impl Display for ListGamenights {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "List all gamenights")
}
}