Skip to main content

netbox_openapi/models/
patched_bulk_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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedBulkCustomLinkRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkCustomLinkRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "object_types", skip_serializing_if = "Option::is_none")]
18    pub object_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 link text
24    #[serde(rename = "link_text", skip_serializing_if = "Option::is_none")]
25    pub link_text: Option<String>,
26    /// Jinja2 template code for link URL
27    #[serde(rename = "link_url", skip_serializing_if = "Option::is_none")]
28    pub link_url: Option<String>,
29    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
30    pub weight: Option<i32>,
31    /// Links with the same group will appear as a dropdown menu
32    #[serde(rename = "group_name", skip_serializing_if = "Option::is_none")]
33    pub group_name: Option<String>,
34    /// 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
35    #[serde(rename = "button_class", skip_serializing_if = "Option::is_none")]
36    pub button_class: Option<ButtonClass>,
37    /// Force link to open in a new window
38    #[serde(rename = "new_window", skip_serializing_if = "Option::is_none")]
39    pub new_window: Option<bool>,
40    #[serde(
41        rename = "owner",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
47}
48
49impl PatchedBulkCustomLinkRequest {
50    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
51    pub fn new(id: i32) -> PatchedBulkCustomLinkRequest {
52        PatchedBulkCustomLinkRequest {
53            id,
54            object_types: None,
55            name: None,
56            enabled: None,
57            link_text: None,
58            link_url: None,
59            weight: None,
60            group_name: None,
61            button_class: None,
62            new_window: None,
63            owner: None,
64        }
65    }
66}
67
68/// 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
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum ButtonClass {
71    #[serde(rename = "default")]
72    Default,
73    #[serde(rename = "blue")]
74    Blue,
75    #[serde(rename = "indigo")]
76    Indigo,
77    #[serde(rename = "purple")]
78    Purple,
79    #[serde(rename = "pink")]
80    Pink,
81    #[serde(rename = "red")]
82    Red,
83    #[serde(rename = "orange")]
84    Orange,
85    #[serde(rename = "yellow")]
86    Yellow,
87    #[serde(rename = "green")]
88    Green,
89    #[serde(rename = "teal")]
90    Teal,
91    #[serde(rename = "cyan")]
92    Cyan,
93    #[serde(rename = "gray")]
94    Gray,
95    #[serde(rename = "black")]
96    Black,
97    #[serde(rename = "white")]
98    White,
99    #[serde(rename = "ghost-dark")]
100    GhostDark,
101}
102
103impl Default for ButtonClass {
104    fn default() -> ButtonClass {
105        Self::Default
106    }
107}