Skip to main content

nautobot_openapi/models/
bulk_writable_rack_request.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/// BulkWritableRackRequest : 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 BulkWritableRackRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18    pub r#type: Option<crate::models::RackTypeChoices>,
19    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
20    pub width: Option<i32>,
21    #[serde(rename = "outer_unit", skip_serializing_if = "Option::is_none")]
22    pub outer_unit: Option<crate::models::OuterUnitEnum>,
23    #[serde(rename = "name")]
24    pub name: String,
25    /// Locally-assigned identifier
26    #[serde(
27        rename = "facility_id",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub facility_id: Option<Option<String>>,
33    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
34    pub serial: Option<String>,
35    /// A unique tag used to identify this rack
36    #[serde(
37        rename = "asset_tag",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub asset_tag: Option<Option<String>>,
43    /// Height in rack units
44    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
45    pub u_height: Option<i32>,
46    /// Units are numbered top-to-bottom
47    #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
48    pub desc_units: Option<bool>,
49    /// Outer dimension of rack (width)
50    #[serde(
51        rename = "outer_width",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub outer_width: Option<Option<i32>>,
57    /// Outer dimension of rack (depth)
58    #[serde(
59        rename = "outer_depth",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub outer_depth: Option<Option<i32>>,
65    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
66    pub comments: Option<String>,
67    #[serde(rename = "status")]
68    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
69    #[serde(
70        rename = "role",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
76    #[serde(rename = "location")]
77    pub location: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
78    #[serde(
79        rename = "rack_group",
80        default,
81        with = "::serde_with::rust::double_option",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub rack_group: Option<Option<Box<crate::models::BulkWritableRackRequestRackGroup>>>,
85    #[serde(
86        rename = "tenant",
87        default,
88        with = "::serde_with::rust::double_option",
89        skip_serializing_if = "Option::is_none"
90    )]
91    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
92    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
93    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
94    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
95    pub relationships: Option<
96        ::std::collections::HashMap<
97            String,
98            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
99        >,
100    >,
101    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
102    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
103}
104
105impl BulkWritableRackRequest {
106    /// 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.
107    pub fn new(
108        id: uuid::Uuid,
109        name: String,
110        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
111        location: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
112    ) -> BulkWritableRackRequest {
113        BulkWritableRackRequest {
114            id,
115            r#type: None,
116            width: None,
117            outer_unit: None,
118            name,
119            facility_id: None,
120            serial: None,
121            asset_tag: None,
122            u_height: None,
123            desc_units: None,
124            outer_width: None,
125            outer_depth: None,
126            comments: None,
127            status: Box::new(status),
128            role: None,
129            location: Box::new(location),
130            rack_group: None,
131            tenant: None,
132            custom_fields: None,
133            relationships: None,
134            tags: None,
135        }
136    }
137}