Skip to main content

nautobot_openapi/models/
device.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/// Device : 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 Device {
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 = "face", skip_serializing_if = "Option::is_none")]
27    pub face: Option<Box<crate::models::DeviceFace>>,
28    #[serde(
29        rename = "local_config_context_data",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub local_config_context_data: Option<Option<serde_json::Value>>,
35    #[serde(
36        rename = "local_config_context_data_owner_object_id",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub local_config_context_data_owner_object_id: Option<Option<uuid::Uuid>>,
42    #[serde(
43        rename = "name",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub name: Option<Option<String>>,
49    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
50    pub serial: Option<String>,
51    /// A unique tag used to identify this device
52    #[serde(
53        rename = "asset_tag",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub asset_tag: Option<Option<String>>,
59    /// The lowest-numbered unit occupied by the device
60    #[serde(
61        rename = "position",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub position: Option<Option<i32>>,
67    /// The priority the device has in the device redundancy group.
68    #[serde(
69        rename = "device_redundancy_group_priority",
70        default,
71        with = "::serde_with::rust::double_option",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub device_redundancy_group_priority: Option<Option<i32>>,
75    #[serde(
76        rename = "vc_position",
77        default,
78        with = "::serde_with::rust::double_option",
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub vc_position: Option<Option<i32>>,
82    #[serde(
83        rename = "vc_priority",
84        default,
85        with = "::serde_with::rust::double_option",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub vc_priority: Option<Option<i32>>,
89    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
90    pub comments: Option<String>,
91    #[serde(
92        rename = "local_config_context_schema",
93        default,
94        with = "::serde_with::rust::double_option",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub local_config_context_schema:
98        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
99    #[serde(
100        rename = "local_config_context_data_owner_content_type",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub local_config_context_data_owner_content_type:
106        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
107    #[serde(rename = "device_type")]
108    pub device_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
109    #[serde(rename = "status")]
110    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
111    #[serde(rename = "role")]
112    pub role: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
113    #[serde(
114        rename = "tenant",
115        default,
116        with = "::serde_with::rust::double_option",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
120    #[serde(
121        rename = "platform",
122        default,
123        with = "::serde_with::rust::double_option",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
127    #[serde(rename = "location")]
128    pub location: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
129    #[serde(
130        rename = "rack",
131        default,
132        with = "::serde_with::rust::double_option",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub rack: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
136    #[serde(
137        rename = "primary_ip4",
138        default,
139        with = "::serde_with::rust::double_option",
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub primary_ip4: Option<Option<Box<crate::models::PrimaryIpv4>>>,
143    #[serde(
144        rename = "primary_ip6",
145        default,
146        with = "::serde_with::rust::double_option",
147        skip_serializing_if = "Option::is_none"
148    )]
149    pub primary_ip6: Option<Option<Box<crate::models::PrimaryIpv6>>>,
150    #[serde(
151        rename = "virtual_chassis",
152        default,
153        with = "::serde_with::rust::double_option",
154        skip_serializing_if = "Option::is_none"
155    )]
156    pub virtual_chassis: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
157    #[serde(
158        rename = "device_redundancy_group",
159        default,
160        with = "::serde_with::rust::double_option",
161        skip_serializing_if = "Option::is_none"
162    )]
163    pub device_redundancy_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
164    #[serde(
165        rename = "software_version",
166        default,
167        with = "::serde_with::rust::double_option",
168        skip_serializing_if = "Option::is_none"
169    )]
170    pub software_version:
171        Option<Option<Box<crate::models::BulkWritableDeviceRequestSoftwareVersion>>>,
172    #[serde(
173        rename = "secrets_group",
174        default,
175        with = "::serde_with::rust::double_option",
176        skip_serializing_if = "Option::is_none"
177    )]
178    pub secrets_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
179    #[serde(
180        rename = "controller_managed_device_group",
181        default,
182        with = "::serde_with::rust::double_option",
183        skip_serializing_if = "Option::is_none"
184    )]
185    pub controller_managed_device_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
186    #[serde(
187        rename = "created",
188        default,
189        with = "::serde_with::rust::double_option",
190        skip_serializing_if = "Option::is_none"
191    )]
192    pub created: Option<Option<String>>,
193    #[serde(
194        rename = "last_updated",
195        default,
196        with = "::serde_with::rust::double_option",
197        skip_serializing_if = "Option::is_none"
198    )]
199    pub last_updated: Option<Option<String>>,
200    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
201    pub notes_url: Option<String>,
202    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
203    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
204    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
205    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
206    #[serde(
207        rename = "parent_bay",
208        default,
209        with = "::serde_with::rust::double_option",
210        skip_serializing_if = "Option::is_none"
211    )]
212    pub parent_bay: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
213}
214
215impl Device {
216    /// 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.
217    pub fn new(
218        device_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
219        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
220        role: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
221        location: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
222    ) -> Device {
223        Device {
224            id: None,
225            object_type: None,
226            display: None,
227            url: None,
228            natural_slug: None,
229            face: None,
230            local_config_context_data: None,
231            local_config_context_data_owner_object_id: None,
232            name: None,
233            serial: None,
234            asset_tag: None,
235            position: None,
236            device_redundancy_group_priority: None,
237            vc_position: None,
238            vc_priority: None,
239            comments: None,
240            local_config_context_schema: None,
241            local_config_context_data_owner_content_type: None,
242            device_type: Box::new(device_type),
243            status: Box::new(status),
244            role: Box::new(role),
245            tenant: None,
246            platform: None,
247            location: Box::new(location),
248            rack: None,
249            primary_ip4: None,
250            primary_ip6: None,
251            virtual_chassis: None,
252            device_redundancy_group: None,
253            software_version: None,
254            secrets_group: None,
255            controller_managed_device_group: None,
256            created: None,
257            last_updated: None,
258            notes_url: None,
259            custom_fields: None,
260            tags: None,
261            parent_bay: None,
262        }
263    }
264}