use anyhow::Result;
use clap::Parser;
use pimalaya_cli::printer::{Message, Printer};
use crate::msgraph::client::MsgraphClient;
#[derive(Debug, Parser)]
pub struct MsgraphMailFolderMoveCommand {
#[arg(value_name = "ID")]
pub id: String,
#[arg(value_name = "DESTINATION")]
pub destination: String,
}
impl MsgraphMailFolderMoveCommand {
pub fn execute(self, printer: &mut impl Printer, client: &mut MsgraphClient) -> Result<()> {
let folder = client
.mail_folder_move(&self.id, &self.destination)?
.response;
printer.out(Message::new(format!(
"Microsoft Graph mail folder moved to `{}`",
folder.id
)))
}
}