dodopayments_rust 2.2.1

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 Meter {
    #[serde(rename = "chargeable_units")]
    pub chargeable_units: String,
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "free_threshold")]
    pub free_threshold: i64,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "price_per_unit")]
    pub price_per_unit: String,
    #[serde(rename = "subtotal")]
    pub subtotal: i32,
    #[serde(rename = "tax", skip_serializing_if = "Option::is_none")]
    pub tax: Option<i32>,
    #[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 = "units_consumed")]
    pub units_consumed: String,
}

impl Meter {
    pub fn new(chargeable_units: String, currency: models::Currency, free_threshold: i64, id: String, name: String, price_per_unit: String, subtotal: i32, tax_inclusive: bool, tax_rate: f32, r#type: Type, units_consumed: String) -> Meter {
        Meter {
            chargeable_units,
            currency,
            description: None,
            free_threshold,
            id,
            name,
            price_per_unit,
            subtotal,
            tax: None,
            tax_inclusive,
            tax_rate,
            r#type,
            units_consumed,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "meter")]
    Meter,
}

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