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 PayoutsResponse {
    /// The total amount of the payout.
    #[serde(rename = "amount")]
    pub amount: i64,
    /// The unique identifier of the business associated with the payout.
    #[serde(rename = "business_id")]
    pub business_id: String,
    /// The total value of chargebacks associated with the payout.
    #[serde(rename = "chargebacks")]
    pub chargebacks: i64,
    /// The timestamp when the payout was created, in UTC.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The currency of the payout, represented as an ISO 4217 currency code.
    #[serde(rename = "currency")]
    pub currency: models::Currency,
    /// The fee charged for processing the payout.
    #[serde(rename = "fee")]
    pub fee: i64,
    /// The name of the payout recipient or purpose.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The payment method used for the payout (e.g., bank transfer, card, etc.).
    #[serde(rename = "payment_method")]
    pub payment_method: String,
    /// The URL of the document associated with the payout.
    #[serde(rename = "payout_document_url", skip_serializing_if = "Option::is_none")]
    pub payout_document_url: Option<String>,
    /// The unique identifier of the payout.
    #[serde(rename = "payout_id")]
    pub payout_id: String,
    /// The total value of refunds associated with the payout.
    #[serde(rename = "refunds")]
    pub refunds: i64,
    /// Any additional remarks or notes associated with the payout.
    #[serde(rename = "remarks", skip_serializing_if = "Option::is_none")]
    pub remarks: Option<String>,
    /// The current status of the payout.
    #[serde(rename = "status")]
    pub status: models::PayoutStatus,
    /// The tax applied to the payout.
    #[serde(rename = "tax")]
    pub tax: i64,
    /// The timestamp when the payout was last updated, in UTC.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl PayoutsResponse {
    pub fn new(amount: i64, business_id: String, chargebacks: i64, created_at: String, currency: models::Currency, fee: i64, payment_method: String, payout_id: String, refunds: i64, status: models::PayoutStatus, tax: i64, updated_at: String) -> PayoutsResponse {
        PayoutsResponse {
            amount,
            business_id,
            chargebacks,
            created_at,
            currency,
            fee,
            name: None,
            payment_method,
            payout_document_url: None,
            payout_id,
            refunds,
            remarks: None,
            status,
            tax,
            updated_at,
        }
    }
}