use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateLedgerEntryResponse {
#[serde(rename = "amount")]
pub amount: String,
#[serde(rename = "balance_after")]
pub balance_after: String,
#[serde(rename = "balance_before")]
pub balance_before: String,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "credit_entitlement_id")]
pub credit_entitlement_id: String,
#[serde(rename = "customer_id")]
pub customer_id: String,
#[serde(rename = "entry_type")]
pub entry_type: models::LedgerEntryType,
#[serde(rename = "grant_id", skip_serializing_if = "Option::is_none")]
pub grant_id: Option<String>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "is_credit")]
pub is_credit: bool,
#[serde(rename = "overage_after")]
pub overage_after: String,
#[serde(rename = "overage_before")]
pub overage_before: String,
#[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
}
impl CreateLedgerEntryResponse {
pub fn new(amount: String, balance_after: String, balance_before: String, created_at: String, credit_entitlement_id: String, customer_id: String, entry_type: models::LedgerEntryType, id: String, is_credit: bool, overage_after: String, overage_before: String) -> CreateLedgerEntryResponse {
CreateLedgerEntryResponse {
amount,
balance_after,
balance_before,
created_at,
credit_entitlement_id,
customer_id,
entry_type,
grant_id: None,
id,
is_credit,
overage_after,
overage_before,
reason: None,
}
}
}