netbox-openapi 0.6.0

low level netbox bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * NetBox REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.6.2 (4.6)
 *
 * Generated by: https://openapi-generator.tech
 */

/// CustomFieldChoiceSetRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CustomFieldChoiceSetRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
    #[serde(rename = "base_choices", skip_serializing_if = "Option::is_none")]
    pub base_choices: Option<BaseChoices>,
    #[serde(rename = "extra_choices")]
    pub extra_choices: Vec<Vec<serde_json::Value>>,
    #[serde(rename = "choice_colors", skip_serializing_if = "Option::is_none")]
    pub choice_colors: Option<ChoiceColors>,
    /// Choices are automatically ordered alphabetically
    #[serde(
        rename = "order_alphabetically",
        skip_serializing_if = "Option::is_none"
    )]
    pub order_alphabetically: Option<bool>,
    #[serde(
        rename = "owner",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
}

impl CustomFieldChoiceSetRequest {
    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
    pub fn new(
        name: String,
        extra_choices: Vec<Vec<serde_json::Value>>,
    ) -> CustomFieldChoiceSetRequest {
        CustomFieldChoiceSetRequest {
            name,
            description: None,
            base_choices: None,
            extra_choices,
            choice_colors: None,
            order_alphabetically: None,
            owner: None,
        }
    }
}

/// * `IATA` - IATA (Airport codes) * `ISO_3166` - ISO 3166 (Country codes) * `UN_LOCODE` - UN/LOCODE (Location codes)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BaseChoices {
    #[serde(rename = "IATA")]
    Iata,
    #[serde(rename = "ISO_3166")]
    Iso3166,
    #[serde(rename = "UN_LOCODE")]
    UnLocode,
}

impl Default for BaseChoices {
    fn default() -> BaseChoices {
        Self::Iata
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ChoiceColors {
    #[serde(rename = "blue")]
    Blue,
    #[serde(rename = "indigo")]
    Indigo,
    #[serde(rename = "purple")]
    Purple,
    #[serde(rename = "pink")]
    Pink,
    #[serde(rename = "red")]
    Red,
    #[serde(rename = "orange")]
    Orange,
    #[serde(rename = "yellow")]
    Yellow,
    #[serde(rename = "green")]
    Green,
    #[serde(rename = "teal")]
    Teal,
    #[serde(rename = "cyan")]
    Cyan,
    #[serde(rename = "gray")]
    Gray,
    #[serde(rename = "black")]
    Black,
    #[serde(rename = "white")]
    White,
}

impl Default for ChoiceColors {
    fn default() -> ChoiceColors {
        Self::Blue
    }
}