Skip to main content

nautobot_openapi/models/
job_request.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// JobRequest : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct JobRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    /// Human-readable grouping that this job belongs to
18    #[serde(rename = "grouping")]
19    pub grouping: String,
20    /// Human-readable name of this job
21    #[serde(rename = "name")]
22    pub name: String,
23    /// Markdown formatting and a limited subset of HTML are supported
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    /// Whether this job can be executed by users
27    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
28    pub enabled: Option<bool>,
29    /// Whether this job contains sensitive variables
30    #[serde(
31        rename = "has_sensitive_variables",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub has_sensitive_variables: Option<bool>,
35    /// Whether this job should fail to run if another instance of this job is already running
36    #[serde(rename = "is_singleton", skip_serializing_if = "Option::is_none")]
37    pub is_singleton: Option<bool>,
38    /// Whether the job defaults to running with console log argument set to true
39    #[serde(
40        rename = "console_log_default",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub console_log_default: Option<bool>,
44    /// Whether the job defaults to not being shown in the UI
45    #[serde(rename = "hidden", skip_serializing_if = "Option::is_none")]
46    pub hidden: Option<bool>,
47    /// Whether the job defaults to running with dryrun argument set to true
48    #[serde(rename = "dryrun_default", skip_serializing_if = "Option::is_none")]
49    pub dryrun_default: Option<bool>,
50    /// Maximum runtime in seconds before the job will receive a <code>SoftTimeLimitExceeded</code> exception.<br>Set to 0 to use Nautobot system default
51    #[serde(rename = "soft_time_limit", skip_serializing_if = "Option::is_none")]
52    pub soft_time_limit: Option<f64>,
53    /// Maximum runtime in seconds before the job will be forcibly terminated.<br>Set to 0 to use Nautobot system default
54    #[serde(rename = "time_limit", skip_serializing_if = "Option::is_none")]
55    pub time_limit: Option<f64>,
56    /// If set, the configured grouping will remain even if the underlying Job source code changes
57    #[serde(rename = "grouping_override", skip_serializing_if = "Option::is_none")]
58    pub grouping_override: Option<bool>,
59    /// If set, the configured name will remain even if the underlying Job source code changes
60    #[serde(rename = "name_override", skip_serializing_if = "Option::is_none")]
61    pub name_override: Option<bool>,
62    /// If set, the configured console log default will remain even if the underlying Job source code changes
63    #[serde(
64        rename = "console_log_default_override",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub console_log_default_override: Option<bool>,
68    /// If set, the configured description will remain even if the underlying Job source code changes
69    #[serde(
70        rename = "description_override",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub description_override: Option<bool>,
74    /// If set, the configured value will remain even if the underlying Job source code changes
75    #[serde(
76        rename = "dryrun_default_override",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub dryrun_default_override: Option<bool>,
80    /// If set, the configured value will remain even if the underlying Job source code changes
81    #[serde(rename = "hidden_override", skip_serializing_if = "Option::is_none")]
82    pub hidden_override: Option<bool>,
83    /// If set, the configured value will remain even if the underlying Job source code changes
84    #[serde(
85        rename = "soft_time_limit_override",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub soft_time_limit_override: Option<bool>,
89    /// If set, the configured value will remain even if the underlying Job source code changes
90    #[serde(
91        rename = "time_limit_override",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub time_limit_override: Option<bool>,
95    /// If set, the configured value will remain even if the underlying Job source code changes
96    #[serde(
97        rename = "has_sensitive_variables_override",
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub has_sensitive_variables_override: Option<bool>,
101    /// If set, the configured value will remain even if the underlying Job source code changes
102    #[serde(
103        rename = "job_queues_override",
104        skip_serializing_if = "Option::is_none"
105    )]
106    pub job_queues_override: Option<bool>,
107    /// If set, the configured value will remain even if the underlying Job source code changes
108    #[serde(
109        rename = "default_job_queue_override",
110        skip_serializing_if = "Option::is_none"
111    )]
112    pub default_job_queue_override: Option<bool>,
113    /// If set, the configured value will remain even if the underlying Job source code changes
114    #[serde(
115        rename = "is_singleton_override",
116        skip_serializing_if = "Option::is_none"
117    )]
118    pub is_singleton_override: Option<bool>,
119    #[serde(rename = "default_job_queue")]
120    pub default_job_queue: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
121    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
122    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
123    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
124    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
125    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
126    pub relationships: Option<
127        ::std::collections::HashMap<
128            String,
129            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
130        >,
131    >,
132}
133
134impl JobRequest {
135    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
136    pub fn new(
137        grouping: String,
138        name: String,
139        default_job_queue: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
140    ) -> JobRequest {
141        JobRequest {
142            id: None,
143            grouping,
144            name,
145            description: None,
146            enabled: None,
147            has_sensitive_variables: None,
148            is_singleton: None,
149            console_log_default: None,
150            hidden: None,
151            dryrun_default: None,
152            soft_time_limit: None,
153            time_limit: None,
154            grouping_override: None,
155            name_override: None,
156            console_log_default_override: None,
157            description_override: None,
158            dryrun_default_override: None,
159            hidden_override: None,
160            soft_time_limit_override: None,
161            time_limit_override: None,
162            has_sensitive_variables_override: None,
163            job_queues_override: None,
164            default_job_queue_override: None,
165            is_singleton_override: None,
166            default_job_queue: Box::new(default_job_queue),
167            tags: None,
168            custom_fields: None,
169            relationships: None,
170        }
171    }
172}