use clap::{Parser, Subcommand};
use openstack_sdk::AsyncOpenStack;
use crate::{Cli, OpenStackCliError};
mod create_20;
mod create_249;
mod create_279;
mod delete;
mod list;
mod set_20;
mod set_285;
mod show;
#[derive(Parser)]
pub struct VolumeAttachmentCommand {
#[command(subcommand)]
command: VolumeAttachmentCommands,
}
#[allow(missing_docs)]
#[derive(Subcommand)]
pub enum VolumeAttachmentCommands {
Create20(create_20::VolumeAttachmentCommand),
Create249(create_249::VolumeAttachmentCommand),
#[command(visible_alias = "create")]
Create279(create_279::VolumeAttachmentCommand),
Delete(delete::VolumeAttachmentCommand),
List(list::VolumeAttachmentsCommand),
Set20(set_20::VolumeAttachmentCommand),
#[command(visible_alias = "set")]
Set285(set_285::VolumeAttachmentCommand),
Show(show::VolumeAttachmentCommand),
}
impl VolumeAttachmentCommand {
pub async fn take_action(
&self,
parsed_args: &Cli,
session: &mut AsyncOpenStack,
) -> Result<(), OpenStackCliError> {
match &self.command {
VolumeAttachmentCommands::Create20(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Create249(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Create279(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Delete(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::List(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Set20(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Set285(cmd) => cmd.take_action(parsed_args, session).await,
VolumeAttachmentCommands::Show(cmd) => cmd.take_action(parsed_args, session).await,
}
}
}