Skip to main content

line_bot_sdk_webhook/models/
module_content.rs

1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 *
8 * Generated by: https://openapi-generator.tech
9 * Post-processed by: post-process-enums-v2.js
10 */
11
12use crate::models;
13use serde::{Deserialize, Serialize};
14
15/// ModuleContent enum using newtype pattern (wraps structs in Box)
16/// This is automatically generated from discriminated schemas
17#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum ModuleContent {
20    AttachedModuleContent(Box<models::AttachedModuleContent>),
21    DetachedModuleContent(Box<models::DetachedModuleContent>),
22}
23
24impl Default for ModuleContent {
25    fn default() -> Self {
26        Self::AttachedModuleContent(Box::new(Default::default()))
27    }
28}
29
30// Conversion methods from struct types to enum variants
31impl From<models::AttachedModuleContent> for ModuleContent {
32    fn from(value: models::AttachedModuleContent) -> Self {
33        ModuleContent::AttachedModuleContent(Box::new(value))
34    }
35}
36
37impl From<models::DetachedModuleContent> for ModuleContent {
38    fn from(value: models::DetachedModuleContent) -> Self {
39        ModuleContent::DetachedModuleContent(Box::new(value))
40    }
41}