webhook_line/models/
detached_module_content.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct DetachedModuleContent {
16 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18 pub r#type: Option<String>,
19 #[serde(rename = "botId")]
21 pub bot_id: String,
22 #[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#[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}