Skip to main content

nautobot_openapi/models/
rack.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Rack : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Rack {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
27    pub r#type: Option<Box<crate::models::RackType>>,
28    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
29    pub width: Option<Box<crate::models::RackWidth>>,
30    #[serde(rename = "outer_unit", skip_serializing_if = "Option::is_none")]
31    pub outer_unit: Option<Box<crate::models::RackOuterUnit>>,
32    #[serde(rename = "device_count", skip_serializing_if = "Option::is_none")]
33    pub device_count: Option<i32>,
34    #[serde(rename = "power_feed_count", skip_serializing_if = "Option::is_none")]
35    pub power_feed_count: Option<i32>,
36    #[serde(rename = "name")]
37    pub name: String,
38    /// Locally-assigned identifier
39    #[serde(
40        rename = "facility_id",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub facility_id: Option<Option<String>>,
46    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
47    pub serial: Option<String>,
48    /// A unique tag used to identify this rack
49    #[serde(
50        rename = "asset_tag",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub asset_tag: Option<Option<String>>,
56    /// Height in rack units
57    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
58    pub u_height: Option<i32>,
59    /// Units are numbered top-to-bottom
60    #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
61    pub desc_units: Option<bool>,
62    /// Outer dimension of rack (width)
63    #[serde(
64        rename = "outer_width",
65        default,
66        with = "::serde_with::rust::double_option",
67        skip_serializing_if = "Option::is_none"
68    )]
69    pub outer_width: Option<Option<i32>>,
70    /// Outer dimension of rack (depth)
71    #[serde(
72        rename = "outer_depth",
73        default,
74        with = "::serde_with::rust::double_option",
75        skip_serializing_if = "Option::is_none"
76    )]
77    pub outer_depth: Option<Option<i32>>,
78    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
79    pub comments: Option<String>,
80    #[serde(rename = "status")]
81    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
82    #[serde(
83        rename = "role",
84        default,
85        with = "::serde_with::rust::double_option",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
89    #[serde(rename = "location")]
90    pub location: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
91    #[serde(
92        rename = "rack_group",
93        default,
94        with = "::serde_with::rust::double_option",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub rack_group: Option<Option<Box<crate::models::BulkWritableRackRequestRackGroup>>>,
98    #[serde(
99        rename = "tenant",
100        default,
101        with = "::serde_with::rust::double_option",
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
105    #[serde(
106        rename = "created",
107        default,
108        with = "::serde_with::rust::double_option",
109        skip_serializing_if = "Option::is_none"
110    )]
111    pub created: Option<Option<String>>,
112    #[serde(
113        rename = "last_updated",
114        default,
115        with = "::serde_with::rust::double_option",
116        skip_serializing_if = "Option::is_none"
117    )]
118    pub last_updated: Option<Option<String>>,
119    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
120    pub notes_url: Option<String>,
121    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
122    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
123    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
124    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
125}
126
127impl Rack {
128    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
129    pub fn new(
130        name: String,
131        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
132        location: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
133    ) -> Rack {
134        Rack {
135            id: None,
136            object_type: None,
137            display: None,
138            url: None,
139            natural_slug: None,
140            r#type: None,
141            width: None,
142            outer_unit: None,
143            device_count: None,
144            power_feed_count: None,
145            name,
146            facility_id: None,
147            serial: None,
148            asset_tag: None,
149            u_height: None,
150            desc_units: None,
151            outer_width: None,
152            outer_depth: None,
153            comments: None,
154            status: Box::new(status),
155            role: None,
156            location: Box::new(location),
157            rack_group: None,
158            tenant: None,
159            created: None,
160            last_updated: None,
161            notes_url: None,
162            custom_fields: None,
163            tags: None,
164        }
165    }
166}