webhook_line/models/
activated_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/// ActivatedEvent : This event indicates that the module channel has been switched to Active Channel by calling the Acquire Control API. Sent to the webhook URL server of the module channel.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ActivatedEvent {
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    #[serde(rename = "chatControl")]
33    pub chat_control: Box<models::ChatControl>,
34}
35
36impl ActivatedEvent {
37    /// This event indicates that the module channel has been switched to Active Channel by calling the Acquire Control API. Sent to the webhook URL server of the module channel.
38    pub fn new(
39        r#type: String,
40        timestamp: i64,
41        mode: models::EventMode,
42        webhook_event_id: String,
43        delivery_context: models::DeliveryContext,
44        chat_control: models::ChatControl,
45    ) -> ActivatedEvent {
46        ActivatedEvent {
47            r#type: Some(r#type),
48            source: None,
49            timestamp,
50            mode,
51            webhook_event_id,
52            delivery_context: Box::new(delivery_context),
53            chat_control: Box::new(chat_control),
54        }
55    }
56}