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

/// Cron : Represents a scheduled task.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Cron {
    /// The ID of the cron.
    #[serde(rename = "cron_id")]
    pub cron_id: uuid::Uuid,
    /// The ID of the assistant.
    #[serde(
        rename = "assistant_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub assistant_id: Option<Option<uuid::Uuid>>,
    /// The ID of the thread.
    #[serde(rename = "thread_id")]
    pub thread_id: uuid::Uuid,
    /// The end date to stop running the cron.
    #[serde(rename = "end_time")]
    pub end_time: String,
    /// The schedule to run, cron format.
    #[serde(rename = "schedule")]
    pub schedule: String,
    /// The time the cron was created.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The last time the cron was updated.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// The ID of the user.
    #[serde(
        rename = "user_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub user_id: Option<Option<String>>,
    /// The run payload to use for creating new run.
    #[serde(rename = "payload")]
    pub payload: serde_json::Value,
    /// The next run date of the cron.
    #[serde(
        rename = "next_run_date",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub next_run_date: Option<Option<String>>,
    /// The cron metadata.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
}

impl Cron {
    /// Represents a scheduled task.
    pub fn new(
        cron_id: uuid::Uuid,
        thread_id: uuid::Uuid,
        end_time: String,
        schedule: String,
        created_at: String,
        updated_at: String,
        payload: serde_json::Value,
    ) -> Cron {
        Cron {
            cron_id,
            assistant_id: None,
            thread_id,
            end_time,
            schedule,
            created_at,
            updated_at,
            user_id: None,
            payload,
            next_run_date: None,
            metadata: None,
        }
    }
}