langgraph-api 0.1.1

Rust Client API of LangGraph
Documentation
/*
 * LangSmith Deployment
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// ThreadCreate : Payload for creating a thread.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ThreadCreate {
    /// The ID of the thread. If not provided, a random UUID will be generated.
    #[serde(rename = "thread_id", skip_serializing_if = "Option::is_none")]
    pub thread_id: Option<uuid::Uuid>,
    /// Metadata to add to thread.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    /// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).
    #[serde(rename = "if_exists", skip_serializing_if = "Option::is_none")]
    pub if_exists: Option<IfExists>,
    #[serde(rename = "ttl", skip_serializing_if = "Option::is_none")]
    pub ttl: Option<Box<models::Ttl>>,
    #[serde(rename = "supersteps", skip_serializing_if = "Option::is_none")]
    pub supersteps: Option<Vec<models::ThreadCreateSuperstepsInner>>,
}

impl ThreadCreate {
    /// Payload for creating a thread.
    pub fn new() -> ThreadCreate {
        ThreadCreate {
            thread_id: None,
            metadata: None,
            if_exists: None,
            ttl: None,
            supersteps: None,
        }
    }
}
/// How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).
#[derive(
    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
)]
pub enum IfExists {
    #[serde(rename = "raise")]
    #[default]
    Raise,
    #[serde(rename = "do_nothing")]
    DoNothing,
}