gsm_core/messaging_card/adaptive/
mod.rs

1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4pub mod normalizer;
5pub mod validator;
6
7pub use validator::{ValidateError, validate_ac_json};
8
9/// Supported Adaptive Card schema versions for the bootstrap phase.
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
11#[serde(rename_all = "kebab-case")]
12pub enum AdaptiveCardVersion {
13    #[default]
14    V1_6,
15    Custom(String),
16}
17
18/// Lightweight wrapper that keeps the original Adaptive Card JSON around the pipeline.
19#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
20pub struct AdaptiveCardPayload {
21    #[serde(default)]
22    pub version: AdaptiveCardVersion,
23    #[serde(default)]
24    pub content: Value,
25}
26
27impl AdaptiveCardPayload {
28    pub fn new(content: Value) -> Self {
29        Self {
30            content,
31            ..Default::default()
32        }
33    }
34}