Skip to main content

netbox_openapi/models/
patched_writable_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.0 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableCustomFieldChoiceSetRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableCustomFieldChoiceSetRequest {
15    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
16    pub name: Option<String>,
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    /// Base set of predefined choices (optional)  * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
20    #[serde(
21        rename = "base_choices",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub base_choices: Option<Option<BaseChoices>>,
27    #[serde(rename = "extra_choices", skip_serializing_if = "Option::is_none")]
28    pub extra_choices: Option<Vec<Vec<serde_json::Value>>>,
29    #[serde(rename = "choice_colors", skip_serializing_if = "Option::is_none")]
30    pub choice_colors: Option<ChoiceColors>,
31    /// Choices are automatically ordered alphabetically
32    #[serde(
33        rename = "order_alphabetically",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub order_alphabetically: Option<bool>,
37    #[serde(
38        rename = "owner",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
44}
45
46impl PatchedWritableCustomFieldChoiceSetRequest {
47    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
48    pub fn new() -> PatchedWritableCustomFieldChoiceSetRequest {
49        PatchedWritableCustomFieldChoiceSetRequest {
50            name: None,
51            description: None,
52            base_choices: None,
53            extra_choices: None,
54            choice_colors: None,
55            order_alphabetically: None,
56            owner: None,
57        }
58    }
59}
60
61/// Base set of predefined choices (optional)  * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum BaseChoices {
64    #[serde(rename = "IATA")]
65    Iata,
66    #[serde(rename = "ISO_3166")]
67    Iso3166,
68    #[serde(rename = "UN_LOCODE")]
69    UnLocode,
70    #[serde(rename = "")]
71    Empty,
72    #[serde(rename = "null")]
73    Null,
74}
75
76impl Default for BaseChoices {
77    fn default() -> BaseChoices {
78        Self::Iata
79    }
80}
81///
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum ChoiceColors {
84    #[serde(rename = "blue")]
85    Blue,
86    #[serde(rename = "indigo")]
87    Indigo,
88    #[serde(rename = "purple")]
89    Purple,
90    #[serde(rename = "pink")]
91    Pink,
92    #[serde(rename = "red")]
93    Red,
94    #[serde(rename = "orange")]
95    Orange,
96    #[serde(rename = "yellow")]
97    Yellow,
98    #[serde(rename = "green")]
99    Green,
100    #[serde(rename = "teal")]
101    Teal,
102    #[serde(rename = "cyan")]
103    Cyan,
104    #[serde(rename = "gray")]
105    Gray,
106    #[serde(rename = "black")]
107    Black,
108    #[serde(rename = "white")]
109    White,
110}
111
112impl Default for ChoiceColors {
113    fn default() -> ChoiceColors {
114        Self::Blue
115    }
116}