line-bot-sdk-messaging-api 0.1.0

This document describes LINE Messaging API.
Documentation
/*
 * LINE Messaging API
 *
 * This document describes LINE Messaging API.
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 * Post-processed by: post-process-enums-v2.js
 */

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

/// MentionTarget enum using newtype pattern (wraps structs in Box)
/// This is automatically generated from discriminated schemas
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MentionTarget {
    UserMentionTarget(Box<models::UserMentionTarget>),
    AllMentionTarget(Box<models::AllMentionTarget>),
}

impl Default for MentionTarget {
    fn default() -> Self {
        Self::UserMentionTarget(Box::new(Default::default()))
    }
}

// Conversion methods from struct types to enum variants
impl From<models::UserMentionTarget> for MentionTarget {
    fn from(value: models::UserMentionTarget) -> Self {
        MentionTarget::UserMentionTarget(Box::new(value))
    }
}

impl From<models::AllMentionTarget> for MentionTarget {
    fn from(value: models::AllMentionTarget) -> Self {
        MentionTarget::AllMentionTarget(Box::new(value))
    }
}