Skip to main content

mistral_openapi_client/models/
upload_file_out.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct UploadFileOut {
16    /// The unique identifier of the file.
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    /// The object type, which is always \"file\".
20    #[serde(rename = "object")]
21    pub object: String,
22    /// The size of the file, in bytes.
23    #[serde(rename = "bytes")]
24    pub bytes: i32,
25    /// The UNIX timestamp (in seconds) of the event.
26    #[serde(rename = "created_at")]
27    pub created_at: i32,
28    /// The name of the uploaded file.
29    #[serde(rename = "filename")]
30    pub filename: String,
31    /// The intended purpose of the uploaded file, currently supports fine-tuning (`fine-tune`), OCR (`ocr`), Audio/Transcription (`audio`) and batch inference (`batch`).
32    #[serde(rename = "purpose")]
33    pub purpose: models::FilePurpose,
34    #[serde(rename = "sample_type")]
35    pub sample_type: models::SampleType,
36    #[serde(rename = "num_lines", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub num_lines: Option<Option<i32>>,
38    #[serde(rename = "mimetype", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub mimetype: Option<Option<String>>,
40    #[serde(rename = "source")]
41    pub source: models::Source,
42    #[serde(rename = "signature", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub signature: Option<Option<String>>,
44    #[serde(rename = "expires_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub expires_at: Option<Option<i32>>,
46    #[serde(rename = "visibility", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub visibility: Option<Option<models::FileVisibility>>,
48}
49
50impl UploadFileOut {
51    pub fn new(id: uuid::Uuid, object: String, bytes: i32, created_at: i32, filename: String, purpose: models::FilePurpose, sample_type: models::SampleType, source: models::Source) -> UploadFileOut {
52        UploadFileOut {
53            id,
54            object,
55            bytes,
56            created_at,
57            filename,
58            purpose,
59            sample_type,
60            num_lines: None,
61            mimetype: None,
62            source,
63            signature: None,
64            expires_at: None,
65            visibility: None,
66        }
67    }
68}
69