webhook-line 1.0.1

Webhook event definition of the LINE Messaging API
Documentation
/*
 * Webhook Type Definition
 *
 * Webhook event definition of the LINE Messaging API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DetachedModuleContent {
    /// Type
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// Detached LINE Official Account bot user ID
    #[serde(rename = "botId")]
    pub bot_id: String,
    /// Reason for detaching
    #[serde(rename = "reason")]
    pub reason: Reason,
}

impl DetachedModuleContent {
    pub fn new(r#type: String, bot_id: String, reason: Reason) -> DetachedModuleContent {
        DetachedModuleContent {
            r#type: Some(r#type),
            bot_id,
            reason,
        }
    }
}
/// Reason for detaching
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Reason {
    #[serde(rename = "bot_deleted")]
    BotDeleted,
}

impl Default for Reason {
    fn default() -> Reason {
        Self::BotDeleted
    }
}