netbox_openapi/models/
module_type.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// ModuleType : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ModuleType {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
20    pub display_url: Option<String>,
21    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
22    pub display: Option<String>,
23    #[serde(
24        rename = "profile",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub profile: Option<Option<Box<crate::models::BriefModuleTypeProfile>>>,
30    #[serde(rename = "manufacturer")]
31    pub manufacturer: Box<crate::models::BriefManufacturer>,
32    #[serde(rename = "model")]
33    pub model: String,
34    /// Discrete part number (optional)
35    #[serde(rename = "part_number", skip_serializing_if = "Option::is_none")]
36    pub part_number: Option<String>,
37    #[serde(
38        rename = "airflow",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub airflow: Option<Option<Box<crate::models::ModuleTypeAirflow>>>,
44    #[serde(
45        rename = "weight",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub weight: Option<Option<f64>>,
51    #[serde(
52        rename = "weight_unit",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub weight_unit: Option<Option<Box<crate::models::DeviceTypeWeightUnit>>>,
58    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
59    pub description: Option<String>,
60    #[serde(
61        rename = "attributes",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub attributes: Option<Option<serde_json::Value>>,
67    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
68    pub comments: Option<String>,
69    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
70    pub tags: Option<Vec<crate::models::NestedTag>>,
71    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
72    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
73    #[serde(
74        rename = "created",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub created: Option<Option<String>>,
80    #[serde(
81        rename = "last_updated",
82        default,
83        with = "::serde_with::rust::double_option",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub last_updated: Option<Option<String>>,
87}
88
89impl ModuleType {
90    /// Adds support for custom fields and tags.
91    pub fn new(manufacturer: crate::models::BriefManufacturer, model: String) -> ModuleType {
92        ModuleType {
93            id: None,
94            url: None,
95            display_url: None,
96            display: None,
97            profile: None,
98            manufacturer: Box::new(manufacturer),
99            model,
100            part_number: None,
101            airflow: None,
102            weight: None,
103            weight_unit: None,
104            description: None,
105            attributes: None,
106            comments: None,
107            tags: None,
108            custom_fields: None,
109            created: None,
110            last_updated: None,
111        }
112    }
113}