wekan_cli/commands/
api.rs1mod request;
2
3#[cfg(test)]
4mod tests;
5
6use clap::{Args, Subcommand};
7
8use crate::{
9 client::WekanClientFactory, command_result::CommandSuccess, credentials::CredentialStore,
10 error::AppError, input::ConfirmationProvider,
11};
12
13#[derive(Debug, Args)]
14pub struct ApiArgs {
15 #[command(subcommand)]
16 pub command: ApiCommand,
17}
18
19#[derive(Debug, Subcommand)]
20pub enum ApiCommand {
21 Request(request::RequestArgs),
23}
24
25pub(crate) async fn dispatch(
26 command: ApiCommand,
27 client_factory: &WekanClientFactory,
28 credential_store: &dyn CredentialStore,
29 confirmation: &dyn ConfirmationProvider,
30) -> Result<CommandSuccess, AppError> {
31 match command {
32 ApiCommand::Request(args) => {
33 request::execute(args, client_factory, credential_store, confirmation).await
34 }
35 }
36}