trello-to-deck/src/nextcloud/mod.rs
Paul Campbell 8f3035fccc
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 2m1s
Test / build (map[name:stable]) (push) Successful in 2m12s
Release Please / Release-plz (push) Failing after 19s
refactor: remove dead code
2024-12-20 09:32:54 +00:00

53 lines
1.4 KiB
Rust

//
use clap::Parser;
use crate::nextcloud::board::NextcloudBoardCommand;
use crate::{
execute::Execute,
nextcloud::{
card::NextcloudCardCommand,
deck::NextcloudDeckCommand,
model::{NextcloudHostname, NextcloudPassword, NextcloudUsername},
stack::NextcloudStackCommand,
},
FullCtx,
};
pub(crate) mod board;
pub(crate) mod card;
pub(crate) mod client;
pub(crate) mod deck;
pub(crate) mod model;
mod stack;
#[cfg(test)]
mod tests;
#[derive(Parser, Debug)]
pub enum NextcloudCommand {
#[clap(subcommand)]
Deck(NextcloudDeckCommand),
#[clap(subcommand)]
Board(NextcloudBoardCommand),
#[clap(subcommand)]
Stack(NextcloudStackCommand),
#[clap(subcommand)]
Card(NextcloudCardCommand),
}
impl Execute for NextcloudCommand {
async fn execute(&self, ctx: &FullCtx) -> color_eyre::Result<()> {
match self {
NextcloudCommand::Deck(cmd) => cmd.execute(ctx).await,
NextcloudCommand::Board(cmd) => cmd.execute(ctx).await,
NextcloudCommand::Stack(cmd) => cmd.execute(ctx).await,
NextcloudCommand::Card(cmd) => cmd.execute(ctx).await,
}
}
}
#[derive(Clone, Debug, derive_more::From, PartialEq, Eq, PartialOrd, Ord, serde::Deserialize)]
pub struct NextcloudConfig {
pub(crate) hostname: NextcloudHostname,
pub(crate) username: NextcloudUsername,
pub(crate) password: NextcloudPassword,
}