use clap::{Parser, Subcommand};
use openstack_sdk::AsyncOpenStack;
use crate::{Cli, OpenStackCliError};
pub mod create;
pub mod delete;
pub mod list;
pub mod set;
pub mod show;
#[derive(Parser)]
pub struct ServiceProviderCommand {
#[command(subcommand)]
command: ServiceProviderCommands,
}
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum ServiceProviderCommands {
Create(create::ServiceProviderCommand),
Delete(delete::ServiceProviderCommand),
List(list::ServiceProvidersCommand),
Set(set::ServiceProviderCommand),
Show(show::ServiceProviderCommand),
}
impl ServiceProviderCommand {
pub async fn take_action(
&self,
parsed_args: &Cli,
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
ServiceProviderCommands::Create(cmd) => cmd.take_action(parsed_args, session).await,
ServiceProviderCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
ServiceProviderCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
ServiceProviderCommands::Set(cmd) => cmd.take_action(parsed_args, session).await,
ServiceProviderCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
}
}
}