forked from Roflin/gamenight
Started working on a cli frontend.
This commit is contained in:
30
gamenight-cli/src/flows/list_gamenights.rs
Normal file
30
gamenight-cli/src/flows/list_gamenights.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user