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 GetPaymentsListResponseItem {
    #[serde(rename = "brand_id")]
    pub brand_id: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    #[serde(rename = "customer")]
    pub customer: Box<models::CustomerLimitedDetailsResponse>,
    #[serde(rename = "digital_products_delivered")]
    pub digital_products_delivered: bool,
    /// The most recent dispute status for this payment. None if no disputes exist.
    #[serde(rename = "dispute_status", skip_serializing_if = "Option::is_none")]
    pub dispute_status: Option<models::DisputeStatus>,
    #[serde(rename = "has_license_key")]
    pub has_license_key: bool,
    /// Invoice ID for this payment. Uses India-specific invoice ID if available.
    #[serde(rename = "invoice_id", skip_serializing_if = "Option::is_none")]
    pub invoice_id: Option<String>,
    /// URL to download the invoice PDF for this payment.
    #[serde(rename = "invoice_url", skip_serializing_if = "Option::is_none")]
    pub invoice_url: Option<String>,
    #[serde(rename = "metadata")]
    pub metadata: std::collections::HashMap<String, String>,
    #[serde(rename = "payment_id")]
    pub payment_id: String,
    #[serde(rename = "payment_method", skip_serializing_if = "Option::is_none")]
    pub payment_method: Option<String>,
    #[serde(rename = "payment_method_type", skip_serializing_if = "Option::is_none")]
    pub payment_method_type: Option<String>,
    /// Summary of the refund status for this payment. None if no succeeded refunds exist.
    #[serde(rename = "refund_status", skip_serializing_if = "Option::is_none")]
    pub refund_status: Option<models::PaymentRefundStatus>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<models::IntentStatus>,
    #[serde(rename = "subscription_id", skip_serializing_if = "Option::is_none")]
    pub subscription_id: Option<String>,
    #[serde(rename = "total_amount")]
    pub total_amount: i32,
}

impl GetPaymentsListResponseItem {
    pub fn new(brand_id: String, created_at: String, currency: models::Currency, customer: models::CustomerLimitedDetailsResponse, digital_products_delivered: bool, has_license_key: bool, metadata: std::collections::HashMap<String, String>, payment_id: String, total_amount: i32) -> GetPaymentsListResponseItem {
        GetPaymentsListResponseItem {
            brand_id,
            created_at,
            currency,
            customer: Box::new(customer),
            digital_products_delivered,
            dispute_status: None,
            has_license_key,
            invoice_id: None,
            invoice_url: None,
            metadata,
            payment_id,
            payment_method: None,
            payment_method_type: None,
            refund_status: None,
            status: None,
            subscription_id: None,
            total_amount,
        }
    }
}