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

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

/// ResolvedDigitalFile : One file in a resolved digital-files payload.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResolvedDigitalFile {
    /// Optional content-type declared at upload.
    #[serde(rename = "content_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub content_type: Option<Option<String>>,
    /// Short-lived presigned URL for downloading the file.
    #[serde(rename = "download_url")]
    pub download_url: String,
    /// Seconds until `download_url` expires.
    #[serde(rename = "expires_in")]
    pub expires_in: i64,
    /// Identifier of the attached file.
    #[serde(rename = "file_id")]
    pub file_id: String,
    /// Optional size of the file in bytes.
    #[serde(rename = "file_size", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub file_size: Option<Option<i64>>,
    /// Original filename of the attached file.
    #[serde(rename = "filename")]
    pub filename: String,
}

impl ResolvedDigitalFile {
    /// One file in a resolved digital-files payload.
    pub fn new(download_url: String, expires_in: i64, file_id: String, filename: String) -> ResolvedDigitalFile {
        ResolvedDigitalFile {
            content_type: None,
            download_url,
            expires_in,
            file_id,
            file_size: None,
            filename,
        }
    }
}