1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Text {
    body: String,
    preview_url: Option<bool>,
}

impl Text {
    pub fn new(body: &str) -> Self {
        Self {
            body: body.into(),
            preview_url: None,
        }
    }

    pub fn with_preview_url(body: &str) -> Self {
        Self {
            body: body.into(),
            preview_url: Some(true),
        }
    }
}