use actix_web::HttpRequest;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::future::Future;
use std::pin::Pin;
pub type ActionHandler =
fn(HttpRequest, Vec<String>, Value) -> Pin<Box<dyn Future<Output = actix_web::HttpResponse>>>;
pub struct CustomAction {
pub name: &'static str, pub method: &'static str, pub handler: ActionHandler, pub ui: Option<ActionUi>, }
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ActionUi {
pub label: Option<String>,
pub confirm: Option<String>,
pub fields: Option<Vec<ActionField>>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ActionField {
pub name: String, pub field_type: String, pub label: Option<String>, pub required: Option<bool>,
pub options: Option<Vec<Value>>,
}