langgraph_api/generated/models/
cron.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/// Cron : Represents a scheduled task.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Cron {
17    /// The ID of the cron.
18    #[serde(rename = "cron_id")]
19    pub cron_id: uuid::Uuid,
20    /// The ID of the assistant.
21    #[serde(
22        rename = "assistant_id",
23        default,
24        with = "::serde_with::rust::double_option",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub assistant_id: Option<Option<uuid::Uuid>>,
28    /// The ID of the thread.
29    #[serde(rename = "thread_id")]
30    pub thread_id: uuid::Uuid,
31    /// The end date to stop running the cron.
32    #[serde(rename = "end_time")]
33    pub end_time: String,
34    /// The schedule to run, cron format.
35    #[serde(rename = "schedule")]
36    pub schedule: String,
37    /// The time the cron was created.
38    #[serde(rename = "created_at")]
39    pub created_at: String,
40    /// The last time the cron was updated.
41    #[serde(rename = "updated_at")]
42    pub updated_at: String,
43    /// The ID of the user.
44    #[serde(
45        rename = "user_id",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub user_id: Option<Option<String>>,
51    /// The run payload to use for creating new run.
52    #[serde(rename = "payload")]
53    pub payload: serde_json::Value,
54    /// The next run date of the cron.
55    #[serde(
56        rename = "next_run_date",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub next_run_date: Option<Option<String>>,
62    /// The cron metadata.
63    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
64    pub metadata: Option<serde_json::Value>,
65}
66
67impl Cron {
68    /// Represents a scheduled task.
69    pub fn new(
70        cron_id: uuid::Uuid,
71        thread_id: uuid::Uuid,
72        end_time: String,
73        schedule: String,
74        created_at: String,
75        updated_at: String,
76        payload: serde_json::Value,
77    ) -> Cron {
78        Cron {
79            cron_id,
80            assistant_id: None,
81            thread_id,
82            end_time,
83            schedule,
84            created_at,
85            updated_at,
86            user_id: None,
87            payload,
88            next_run_date: None,
89            metadata: None,
90        }
91    }
92}