netbox_openapi/models/
patched_custom_link_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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedCustomLinkRequest : 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 PatchedCustomLinkRequest {
15    #[serde(rename = "object_types", skip_serializing_if = "Option::is_none")]
16    pub object_types: Option<Vec<String>>,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
20    pub enabled: Option<bool>,
21    /// Jinja2 template code for link text
22    #[serde(rename = "link_text", skip_serializing_if = "Option::is_none")]
23    pub link_text: Option<String>,
24    /// Jinja2 template code for link URL
25    #[serde(rename = "link_url", skip_serializing_if = "Option::is_none")]
26    pub link_url: Option<String>,
27    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
28    pub weight: Option<i32>,
29    /// Links with the same group will appear as a dropdown menu
30    #[serde(rename = "group_name", skip_serializing_if = "Option::is_none")]
31    pub group_name: Option<String>,
32    /// The class of the first link in a group will be used for the dropdown button  * `default` - Default * `blue` - Blue * `indigo` - Indigo * `purple` - Purple * `pink` - Pink * `red` - Red * `orange` - Orange * `yellow` - Yellow * `green` - Green * `teal` - Teal * `cyan` - Cyan * `gray` - Gray * `black` - Black * `white` - White * `ghost-dark` - Link
33    #[serde(rename = "button_class", skip_serializing_if = "Option::is_none")]
34    pub button_class: Option<ButtonClass>,
35    /// Force link to open in a new window
36    #[serde(rename = "new_window", skip_serializing_if = "Option::is_none")]
37    pub new_window: Option<bool>,
38}
39
40impl PatchedCustomLinkRequest {
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() -> PatchedCustomLinkRequest {
43        PatchedCustomLinkRequest {
44            object_types: None,
45            name: None,
46            enabled: None,
47            link_text: None,
48            link_url: None,
49            weight: None,
50            group_name: None,
51            button_class: None,
52            new_window: None,
53        }
54    }
55}
56
57/// The class of the first link in a group will be used for the dropdown button  * `default` - Default * `blue` - Blue * `indigo` - Indigo * `purple` - Purple * `pink` - Pink * `red` - Red * `orange` - Orange * `yellow` - Yellow * `green` - Green * `teal` - Teal * `cyan` - Cyan * `gray` - Gray * `black` - Black * `white` - White * `ghost-dark` - Link
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum ButtonClass {
60    #[serde(rename = "default")]
61    Default,
62    #[serde(rename = "blue")]
63    Blue,
64    #[serde(rename = "indigo")]
65    Indigo,
66    #[serde(rename = "purple")]
67    Purple,
68    #[serde(rename = "pink")]
69    Pink,
70    #[serde(rename = "red")]
71    Red,
72    #[serde(rename = "orange")]
73    Orange,
74    #[serde(rename = "yellow")]
75    Yellow,
76    #[serde(rename = "green")]
77    Green,
78    #[serde(rename = "teal")]
79    Teal,
80    #[serde(rename = "cyan")]
81    Cyan,
82    #[serde(rename = "gray")]
83    Gray,
84    #[serde(rename = "black")]
85    Black,
86    #[serde(rename = "white")]
87    White,
88    #[serde(rename = "ghost-dark")]
89    GhostDark,
90}
91
92impl Default for ButtonClass {
93    fn default() -> ButtonClass {
94        Self::Default
95    }
96}