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