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

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

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct RackType {
    #[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 = "manufacturer")]
    pub manufacturer: Box<crate::models::BriefManufacturer>,
    #[serde(rename = "model")]
    pub model: String,
    #[serde(rename = "slug")]
    pub slug: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[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>,
    /// 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>>>,
    #[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>>>,
    /// 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 = "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 = "rack_count", skip_serializing_if = "Option::is_none")]
    pub rack_count: Option<i32>,
}

impl RackType {
    /// Base serializer class for models inheriting from PrimaryModel.
    pub fn new(
        manufacturer: crate::models::BriefManufacturer,
        model: String,
        slug: String,
    ) -> RackType {
        RackType {
            id: None,
            url: None,
            display_url: None,
            display: None,
            manufacturer: Box::new(manufacturer),
            model,
            slug,
            description: None,
            form_factor: None,
            width: None,
            u_height: None,
            starting_unit: None,
            desc_units: None,
            outer_width: None,
            outer_height: None,
            outer_depth: None,
            outer_unit: None,
            weight: None,
            max_weight: None,
            weight_unit: None,
            mounting_depth: None,
            owner: None,
            comments: None,
            tags: None,
            custom_fields: None,
            created: None,
            last_updated: None,
            rack_count: None,
        }
    }
}