pub mod certificate;
pub mod domain;
use crate::command::api::cloud::ApiCloudSubcommand;
use crate::command_handler::Handlers;
use crate::context::Context;
use std::sync::Arc;
pub struct ApiCloudCommandHandler {
ctx: Arc<Context>,
}
impl ApiCloudCommandHandler {
pub fn new(ctx: Arc<Context>) -> Self {
Self { ctx }
}
pub async fn handle_command(&self, command: ApiCloudSubcommand) -> anyhow::Result<()> {
match command {
ApiCloudSubcommand::Domain { subcommand } => {
self.ctx
.api_cloud_domain_handler()
.handle_command(subcommand)
.await
}
ApiCloudSubcommand::Certificate { subcommand } => {
self.ctx
.api_cloud_certificate_handler()
.handle_command(subcommand)
.await
}
}
}
}