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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Thread {
    /// The ID of the thread.
    #[serde(rename = "thread_id")]
    pub thread_id: uuid::Uuid,
    /// The time the thread was created.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The last time the thread was updated.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// The thread metadata.
    #[serde(rename = "metadata")]
    pub metadata: serde_json::Value,
    /// The thread config.
    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
    pub config: Option<serde_json::Value>,
    /// The status of the thread.
    #[serde(rename = "status")]
    pub status: Status,
    /// The current state of the thread.
    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
    pub values: Option<serde_json::Value>,
    /// The current interrupts of the thread.
    #[serde(rename = "interrupts", skip_serializing_if = "Option::is_none")]
    pub interrupts: Option<serde_json::Value>,
}

impl Thread {
    pub fn new(
        thread_id: uuid::Uuid,
        created_at: String,
        updated_at: String,
        metadata: serde_json::Value,
        status: Status,
    ) -> Thread {
        Thread {
            thread_id,
            created_at,
            updated_at,
            metadata,
            config: None,
            status,
            values: None,
            interrupts: None,
        }
    }
}
/// The status of the thread.
#[derive(
    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
)]
pub enum Status {
    #[serde(rename = "idle")]
    #[default]
    Idle,
    #[serde(rename = "busy")]
    Busy,
    #[serde(rename = "interrupted")]
    Interrupted,
    #[serde(rename = "error")]
    Error,
}