Skip to main content

nautobot_openapi/models/
device_type.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/// DeviceType : 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 DeviceType {
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 = "subdevice_role", skip_serializing_if = "Option::is_none")]
27    pub subdevice_role: Option<Box<crate::models::DeviceTypeSubdeviceRole>>,
28    #[serde(
29        rename = "front_image",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub front_image: Option<Option<String>>,
35    #[serde(
36        rename = "rear_image",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub rear_image: Option<Option<String>>,
42    #[serde(rename = "device_count", skip_serializing_if = "Option::is_none")]
43    pub device_count: Option<i32>,
44    #[serde(rename = "model")]
45    pub model: String,
46    /// Discrete part number (optional)
47    #[serde(rename = "part_number", skip_serializing_if = "Option::is_none")]
48    pub part_number: Option<String>,
49    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
50    pub u_height: Option<i32>,
51    /// Device consumes both front and rear rack faces
52    #[serde(rename = "is_full_depth", skip_serializing_if = "Option::is_none")]
53    pub is_full_depth: Option<bool>,
54    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
55    pub comments: Option<String>,
56    #[serde(rename = "manufacturer")]
57    pub manufacturer: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
58    #[serde(
59        rename = "device_family",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub device_family: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
65    #[serde(
66        rename = "created",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub created: Option<Option<String>>,
72    #[serde(
73        rename = "last_updated",
74        default,
75        with = "::serde_with::rust::double_option",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub last_updated: Option<Option<String>>,
79    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
80    pub notes_url: Option<String>,
81    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
82    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
83    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
84    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
85}
86
87impl DeviceType {
88    /// 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.
89    pub fn new(
90        model: String,
91        manufacturer: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
92    ) -> DeviceType {
93        DeviceType {
94            id: None,
95            object_type: None,
96            display: None,
97            url: None,
98            natural_slug: None,
99            subdevice_role: None,
100            front_image: None,
101            rear_image: None,
102            device_count: None,
103            model,
104            part_number: None,
105            u_height: None,
106            is_full_depth: None,
107            comments: None,
108            manufacturer: Box::new(manufacturer),
109            device_family: None,
110            created: None,
111            last_updated: None,
112            notes_url: None,
113            custom_fields: None,
114            tags: None,
115        }
116    }
117}