Skip to main content

netbox_openapi/models/
bulk_custom_field_choice_set_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/// BulkCustomFieldChoiceSetRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkCustomFieldChoiceSetRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
20    pub description: Option<String>,
21    /// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
22    #[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")]
30    pub extra_choices: Vec<Vec<serde_json::Value>>,
31    #[serde(rename = "choice_colors", skip_serializing_if = "Option::is_none")]
32    pub choice_colors: Option<ChoiceColors>,
33    /// Choices are automatically ordered alphabetically
34    #[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 BulkCustomFieldChoiceSetRequest {
49    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
50    pub fn new(
51        id: i32,
52        name: String,
53        extra_choices: Vec<Vec<serde_json::Value>>,
54    ) -> BulkCustomFieldChoiceSetRequest {
55        BulkCustomFieldChoiceSetRequest {
56            id,
57            name,
58            description: None,
59            base_choices: None,
60            extra_choices,
61            choice_colors: None,
62            order_alphabetically: None,
63            owner: None,
64        }
65    }
66}
67
68/// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum BaseChoices {
71    #[serde(rename = "IATA")]
72    Iata,
73    #[serde(rename = "ISO_3166")]
74    Iso3166,
75    #[serde(rename = "UN_LOCODE")]
76    UnLocode,
77    #[serde(rename = "null")]
78    Null,
79}
80
81impl Default for BaseChoices {
82    fn default() -> BaseChoices {
83        Self::Iata
84    }
85}
86///
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum ChoiceColors {
89    #[serde(rename = "blue")]
90    Blue,
91    #[serde(rename = "indigo")]
92    Indigo,
93    #[serde(rename = "purple")]
94    Purple,
95    #[serde(rename = "pink")]
96    Pink,
97    #[serde(rename = "red")]
98    Red,
99    #[serde(rename = "orange")]
100    Orange,
101    #[serde(rename = "yellow")]
102    Yellow,
103    #[serde(rename = "green")]
104    Green,
105    #[serde(rename = "teal")]
106    Teal,
107    #[serde(rename = "cyan")]
108    Cyan,
109    #[serde(rename = "gray")]
110    Gray,
111    #[serde(rename = "black")]
112    Black,
113    #[serde(rename = "white")]
114    White,
115}
116
117impl Default for ChoiceColors {
118    fn default() -> ChoiceColors {
119        Self::Blue
120    }
121}