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

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct DcimRacksCreateRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(
        rename = "facility_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub facility_id: Option<Option<String>>,
    #[serde(rename = "site")]
    pub site: Box<crate::models::DeviceWithConfigContextRequestSite>,
    #[serde(
        rename = "location",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub location: Option<Option<Box<crate::models::DeviceWithConfigContextRequestLocation>>>,
    #[serde(
        rename = "group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub group: Option<Option<Box<crate::models::PatchedWritableRackRequestGroup>>>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
    /// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(
        rename = "role",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub role: Option<Option<Box<crate::models::PatchedWritableRackRequestRole>>>,
    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
    pub serial: Option<String>,
    /// A unique tag used to identify this rack
    #[serde(
        rename = "asset_tag",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub asset_tag: Option<Option<String>>,
    #[serde(
        rename = "rack_type",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rack_type: Option<Option<Box<crate::models::PatchedWritableRackRequestRackType>>>,
    /// * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)
    #[serde(
        rename = "form_factor",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub form_factor: Option<Option<FormFactor>>,
    /// Rail-to-rail width  * `10` - 10 inches * `19` - 19 inches * `21` - 21 inches * `23` - 23 inches
    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
    pub width: Option<i32>,
    /// Height in rack units
    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
    pub u_height: Option<i32>,
    /// Starting unit for rack
    #[serde(rename = "starting_unit", skip_serializing_if = "Option::is_none")]
    pub starting_unit: Option<i32>,
    #[serde(
        rename = "weight",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub weight: Option<Option<f64>>,
    /// Maximum load capacity for the rack
    #[serde(
        rename = "max_weight",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_weight: Option<Option<i32>>,
    /// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
    #[serde(
        rename = "weight_unit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub weight_unit: Option<Option<WeightUnit>>,
    /// Units are numbered top-to-bottom
    #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
    pub desc_units: Option<bool>,
    /// Outer dimension of rack (width)
    #[serde(
        rename = "outer_width",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outer_width: Option<Option<i32>>,
    /// Outer dimension of rack (height)
    #[serde(
        rename = "outer_height",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outer_height: Option<Option<i32>>,
    /// Outer dimension of rack (depth)
    #[serde(
        rename = "outer_depth",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outer_depth: Option<Option<i32>>,
    /// * `mm` - Millimeters * `in` - Inches
    #[serde(
        rename = "outer_unit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outer_unit: Option<Option<OuterUnit>>,
    /// Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.
    #[serde(
        rename = "mounting_depth",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mounting_depth: Option<Option<i32>>,
    /// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
    #[serde(
        rename = "airflow",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub airflow: Option<Option<Airflow>>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(
        rename = "owner",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl DcimRacksCreateRequest {
    pub fn new(
        name: String,
        site: crate::models::DeviceWithConfigContextRequestSite,
    ) -> DcimRacksCreateRequest {
        DcimRacksCreateRequest {
            name,
            facility_id: None,
            site: Box::new(site),
            location: None,
            group: None,
            tenant: None,
            status: None,
            role: None,
            serial: None,
            asset_tag: None,
            rack_type: None,
            form_factor: None,
            width: None,
            u_height: None,
            starting_unit: None,
            weight: None,
            max_weight: None,
            weight_unit: None,
            desc_units: None,
            outer_width: None,
            outer_height: None,
            outer_depth: None,
            outer_unit: None,
            mounting_depth: None,
            airflow: None,
            description: None,
            owner: None,
            comments: None,
            tags: None,
            custom_fields: None,
        }
    }
}

/// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "reserved")]
    Reserved,
    #[serde(rename = "available")]
    Available,
    #[serde(rename = "planned")]
    Planned,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "deprecated")]
    Deprecated,
}

impl Default for Status {
    fn default() -> Status {
        Self::Reserved
    }
}
/// * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FormFactor {
    #[serde(rename = "2-post-frame")]
    Variant2PostFrame,
    #[serde(rename = "4-post-frame")]
    Variant4PostFrame,
    #[serde(rename = "4-post-cabinet")]
    Variant4PostCabinet,
    #[serde(rename = "wall-frame")]
    WallFrame,
    #[serde(rename = "wall-frame-vertical")]
    WallFrameVertical,
    #[serde(rename = "wall-cabinet")]
    WallCabinet,
    #[serde(rename = "wall-cabinet-vertical")]
    WallCabinetVertical,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

impl Default for FormFactor {
    fn default() -> FormFactor {
        Self::Variant2PostFrame
    }
}
/// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WeightUnit {
    #[serde(rename = "kg")]
    Kg,
    #[serde(rename = "g")]
    G,
    #[serde(rename = "lb")]
    Lb,
    #[serde(rename = "oz")]
    Oz,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

impl Default for WeightUnit {
    fn default() -> WeightUnit {
        Self::Kg
    }
}
/// * `mm` - Millimeters * `in` - Inches
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OuterUnit {
    #[serde(rename = "mm")]
    Mm,
    #[serde(rename = "in")]
    In,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

impl Default for OuterUnit {
    fn default() -> OuterUnit {
        Self::Mm
    }
}
/// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Airflow {
    #[serde(rename = "front-to-rear")]
    FrontToRear,
    #[serde(rename = "rear-to-front")]
    RearToFront,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

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