Skip to main content

netbox_openapi/models/
custom_field_choice_set_base_choices.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#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct CustomFieldChoiceSetBaseChoices {
13    /// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
14    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
15    pub value: Option<Value>,
16    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
17    pub label: Option<Label>,
18}
19
20impl CustomFieldChoiceSetBaseChoices {
21    pub fn new() -> CustomFieldChoiceSetBaseChoices {
22        CustomFieldChoiceSetBaseChoices {
23            value: None,
24            label: None,
25        }
26    }
27}
28
29/// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
30#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
31pub enum Value {
32    #[serde(rename = "IATA")]
33    Iata,
34    #[serde(rename = "ISO_3166")]
35    Iso3166,
36    #[serde(rename = "UN_LOCODE")]
37    UnLocode,
38    #[serde(rename = "null")]
39    Null,
40}
41
42impl Default for Value {
43    fn default() -> Value {
44        Self::Iata
45    }
46}
47///
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Label {
50    #[serde(rename = "IATA (Airport codes)")]
51    IataLeftParenthesisAirportCodesRightParenthesis,
52    #[serde(rename = "ISO 3166 (Country codes)")]
53    Iso3166LeftParenthesisCountryCodesRightParenthesis,
54    #[serde(rename = "UN/LOCODE (Location codes)")]
55    UnSlashLocodeLeftParenthesisLocationCodesRightParenthesis,
56}
57
58impl Default for Label {
59    fn default() -> Label {
60        Self::IataLeftParenthesisAirportCodesRightParenthesis
61    }
62}