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};

/// CashBackPriceInfoResponse 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 CashBackPriceInfoResponse {
    CashBackFixedPriceInfoResponse(Box<models::CashBackFixedPriceInfoResponse>),
    CashBackPercentagePriceInfoResponse(Box<models::CashBackPercentagePriceInfoResponse>),
}

impl Default for CashBackPriceInfoResponse {
    fn default() -> Self {
        Self::CashBackFixedPriceInfoResponse(Box::new(Default::default()))
    }
}

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

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