Skip to main content

mistral_openapi_client/models/
dataset_import_task.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 DatasetImportTask {
16    #[serde(rename = "id")]
17    pub id: uuid::Uuid,
18    #[serde(rename = "created_at")]
19    pub created_at: String,
20    #[serde(rename = "updated_at")]
21    pub updated_at: String,
22    #[serde(rename = "deleted_at", deserialize_with = "Option::deserialize")]
23    pub deleted_at: Option<String>,
24    #[serde(rename = "creator_id")]
25    pub creator_id: uuid::Uuid,
26    #[serde(rename = "dataset_id")]
27    pub dataset_id: uuid::Uuid,
28    #[serde(rename = "workspace_id")]
29    pub workspace_id: uuid::Uuid,
30    #[serde(rename = "status")]
31    pub status: models::BaseTaskStatus,
32    #[serde(rename = "progress", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub progress: Option<Option<i32>>,
34    #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub message: Option<Option<String>>,
36}
37
38impl DatasetImportTask {
39    pub fn new(id: uuid::Uuid, created_at: String, updated_at: String, deleted_at: Option<String>, creator_id: uuid::Uuid, dataset_id: uuid::Uuid, workspace_id: uuid::Uuid, status: models::BaseTaskStatus) -> DatasetImportTask {
40        DatasetImportTask {
41            id,
42            created_at,
43            updated_at,
44            deleted_at,
45            creator_id,
46            dataset_id,
47            workspace_id,
48            status,
49            progress: None,
50            message: None,
51        }
52    }
53}
54