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 CustomerWalletTransactionResponse {
    #[serde(rename = "after_balance")]
    pub after_balance: i64,
    #[serde(rename = "amount")]
    pub amount: i64,
    #[serde(rename = "before_balance")]
    pub before_balance: 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 = "customer_id")]
    pub customer_id: String,
    #[serde(rename = "event_type")]
    pub event_type: models::CustomerLedgerEventType,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "is_credit")]
    pub is_credit: bool,
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
    #[serde(rename = "reference_object_id", skip_serializing_if = "Option::is_none")]
    pub reference_object_id: Option<String>,
}

impl CustomerWalletTransactionResponse {
    pub fn new(after_balance: i64, amount: i64, before_balance: i64, business_id: String, created_at: String, currency: models::Currency, customer_id: String, event_type: models::CustomerLedgerEventType, id: String, is_credit: bool) -> CustomerWalletTransactionResponse {
        CustomerWalletTransactionResponse {
            after_balance,
            amount,
            before_balance,
            business_id,
            created_at,
            currency,
            customer_id,
            event_type,
            id,
            is_credit,
            reason: None,
            reference_object_id: None,
        }
    }
}