webhook_line/models/
beacon_content.rs

1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
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 BeaconContent {
16    /// Hardware ID of the beacon that was detected
17    #[serde(rename = "hwid")]
18    pub hwid: String,
19    /// Type of beacon event.
20    #[serde(rename = "type")]
21    pub r#type: Type,
22    /// Device message of beacon that was detected.
23    #[serde(rename = "dm", skip_serializing_if = "Option::is_none")]
24    pub dm: Option<String>,
25}
26
27impl BeaconContent {
28    pub fn new(hwid: String, r#type: Type) -> BeaconContent {
29        BeaconContent {
30            hwid,
31            r#type,
32            dm: None,
33        }
34    }
35}
36/// Type of beacon event.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39    #[serde(rename = "enter")]
40    Enter,
41    #[serde(rename = "banner")]
42    Banner,
43    #[serde(rename = "stay")]
44    Stay,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::Enter
50    }
51}
52