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 CreateRefundRequest {
    /// Partially Refund an Individual Item
    #[serde(rename = "items", skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<models::PartialRefundItem>>,
    /// Additional metadata associated with the refund.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, String>>,
    /// The unique identifier of the payment to be refunded.
    #[serde(rename = "payment_id")]
    pub payment_id: String,
    /// The reason for the refund, if any. Maximum length is 3000 characters. Optional.
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,
}

impl CreateRefundRequest {
    pub fn new(payment_id: String) -> CreateRefundRequest {
        CreateRefundRequest {
            items: None,
            metadata: None,
            payment_id,
            reason: None,
        }
    }
}