Skip to main content

nautobot_openapi/models/
job_button_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/// JobButtonRequest : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct JobButtonRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "content_types")]
18    pub content_types: Vec<String>,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
22    pub enabled: Option<bool>,
23    /// Jinja2 template code for button text. Reference the object as <code>{{ obj }}</code> such as <code>{{ obj.platform.name }}</code>. Buttons which render as empty text will not be displayed.
24    #[serde(rename = "text")]
25    pub text: String,
26    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
27    pub weight: Option<i32>,
28    /// Buttons with the same group will appear as a dropdown menu. Group dropdown buttons will inherit the button class from the button with the lowest weight in the group.
29    #[serde(rename = "group_name", skip_serializing_if = "Option::is_none")]
30    pub group_name: Option<String>,
31    #[serde(rename = "button_class", skip_serializing_if = "Option::is_none")]
32    pub button_class: Option<crate::models::ButtonClassEnum>,
33    /// Enable confirmation pop-up box. <span class='text-danger'>WARNING: unselecting this option will allow the Job to run (and commit changes) with a single click!</span>
34    #[serde(rename = "confirmation", skip_serializing_if = "Option::is_none")]
35    pub confirmation: Option<bool>,
36    #[serde(rename = "job")]
37    pub job: Box<crate::models::BulkWritableJobButtonRequestJob>,
38}
39
40impl JobButtonRequest {
41    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
42    pub fn new(
43        content_types: Vec<String>,
44        name: String,
45        text: String,
46        job: crate::models::BulkWritableJobButtonRequestJob,
47    ) -> JobButtonRequest {
48        JobButtonRequest {
49            id: None,
50            content_types,
51            name,
52            enabled: None,
53            text,
54            weight: None,
55            group_name: None,
56            button_class: None,
57            confirmation: None,
58            job: Box::new(job),
59        }
60    }
61}