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 GetDisputeResponse {
    /// The amount involved in the dispute, represented as a string to accommodate precision.
    #[serde(rename = "amount")]
    pub amount: String,
    /// The unique identifier of the business involved in the dispute.
    #[serde(rename = "business_id")]
    pub business_id: String,
    /// The timestamp of when the dispute was created, in UTC.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The currency of the disputed amount, represented as an ISO 4217 currency code.
    #[serde(rename = "currency")]
    pub currency: String,
    /// The customer who filed the dispute
    #[serde(rename = "customer")]
    pub customer: Box<models::CustomerLimitedDetailsResponse>,
    /// The unique identifier of the dispute.
    #[serde(rename = "dispute_id")]
    pub dispute_id: String,
    /// The current stage of the dispute process.
    #[serde(rename = "dispute_stage")]
    pub dispute_stage: models::DisputeStage,
    /// The current status of the dispute.
    #[serde(rename = "dispute_status")]
    pub dispute_status: models::DisputeStatus,
    /// The unique identifier of the payment associated with the dispute.
    #[serde(rename = "payment_id")]
    pub payment_id: String,
    /// Reason for the dispute
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
    /// Remarks
    #[serde(rename = "remarks", skip_serializing_if = "Option::is_none")]
    pub remarks: Option<String>,
}

impl GetDisputeResponse {
    pub fn new(amount: String, business_id: String, created_at: String, currency: String, customer: models::CustomerLimitedDetailsResponse, dispute_id: String, dispute_stage: models::DisputeStage, dispute_status: models::DisputeStatus, payment_id: String) -> GetDisputeResponse {
        GetDisputeResponse {
            amount,
            business_id,
            created_at,
            currency,
            customer: Box::new(customer),
            dispute_id,
            dispute_stage,
            dispute_status,
            payment_id,
            reason: None,
            remarks: None,
        }
    }
}