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
 */

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

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CustomLink {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
    pub display_url: Option<String>,
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "object_types")]
    pub object_types: Vec<String>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Jinja2 template code for link text
    #[serde(rename = "link_text")]
    pub link_text: String,
    /// Jinja2 template code for link URL
    #[serde(rename = "link_url")]
    pub link_url: String,
    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<i32>,
    /// Links with the same group will appear as a dropdown menu
    #[serde(rename = "group_name", skip_serializing_if = "Option::is_none")]
    pub group_name: Option<String>,
    /// The class of the first link in a group will be used for the dropdown button  * `default` - Default * `blue` - Blue * `indigo` - Indigo * `purple` - Purple * `pink` - Pink * `red` - Red * `orange` - Orange * `yellow` - Yellow * `green` - Green * `teal` - Teal * `cyan` - Cyan * `gray` - Gray * `black` - Black * `white` - White * `ghost-dark` - Link
    #[serde(rename = "button_class", skip_serializing_if = "Option::is_none")]
    pub button_class: Option<ButtonClass>,
    /// Force link to open in a new window
    #[serde(rename = "new_window", skip_serializing_if = "Option::is_none")]
    pub new_window: 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::BriefOwner>>>,
    #[serde(
        rename = "created",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub created: Option<Option<String>>,
    #[serde(
        rename = "last_updated",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_updated: Option<Option<String>>,
}

impl CustomLink {
    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
    pub fn new(
        object_types: Vec<String>,
        name: String,
        link_text: String,
        link_url: String,
    ) -> CustomLink {
        CustomLink {
            id: None,
            url: None,
            display_url: None,
            display: None,
            object_types,
            name,
            enabled: None,
            link_text,
            link_url,
            weight: None,
            group_name: None,
            button_class: None,
            new_window: None,
            owner: None,
            created: None,
            last_updated: None,
        }
    }
}

/// The class of the first link in a group will be used for the dropdown button  * `default` - Default * `blue` - Blue * `indigo` - Indigo * `purple` - Purple * `pink` - Pink * `red` - Red * `orange` - Orange * `yellow` - Yellow * `green` - Green * `teal` - Teal * `cyan` - Cyan * `gray` - Gray * `black` - Black * `white` - White * `ghost-dark` - Link
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ButtonClass {
    #[serde(rename = "default")]
    Default,
    #[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,
    #[serde(rename = "ghost-dark")]
    GhostDark,
}

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