webhook_line/models/
detached_module_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 DetachedModuleContent {
16    /// Type
17    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18    pub r#type: Option<String>,
19    /// Detached LINE Official Account bot user ID
20    #[serde(rename = "botId")]
21    pub bot_id: String,
22    /// Reason for detaching
23    #[serde(rename = "reason")]
24    pub reason: Reason,
25}
26
27impl DetachedModuleContent {
28    pub fn new(r#type: String, bot_id: String, reason: Reason) -> DetachedModuleContent {
29        DetachedModuleContent {
30            r#type: Some(r#type),
31            bot_id,
32            reason,
33        }
34    }
35}
36/// Reason for detaching
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Reason {
39    #[serde(rename = "bot_deleted")]
40    BotDeleted,
41}
42
43impl Default for Reason {
44    fn default() -> Reason {
45        Self::BotDeleted
46    }
47}