langgraph_api/generated/models/
thread_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/// ThreadCronCreate : Payload for creating a thread-specific cron job (runs on the same thread).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ThreadCronCreate {
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::ThreadCronCreateAssistantId>,
25    #[serde(rename = "input", skip_serializing_if = "Option::is_none")]
26    pub input: Option<Box<models::Input2>>,
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::Config3>>,
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::InterruptBefore1>>,
40    #[serde(rename = "interrupt_after", skip_serializing_if = "Option::is_none")]
41    pub interrupt_after: Option<Box<models::InterruptAfter1>>,
42    /// Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.
43    #[serde(rename = "multitask_strategy", skip_serializing_if = "Option::is_none")]
44    pub multitask_strategy: Option<MultitaskStrategy>,
45}
46
47impl ThreadCronCreate {
48    /// Payload for creating a thread-specific cron job (runs on the same thread).
49    pub fn new(
50        schedule: String,
51        assistant_id: models::ThreadCronCreateAssistantId,
52    ) -> ThreadCronCreate {
53        ThreadCronCreate {
54            schedule,
55            end_time: None,
56            assistant_id: Box::new(assistant_id),
57            input: None,
58            metadata: None,
59            config: None,
60            context: None,
61            webhook: None,
62            interrupt_before: None,
63            interrupt_after: None,
64            multitask_strategy: None,
65        }
66    }
67}
68/// Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.
69#[derive(
70    Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize,
71)]
72pub enum MultitaskStrategy {
73    #[serde(rename = "reject")]
74    #[default]
75    Reject,
76    #[serde(rename = "rollback")]
77    Rollback,
78    #[serde(rename = "interrupt")]
79    Interrupt,
80    #[serde(rename = "enqueue")]
81    Enqueue,
82}