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 MeterUsageItem {
    /// Chargeable units (after free threshold) as string for precision
    #[serde(rename = "chargeable_units")]
    pub chargeable_units: String,
    /// Total units consumed as string for precision
    #[serde(rename = "consumed_units")]
    pub consumed_units: String,
    /// Currency for the price per unit
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    /// Free threshold units for this meter
    #[serde(rename = "free_threshold")]
    pub free_threshold: i64,
    /// Meter identifier
    #[serde(rename = "id")]
    pub id: String,
    /// Meter name
    #[serde(rename = "name")]
    pub name: String,
    /// Price per unit in string format for precision
    #[serde(rename = "price_per_unit")]
    pub price_per_unit: String,
    /// Total price charged for this meter in smallest currency unit (cents)
    #[serde(rename = "total_price")]
    pub total_price: i32,
}

impl MeterUsageItem {
    pub fn new(chargeable_units: String, consumed_units: String, currency: models::Currency, free_threshold: i64, id: String, name: String, price_per_unit: String, total_price: i32) -> MeterUsageItem {
        MeterUsageItem {
            chargeable_units,
            consumed_units,
            currency,
            free_threshold,
            id,
            name,
            price_per_unit,
            total_price,
        }
    }
}