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

/// Rack : Base serializer class for models inheriting from PrimaryModel.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Rack {
    #[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 = "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::BriefSite>,
    #[serde(
        rename = "location",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub location: Option<Option<Box<crate::models::BriefLocation>>>,
    #[serde(
        rename = "group",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub group: Option<Option<Box<crate::models::BriefRackGroup>>>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<crate::models::RackStatus>>,
    #[serde(
        rename = "role",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub role: Option<Option<Box<crate::models::BriefRackRole>>>,
    #[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::BriefRackType>>>,
    #[serde(
        rename = "form_factor",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub form_factor: Option<Option<Box<crate::models::RackFormFactor>>>,
    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
    pub width: Option<Box<crate::models::RackWidth>>,
    /// 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>>,
    #[serde(
        rename = "weight_unit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub weight_unit: Option<Option<Box<crate::models::DeviceTypeWeightUnit>>>,
    /// 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>>,
    #[serde(
        rename = "outer_unit",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outer_unit: Option<Option<Box<crate::models::RackOuterUnit>>>,
    /// 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>>,
    #[serde(rename = "airflow", skip_serializing_if = "Option::is_none")]
    pub airflow: Option<Box<crate::models::RackAirflow>>,
    #[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::BriefOwner>>>,
    #[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::NestedTag>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[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>>,
    #[serde(rename = "device_count", skip_serializing_if = "Option::is_none")]
    pub device_count: Option<i64>,
    #[serde(rename = "powerfeed_count", skip_serializing_if = "Option::is_none")]
    pub powerfeed_count: Option<i64>,
}

impl Rack {
    /// Base serializer class for models inheriting from PrimaryModel.
    pub fn new(name: String, site: crate::models::BriefSite) -> Rack {
        Rack {
            id: None,
            url: None,
            display_url: None,
            display: None,
            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,
            created: None,
            last_updated: None,
            device_count: None,
            powerfeed_count: None,
        }
    }
}