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

/// GraphSchema : Defines the structure and properties of a graph.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GraphSchema {
    /// The ID of the graph.
    #[serde(rename = "graph_id")]
    pub graph_id: String,
    /// The schema for the graph input. Missing if unable to generate JSON schema from graph.
    #[serde(rename = "input_schema", skip_serializing_if = "Option::is_none")]
    pub input_schema: Option<serde_json::Value>,
    /// The schema for the graph output. Missing if unable to generate JSON schema from graph.
    #[serde(rename = "output_schema", skip_serializing_if = "Option::is_none")]
    pub output_schema: Option<serde_json::Value>,
    /// The schema for the graph state. Missing if unable to generate JSON schema from graph.
    #[serde(rename = "state_schema")]
    pub state_schema: serde_json::Value,
    /// The schema for the graph config. Missing if unable to generate JSON schema from graph.
    #[serde(rename = "config_schema", skip_serializing_if = "Option::is_none")]
    pub config_schema: Option<serde_json::Value>,
    /// The schema for the graph context. Missing if unable to generate JSON schema from graph.
    #[serde(rename = "context_schema", skip_serializing_if = "Option::is_none")]
    pub context_schema: Option<serde_json::Value>,
}

impl GraphSchema {
    /// Defines the structure and properties of a graph.
    pub fn new(graph_id: String, state_schema: serde_json::Value) -> GraphSchema {
        GraphSchema {
            graph_id,
            input_schema: None,
            output_schema: None,
            state_schema,
            config_schema: None,
            context_schema: None,
        }
    }
}