Skip to main content

nautobot_openapi/models/
bulk_writable_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/// BulkWritableJobButtonRequest : 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 BulkWritableJobButtonRequest {
15    #[serde(rename = "id")]
16    pub id: 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 BulkWritableJobButtonRequest {
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        id: uuid::Uuid,
44        content_types: Vec<String>,
45        name: String,
46        text: String,
47        job: crate::models::BulkWritableJobButtonRequestJob,
48    ) -> BulkWritableJobButtonRequest {
49        BulkWritableJobButtonRequest {
50            id,
51            content_types,
52            name,
53            enabled: None,
54            text,
55            weight: None,
56            group_name: None,
57            button_class: None,
58            confirmation: None,
59            job: Box::new(job),
60        }
61    }
62}