netbox_openapi/models/
patched_bulk_custom_field_choice_set_request.rs1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkCustomFieldChoiceSetRequest {
15 #[serde(rename = "id")]
16 pub id: i32,
17 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18 pub name: Option<String>,
19 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
20 pub description: Option<String>,
21 #[serde(
23 rename = "base_choices",
24 default,
25 with = "::serde_with::rust::double_option",
26 skip_serializing_if = "Option::is_none"
27 )]
28 pub base_choices: Option<Option<BaseChoices>>,
29 #[serde(rename = "extra_choices", skip_serializing_if = "Option::is_none")]
30 pub extra_choices: Option<Vec<Vec<serde_json::Value>>>,
31 #[serde(rename = "choice_colors", skip_serializing_if = "Option::is_none")]
32 pub choice_colors: Option<ChoiceColors>,
33 #[serde(
35 rename = "order_alphabetically",
36 skip_serializing_if = "Option::is_none"
37 )]
38 pub order_alphabetically: Option<bool>,
39 #[serde(
40 rename = "owner",
41 default,
42 with = "::serde_with::rust::double_option",
43 skip_serializing_if = "Option::is_none"
44 )]
45 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
46}
47
48impl PatchedBulkCustomFieldChoiceSetRequest {
49 pub fn new(id: i32) -> PatchedBulkCustomFieldChoiceSetRequest {
51 PatchedBulkCustomFieldChoiceSetRequest {
52 id,
53 name: None,
54 description: None,
55 base_choices: None,
56 extra_choices: None,
57 choice_colors: None,
58 order_alphabetically: None,
59 owner: None,
60 }
61 }
62}
63
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum BaseChoices {
67 #[serde(rename = "IATA")]
68 Iata,
69 #[serde(rename = "ISO_3166")]
70 Iso3166,
71 #[serde(rename = "UN_LOCODE")]
72 UnLocode,
73 #[serde(rename = "null")]
74 Null,
75}
76
77impl Default for BaseChoices {
78 fn default() -> BaseChoices {
79 Self::Iata
80 }
81}
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum ChoiceColors {
85 #[serde(rename = "blue")]
86 Blue,
87 #[serde(rename = "indigo")]
88 Indigo,
89 #[serde(rename = "purple")]
90 Purple,
91 #[serde(rename = "pink")]
92 Pink,
93 #[serde(rename = "red")]
94 Red,
95 #[serde(rename = "orange")]
96 Orange,
97 #[serde(rename = "yellow")]
98 Yellow,
99 #[serde(rename = "green")]
100 Green,
101 #[serde(rename = "teal")]
102 Teal,
103 #[serde(rename = "cyan")]
104 Cyan,
105 #[serde(rename = "gray")]
106 Gray,
107 #[serde(rename = "black")]
108 Black,
109 #[serde(rename = "white")]
110 White,
111}
112
113impl Default for ChoiceColors {
114 fn default() -> ChoiceColors {
115 Self::Blue
116 }
117}