Skip to main content

mistral_openapi_client/models/
retrieve_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 RetrieveFileOut {
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    #[serde(rename = "deleted")]
49    pub deleted: bool,
50}
51
52impl RetrieveFileOut {
53    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, deleted: bool) -> RetrieveFileOut {
54        RetrieveFileOut {
55            id,
56            object,
57            bytes,
58            created_at,
59            filename,
60            purpose,
61            sample_type,
62            num_lines: None,
63            mimetype: None,
64            source,
65            signature: None,
66            expires_at: None,
67            visibility: None,
68            deleted,
69        }
70    }
71}
72