dodopayments_rust 2.2.2

Rust SDK for Dodo Payments API
Documentation
/*
 * public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.87.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Addon {
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "proration_factor")]
    pub proration_factor: f64,
    #[serde(rename = "quantity")]
    pub quantity: i32,
    #[serde(rename = "tax", skip_serializing_if = "Option::is_none")]
    pub tax: Option<i32>,
    #[serde(rename = "tax_category")]
    pub tax_category: models::TaxCategory,
    #[serde(rename = "tax_inclusive")]
    pub tax_inclusive: bool,
    #[serde(rename = "tax_rate")]
    pub tax_rate: f32,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "unit_price")]
    pub unit_price: i32,
}

impl Addon {
    pub fn new(currency: models::Currency, id: String, name: String, proration_factor: f64, quantity: i32, tax_category: models::TaxCategory, tax_inclusive: bool, tax_rate: f32, r#type: Type, unit_price: i32) -> Addon {
        Addon {
            currency,
            description: None,
            id,
            name,
            proration_factor,
            quantity,
            tax: None,
            tax_category,
            tax_inclusive,
            tax_rate,
            r#type,
            unit_price,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "addon")]
    Addon,
}

impl Default for Type {
    fn default() -> Type {
        Self::Addon
    }
}