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.97.5
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DigitalFilesConfig {
    /// Files attached to this entitlement. Add files via `POST /entitlements/{id}/files` and remove them via `DELETE /entitlements/{id}/files/{file_id}`.
    #[serde(rename = "digital_file_ids")]
    pub digital_file_ids: Vec<String>,
    /// Optional external URL shown to the customer alongside the files.
    #[serde(rename = "external_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub external_url: Option<Option<String>>,
    /// Optional human-readable delivery instructions shown to the customer alongside the files.
    #[serde(rename = "instructions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub instructions: Option<Option<String>>,
    /// Three-way patchable list of legacy file identifiers:  * omitted → preserve the current value * `null`  → clear * `[...]` → replace  On create, an omitted field, an explicit `null`, or an empty array all result in no legacy files attached.
    #[serde(rename = "legacy_file_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub legacy_file_ids: Option<Option<Vec<String>>>,
}

impl DigitalFilesConfig {
    pub fn new(digital_file_ids: Vec<String>) -> DigitalFilesConfig {
        DigitalFilesConfig {
            digital_file_ids,
            external_url: None,
            instructions: None,
            legacy_file_ids: None,
        }
    }
}