// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
/// Instructions for uploading file content to a reserved file record.
/// Returned when starting a file upload. Carries the new `file_id`, a
/// short-lived signed `upload_url` with the HTTP method and headers to use,
/// a durable reference to the file, and the URL's `expires_at` time.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateUploadResponse {
    /// Underlying file ID
    #[serde(rename = "fileId")]
    pub file_id: String,
    /// Short-lived signed upload URL
    #[serde(rename = "uploadUrl")]
    pub upload_url: String,
    /// HTTP method for upload
    ///
    /// Defaults to `PUT`.
    #[serde(rename = "uploadMethod")]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub upload_method: Option<String>,
    /// Headers required by the signed upload URL
    ///
    /// Defaults to `{}`.
    #[serde(rename = "uploadHeaders")]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub upload_headers: Option<std::collections::HashMap<String, String>>,
    /// Durable Retab MIMEData reference
    #[serde(rename = "mimeData")]
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub mime_data: Option<MimeData>,
    /// Upload URL expiration
    #[serde(rename = "expiresAt")]
    pub expires_at: String,
}
impl CreateUploadResponse {
    /// Construct a new `CreateUploadResponse` with the required fields set.
    #[allow(deprecated)]
    pub fn new(
        file_id: impl Into<String>,
        upload_url: impl Into<String>,
        expires_at: impl Into<String>,
    ) -> Self {
        Self {
            file_id: file_id.into(),
            upload_url: upload_url.into(),
            upload_method: Default::default(),
            upload_headers: Default::default(),
            mime_data: Default::default(),
            expires_at: expires_at.into(),
        }
    }
}
