Skip to main content

late/models/
whats_app_header_component.rs

1/*
2 * Zernio API
3 *
4 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5 *
6 * The version of the OpenAPI document: 1.0.4
7 * Contact: support@zernio.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WhatsAppHeaderComponent {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    #[serde(rename = "format")]
19    pub format: Format,
20    /// Header text (may include {{1}} variable). Used when format is TEXT.
21    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
22    pub text: Option<String>,
23    #[serde(rename = "example", skip_serializing_if = "Option::is_none")]
24    pub example: Option<Box<models::WhatsAppHeaderComponentExample>>,
25}
26
27impl WhatsAppHeaderComponent {
28    pub fn new(r#type: Type, format: Format) -> WhatsAppHeaderComponent {
29        WhatsAppHeaderComponent {
30            r#type,
31            format,
32            text: None,
33            example: None,
34        }
35    }
36}
37///
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40    #[serde(rename = "header")]
41    Header,
42}
43
44impl Default for Type {
45    fn default() -> Type {
46        Self::Header
47    }
48}
49///
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Format {
52    #[serde(rename = "text")]
53    Text,
54    #[serde(rename = "image")]
55    Image,
56    #[serde(rename = "video")]
57    Video,
58    #[serde(rename = "gif")]
59    Gif,
60    #[serde(rename = "document")]
61    Document,
62    #[serde(rename = "location")]
63    Location,
64}
65
66impl Default for Format {
67    fn default() -> Format {
68        Self::Text
69    }
70}