webhook_line/models/
beacon_event.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/// BeaconEvent : Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BeaconEvent {
17    /// Type of the event
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<String>,
20    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
21    pub source: Option<Box<models::Source>>,
22    /// Time of the event in milliseconds.
23    #[serde(rename = "timestamp")]
24    pub timestamp: i64,
25    #[serde(rename = "mode")]
26    pub mode: models::EventMode,
27    /// Webhook Event ID. An ID that uniquely identifies a webhook event. This is a string in ULID format.
28    #[serde(rename = "webhookEventId")]
29    pub webhook_event_id: String,
30    #[serde(rename = "deliveryContext")]
31    pub delivery_context: Box<models::DeliveryContext>,
32    /// Reply token used to send reply message to this event
33    #[serde(rename = "replyToken")]
34    pub reply_token: String,
35    #[serde(rename = "beacon")]
36    pub beacon: Box<models::BeaconContent>,
37}
38
39impl BeaconEvent {
40    /// Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events.
41    pub fn new(
42        r#type: String,
43        timestamp: i64,
44        mode: models::EventMode,
45        webhook_event_id: String,
46        delivery_context: models::DeliveryContext,
47        reply_token: String,
48        beacon: models::BeaconContent,
49    ) -> BeaconEvent {
50        BeaconEvent {
51            r#type: Some(r#type),
52            source: None,
53            timestamp,
54            mode,
55            webhook_event_id,
56            delivery_context: Box::new(delivery_context),
57            reply_token,
58            beacon: Box::new(beacon),
59        }
60    }
61}