use clap::{Args, Subcommand};
#[derive(Debug, Args)]
pub(crate) struct TriggerArgs {
#[command(subcommand)]
pub command: TriggerCommand,
}
#[derive(Debug, Subcommand)]
pub(crate) enum TriggerCommand {
Replay(TriggerReplayArgs),
Cancel(TriggerCancelArgs),
}
#[derive(Debug, Args)]
pub(crate) struct TriggerReplayArgs {
#[arg(required_unless_present = "where_expr", conflicts_with = "where_expr")]
pub event_id: Option<String>,
#[arg(long = "where", value_name = "EXPR", conflicts_with = "event_id")]
pub where_expr: Option<String>,
#[arg(long)]
pub diff: bool,
#[arg(long = "as-of", value_name = "TIMESTAMP")]
pub as_of: Option<String>,
#[arg(long = "steer-from", value_name = "STEP", requires = "to_decision")]
pub steer_from: Option<String>,
#[arg(long = "to-decision", value_name = "JSON", requires = "steer_from")]
pub to_decision: Option<String>,
#[arg(long = "reason", value_name = "TEXT", requires = "steer_from")]
pub reason: Option<String>,
#[arg(long = "applied-by", value_name = "ACTOR", requires = "steer_from")]
pub applied_by: Option<String>,
#[arg(long = "scope", value_name = "SCOPE", requires = "steer_from")]
pub scope: Option<String>,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub progress: bool,
#[arg(long = "rate-limit", value_name = "OPS_PER_SEC")]
pub rate_limit: Option<f64>,
}
#[derive(Debug, Args)]
pub(crate) struct TriggerCancelArgs {
#[arg(required_unless_present = "where_expr", conflicts_with = "where_expr")]
pub event_id: Option<String>,
#[arg(long = "where", value_name = "EXPR", conflicts_with = "event_id")]
pub where_expr: Option<String>,
#[arg(long)]
pub dry_run: bool,
#[arg(long)]
pub progress: bool,
#[arg(long = "rate-limit", value_name = "OPS_PER_SEC")]
pub rate_limit: Option<f64>,
}