Skip to main content

mistral_openapi_client/models/
campaign_preview.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 CampaignPreview {
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 = "name")]
25    pub name: String,
26    #[serde(rename = "owner_id")]
27    pub owner_id: uuid::Uuid,
28    #[serde(rename = "workspace_id")]
29    pub workspace_id: uuid::Uuid,
30    #[serde(rename = "description")]
31    pub description: String,
32    #[serde(rename = "max_nb_events")]
33    pub max_nb_events: i32,
34    #[serde(rename = "search_params", deserialize_with = "Option::deserialize")]
35    pub search_params: Option<Box<models::FilterPayload>>,
36    #[serde(rename = "judge")]
37    pub judge: Box<models::JudgePreview>,
38}
39
40impl CampaignPreview {
41    pub fn new(id: uuid::Uuid, created_at: String, updated_at: String, deleted_at: Option<String>, name: String, owner_id: uuid::Uuid, workspace_id: uuid::Uuid, description: String, max_nb_events: i32, search_params: Option<models::FilterPayload>, judge: models::JudgePreview) -> CampaignPreview {
42        CampaignPreview {
43            id,
44            created_at,
45            updated_at,
46            deleted_at,
47            name,
48            owner_id,
49            workspace_id,
50            description,
51            max_nb_events,
52            search_params: if let Some(x) = search_params {Some(Box::new(x))} else {None},
53            judge: Box::new(judge),
54        }
55    }
56}
57