openai-types 0.1.3

Typed OpenAI API models — zero dependencies beyond serde
Documentation
// AUTO-GENERATED by py2rust — do not edit.
// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
// Domain: uploads
#![allow(unused_imports)]

use serde::{Deserialize, Serialize};
use super::*;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct PartCreateParams {
    /// The chunk of bytes for this Part.
    pub data: serde_json::Value,
}

/// The upload Part represents a chunk of bytes we can add to an Upload object.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct UploadPart {
    /// The upload Part unique identifier, which can be referenced in API endpoints.
    pub id: String,
    /// The Unix timestamp (in seconds) for when the Part was created.
    pub created_at: i64,
    /// The object type, which is always `upload.part`.
    pub object: String,
    /// The ID of the Upload object that this Part was added to.
    pub upload_id: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct UploadCompleteParams {
    /// The ordered list of Part IDs.
    pub part_ids: serde_json::Value,
    /// The optional md5 checksum for the file contents to verify if the bytes uploaded
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub md5: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct UploadCreateParams {
    /// The number of bytes in the file you are uploading.
    pub bytes: i64,
    /// The name of the file to upload.
    pub filename: String,
    /// The MIME type of the file.
    pub mime_type: String,
    /// The intended purpose of the uploaded file.
    pub purpose: serde_json::Value,
    /// The expiration policy for a file.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub expires_after: Option<ExpiresAfter>,
}

/// The expiration policy for a file.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct ExpiresAfter {
    /// Anchor timestamp after which the expiration policy applies.
    pub anchor: String,
    /// The number of seconds after the anchor time that the file will expire.
    pub seconds: i64,
}