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 BalanceLedgerEntryResponse {
    #[serde(rename = "after_balance", skip_serializing_if = "Option::is_none")]
    pub after_balance: Option<i64>,
    #[serde(rename = "amount")]
    pub amount: i64,
    #[serde(rename = "before_balance", skip_serializing_if = "Option::is_none")]
    pub before_balance: Option<i64>,
    #[serde(rename = "business_id")]
    pub business_id: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "event_type")]
    pub event_type: models::LedgerEventType,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "is_credit")]
    pub is_credit: bool,
    #[serde(rename = "reference_object_id", skip_serializing_if = "Option::is_none")]
    pub reference_object_id: Option<String>,
    #[serde(rename = "usd_equivalent_amount")]
    pub usd_equivalent_amount: i64,
}

impl BalanceLedgerEntryResponse {
    pub fn new(amount: i64, business_id: String, created_at: String, currency: models::Currency, event_type: models::LedgerEventType, id: String, is_credit: bool, usd_equivalent_amount: i64) -> BalanceLedgerEntryResponse {
        BalanceLedgerEntryResponse {
            after_balance: None,
            amount,
            before_balance: None,
            business_id,
            created_at,
            currency,
            description: None,
            event_type,
            id,
            is_credit,
            reference_object_id: None,
            usd_equivalent_amount,
        }
    }
}