Skip to main content

nautobot_openapi/models/
patched_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/// PatchedJobButtonRequest : 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 PatchedJobButtonRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "content_types", skip_serializing_if = "Option::is_none")]
18    pub content_types: Option<Vec<String>>,
19    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
20    pub name: Option<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", skip_serializing_if = "Option::is_none")]
25    pub text: Option<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", skip_serializing_if = "Option::is_none")]
37    pub job: Option<Box<crate::models::BulkWritableJobButtonRequestJob>>,
38}
39
40impl PatchedJobButtonRequest {
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() -> PatchedJobButtonRequest {
43        PatchedJobButtonRequest {
44            id: None,
45            content_types: None,
46            name: None,
47            enabled: None,
48            text: None,
49            weight: None,
50            group_name: None,
51            button_class: None,
52            confirmation: None,
53            job: None,
54        }
55    }
56}