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