use clap::Parser;
use cosmian_kms_client::KmsClient;
use self::{identities::IdentitiesCommands, key_pairs::KeyPairsCommands};
use crate::error::result::KmsCliResult;
mod gmail_client;
mod identities;
pub mod key_pairs;
pub use gmail_client::GoogleApiError;
#[derive(Parser)]
pub enum GoogleCommands {
#[command(subcommand)]
KeyPairs(KeyPairsCommands),
#[command(subcommand)]
Identities(IdentitiesCommands),
}
impl GoogleCommands {
pub async fn process(&self, kms_rest_client: KmsClient) -> KmsCliResult<()> {
match self {
Self::KeyPairs(command) => command.process(kms_rest_client).await?,
Self::Identities(command) => command.process(kms_rest_client.config).await?,
}
Ok(())
}
}