Skip to main content

netbox_openapi/models/
script_input_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.6.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct ScriptInputRequest {
13    #[serde(rename = "data", deserialize_with = "Option::deserialize")]
14    pub data: Option<serde_json::Value>,
15    #[serde(rename = "commit")]
16    pub commit: bool,
17    #[serde(
18        rename = "schedule_at",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub schedule_at: Option<Option<String>>,
24    #[serde(
25        rename = "interval",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub interval: Option<Option<i32>>,
31    /// * `always` - Always * `on_failure` - On failure * `never` - Never
32    #[serde(rename = "notifications", skip_serializing_if = "Option::is_none")]
33    pub notifications: Option<Notifications>,
34}
35
36impl ScriptInputRequest {
37    pub fn new(data: Option<serde_json::Value>, commit: bool) -> ScriptInputRequest {
38        ScriptInputRequest {
39            data,
40            commit,
41            schedule_at: None,
42            interval: None,
43            notifications: None,
44        }
45    }
46}
47
48/// * `always` - Always * `on_failure` - On failure * `never` - Never
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Notifications {
51    #[serde(rename = "always")]
52    Always,
53    #[serde(rename = "on_failure")]
54    OnFailure,
55    #[serde(rename = "never")]
56    Never,
57}
58
59impl Default for Notifications {
60    fn default() -> Notifications {
61        Self::Always
62    }
63}