Skip to main content

windmill_api/models/
ai_session_backup.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.816.0
7 * Contact: contact@windmill.dev
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 AiSessionBackup {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "head")]
19    pub head: std::collections::HashMap<String, serde_json::Value>,
20    #[serde(rename = "chats")]
21    pub chats: Vec<models::AiSessionBackupChat>,
22    #[serde(rename = "images")]
23    pub images: Vec<models::AiSessionBackupImage>,
24    #[serde(rename = "artifacts", skip_serializing_if = "Option::is_none")]
25    pub artifacts: Option<std::collections::HashMap<String, serde_json::Value>>,
26    #[serde(rename = "next", skip_serializing_if = "Option::is_none")]
27    pub next: Option<Box<models::AiSessionBackupCursor>>,
28    /// a fingerprint of the session's listing; pages of one session whose fingerprints differ do not belong together
29    #[serde(rename = "listing")]
30    pub listing: String,
31    /// the backup kept changing while this page was read, so it may mix two versions; the browser starts the session over
32    #[serde(rename = "moved", skip_serializing_if = "Option::is_none")]
33    pub moved: Option<bool>,
34}
35
36impl AiSessionBackup {
37    pub fn new(id: String, head: std::collections::HashMap<String, serde_json::Value>, chats: Vec<models::AiSessionBackupChat>, images: Vec<models::AiSessionBackupImage>, listing: String) -> AiSessionBackup {
38        AiSessionBackup {
39            id,
40            head,
41            chats,
42            images,
43            artifacts: None,
44            next: None,
45            listing,
46            moved: None,
47        }
48    }
49}
50