langgraph_api/generated/models/
cron_create.rs

1/*
2 * LangSmith Deployment
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CronCreate : Payload for creating a stateless cron job (creates a new thread for each execution).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CronCreate {
17    /// The cron schedule to execute this job on.
18    #[serde(rename = "schedule")]
19    pub schedule: String,
20    /// The end date to stop running the cron.
21    #[serde(rename = "end_time", skip_serializing_if = "Option::is_none")]
22    pub end_time: Option<String>,
23    #[serde(rename = "assistant_id")]
24    pub assistant_id: Box<models::CronCreateAssistantId>,
25    #[serde(rename = "input", skip_serializing_if = "Option::is_none")]
26    pub input: Option<Box<models::Input>>,
27    /// Metadata to assign to the cron job runs.
28    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
29    pub metadata: Option<serde_json::Value>,
30    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
31    pub config: Option<Box<models::Config2>>,
32    /// Static context added to the assistant.
33    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
34    pub context: Option<serde_json::Value>,
35    /// Webhook to call after LangGraph API call is done.
36    #[serde(rename = "webhook", skip_serializing_if = "Option::is_none")]
37    pub webhook: Option<String>,
38    #[serde(rename = "interrupt_before", skip_serializing_if = "Option::is_none")]
39    pub interrupt_before: Option<Box<models::InterruptBefore>>,
40    #[serde(rename = "interrupt_after", skip_serializing_if = "Option::is_none")]
41    pub interrupt_after: Option<Box<models::InterruptAfter>>,
42    /// What to do with the thread after the run completes. 'delete' removes the thread after execution. 'keep' creates a new thread for each execution but does not clean them up.
43    #[serde(rename = "on_run_completed", skip_serializing_if = "Option::is_none")]
44    pub on_run_completed: Option<OnRunCompleted>,
45}
46
47impl CronCreate {
48    /// Payload for creating a stateless cron job (creates a new thread for each execution).
49    pub fn new(schedule: String, assistant_id: models::CronCreateAssistantId) -> CronCreate {
50        CronCreate {
51            schedule,
52            end_time: None,
53            assistant_id: Box::new(assistant_id),
54            input: None,
55            metadata: None,
56            config: None,
57            context: None,
58            webhook: None,
59            interrupt_before: None,
60            interrupt_after: None,
61            on_run_completed: None,
62        }
63    }
64}
65/// What to do with the thread after the run completes. 'delete' removes the thread after execution. 'keep' creates a new thread for each execution but does not clean them up.
66#[derive(
67    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
68)]
69pub enum OnRunCompleted {
70    #[serde(rename = "delete")]
71    #[default]
72    Delete,
73    #[serde(rename = "keep")]
74    Keep,
75}