/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FlowConversation {
    /// Unique identifier for the conversation
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// The workspace ID where the conversation belongs
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    /// Path of the flow this conversation is for
    #[serde(rename = "flow_path")]
    pub flow_path: String,
    /// Optional title for the conversation
    #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub title: Option<Option<String>>,
    /// When the conversation was created
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// When the conversation was last updated
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// Username who created the conversation
    #[serde(rename = "created_by")]
    pub created_by: String,
}

impl FlowConversation {
    pub fn new(id: uuid::Uuid, workspace_id: String, flow_path: String, created_at: String, updated_at: String, created_by: String) -> FlowConversation {
        FlowConversation {
            id,
            workspace_id,
            flow_path,
            title: None,
            created_at,
            updated_at,
            created_by,
        }
    }
}

