/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// SendInboxMessageRequestInteractive : WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, and Flow prompts. When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object verbatim, so any payload that works against Meta directly will also work here.  Use `buttons` / `quickReplies` for simple button replies (WhatsApp's `interactive.type: \"button\"`) — the abstraction caps at 3 buttons and handles the auto-conversion for you. Use this field only for `list`, `cta_url`, or `flow` messages.  Tap events come back via the `message.received` webhook with `metadata.interactiveType` set to `list_reply` or `nfm_reply`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendInboxMessageRequestInteractive {
    /// Which interactive layout to render.
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "header", skip_serializing_if = "Option::is_none")]
    pub header: Option<Box<models::SendInboxMessageRequestInteractiveHeader>>,
    #[serde(rename = "body")]
    pub body: Box<models::SendInboxMessageRequestInteractiveBody>,
    #[serde(rename = "footer", skip_serializing_if = "Option::is_none")]
    pub footer: Option<Box<models::SendInboxMessageRequestInteractiveFooter>>,
    #[serde(rename = "action")]
    pub action: Box<models::SendInboxMessageRequestInteractiveAction>,
}

impl SendInboxMessageRequestInteractive {
    /// WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, and Flow prompts. When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object verbatim, so any payload that works against Meta directly will also work here.  Use `buttons` / `quickReplies` for simple button replies (WhatsApp's `interactive.type: \"button\"`) — the abstraction caps at 3 buttons and handles the auto-conversion for you. Use this field only for `list`, `cta_url`, or `flow` messages.  Tap events come back via the `message.received` webhook with `metadata.interactiveType` set to `list_reply` or `nfm_reply`.
    pub fn new(
        r#type: Type,
        body: models::SendInboxMessageRequestInteractiveBody,
        action: models::SendInboxMessageRequestInteractiveAction,
    ) -> SendInboxMessageRequestInteractive {
        SendInboxMessageRequestInteractive {
            r#type,
            header: None,
            body: Box::new(body),
            footer: None,
            action: Box::new(action),
        }
    }
}
/// Which interactive layout to render.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "list")]
    List,
    #[serde(rename = "cta_url")]
    CtaUrl,
    #[serde(rename = "flow")]
    Flow,
}

impl Default for Type {
    fn default() -> Type {
        Self::List
    }
}
