line_bot_messaging_api/entity/action/
camera.rs

1use crate::action::LineActionObject;
2use serde_derive::{Deserialize, Serialize};
3
4#[derive(Debug, Default, Deserialize, Serialize, Clone)]
5pub struct LineMessageActionCamera {
6    #[serde(rename = "type")]
7    message_type: String,
8    label: String,
9}
10
11impl LineMessageActionCamera {
12    pub fn new<T: ToString>(label: T) -> Self {
13        Self {
14            message_type: "camera".to_string(),
15            label: label.to_string(),
16        }
17    }
18}
19impl LineActionObject for LineMessageActionCamera {
20    fn build(&self) -> serde_json::Value {
21        serde_json::json!(self)
22    }
23}