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

#[derive(Debug, Default, Deserialize, Serialize, Clone)]
pub struct LineMessageActionCamera {
    #[serde(rename = "type")]
    message_type: String,
    label: String,
}

impl LineMessageActionCamera {
    pub fn new<T: ToString>(label: T) -> Self {
        Self {
            message_type: "camera".to_string(),
            label: label.to_string(),
        }
    }
}
impl LineActionObject for LineMessageActionCamera {
    fn build(&self) -> serde_json::Value {
        serde_json::json!(self)
    }
}