orvanta-api 6.5.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 6.5.0
 * 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 CopilotConversationMessage {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "conversation_id")]
    pub conversation_id: uuid::Uuid,
    /// Monotonic cursor assigned at insert; the replay order.
    #[serde(rename = "created_seq")]
    pub created_seq: i64,
    /// `actual` is the provider-shaped message replayed to the model on resume; `display` is the rendered transcript entry. The two streams are not 1:1 and are ordered independently.
    #[serde(rename = "channel")]
    pub channel: Channel,
    #[serde(rename = "role")]
    pub role: Role,
    /// The message verbatim, so a conversation round-trips exactly.
    #[serde(rename = "payload", deserialize_with = "Option::deserialize")]
    pub payload: Option<serde_json::Value>,
    #[serde(rename = "size_bytes")]
    pub size_bytes: i32,
    #[serde(rename = "created_at")]
    pub created_at: String,
}

impl CopilotConversationMessage {
    pub fn new(id: uuid::Uuid, conversation_id: uuid::Uuid, created_seq: i64, channel: Channel, role: Role, payload: Option<serde_json::Value>, size_bytes: i32, created_at: String) -> CopilotConversationMessage {
        CopilotConversationMessage {
            id,
            conversation_id,
            created_seq,
            channel,
            role,
            payload,
            size_bytes,
            created_at,
        }
    }
}
/// `actual` is the provider-shaped message replayed to the model on resume; `display` is the rendered transcript entry. The two streams are not 1:1 and are ordered independently.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Channel {
    #[serde(rename = "actual")]
    Actual,
    #[serde(rename = "display")]
    Display,
}

impl Default for Channel {
    fn default() -> Channel {
        Self::Actual
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Role {
    #[serde(rename = "user")]
    User,
    #[serde(rename = "assistant")]
    Assistant,
    #[serde(rename = "system")]
    System,
    #[serde(rename = "tool")]
    Tool,
    #[serde(rename = "developer")]
    Developer,
    #[serde(rename = "function")]
    Function,
}

impl Default for Role {
    fn default() -> Role {
        Self::User
    }
}