netbox_openapi/models/
virtual_machine_with_config_context.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/// VirtualMachineWithConfigContext : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct VirtualMachineWithConfigContext {
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(rename = "name")]
24    pub name: String,
25    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
26    pub status: Option<Box<crate::models::VirtualMachineWithConfigContextStatus>>,
27    #[serde(
28        rename = "site",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub site: Option<Option<Box<crate::models::BriefSite>>>,
34    #[serde(
35        rename = "cluster",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub cluster: Option<Option<Box<crate::models::BriefCluster>>>,
41    #[serde(
42        rename = "device",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub device: Option<Option<Box<crate::models::BriefDevice>>>,
48    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
49    pub serial: Option<String>,
50    #[serde(
51        rename = "role",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub role: Option<Option<Box<crate::models::BriefDeviceRole>>>,
57    #[serde(
58        rename = "tenant",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
64    #[serde(
65        rename = "platform",
66        default,
67        with = "::serde_with::rust::double_option",
68        skip_serializing_if = "Option::is_none"
69    )]
70    pub platform: Option<Option<Box<crate::models::BriefPlatform>>>,
71    #[serde(
72        rename = "primary_ip",
73        default,
74        with = "::serde_with::rust::double_option",
75        skip_serializing_if = "Option::is_none"
76    )]
77    pub primary_ip: Option<Option<Box<crate::models::BriefIpAddress>>>,
78    #[serde(
79        rename = "primary_ip4",
80        default,
81        with = "::serde_with::rust::double_option",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub primary_ip4: Option<Option<Box<crate::models::BriefIpAddress>>>,
85    #[serde(
86        rename = "primary_ip6",
87        default,
88        with = "::serde_with::rust::double_option",
89        skip_serializing_if = "Option::is_none"
90    )]
91    pub primary_ip6: Option<Option<Box<crate::models::BriefIpAddress>>>,
92    #[serde(
93        rename = "vcpus",
94        default,
95        with = "::serde_with::rust::double_option",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub vcpus: Option<Option<f64>>,
99    #[serde(
100        rename = "memory",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub memory: Option<Option<i32>>,
106    #[serde(
107        rename = "disk",
108        default,
109        with = "::serde_with::rust::double_option",
110        skip_serializing_if = "Option::is_none"
111    )]
112    pub disk: Option<Option<i32>>,
113    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
114    pub description: Option<String>,
115    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
116    pub comments: Option<String>,
117    #[serde(
118        rename = "config_template",
119        default,
120        with = "::serde_with::rust::double_option",
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub config_template: Option<Option<Box<crate::models::BriefConfigTemplate>>>,
124    /// Local config context data takes precedence over source contexts in the final rendered config context
125    #[serde(
126        rename = "local_context_data",
127        default,
128        with = "::serde_with::rust::double_option",
129        skip_serializing_if = "Option::is_none"
130    )]
131    pub local_context_data: Option<Option<serde_json::Value>>,
132    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
133    pub tags: Option<Vec<crate::models::NestedTag>>,
134    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
135    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
136    #[serde(
137        rename = "config_context",
138        default,
139        with = "::serde_with::rust::double_option",
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub config_context: Option<Option<serde_json::Value>>,
143    #[serde(
144        rename = "created",
145        default,
146        with = "::serde_with::rust::double_option",
147        skip_serializing_if = "Option::is_none"
148    )]
149    pub created: Option<Option<String>>,
150    #[serde(
151        rename = "last_updated",
152        default,
153        with = "::serde_with::rust::double_option",
154        skip_serializing_if = "Option::is_none"
155    )]
156    pub last_updated: Option<Option<String>>,
157    #[serde(rename = "interface_count", skip_serializing_if = "Option::is_none")]
158    pub interface_count: Option<i32>,
159    #[serde(rename = "virtual_disk_count", skip_serializing_if = "Option::is_none")]
160    pub virtual_disk_count: Option<i32>,
161}
162
163impl VirtualMachineWithConfigContext {
164    /// Adds support for custom fields and tags.
165    pub fn new(name: String) -> VirtualMachineWithConfigContext {
166        VirtualMachineWithConfigContext {
167            id: None,
168            url: None,
169            display_url: None,
170            display: None,
171            name,
172            status: None,
173            site: None,
174            cluster: None,
175            device: None,
176            serial: None,
177            role: None,
178            tenant: None,
179            platform: None,
180            primary_ip: None,
181            primary_ip4: None,
182            primary_ip6: None,
183            vcpus: None,
184            memory: None,
185            disk: None,
186            description: None,
187            comments: None,
188            config_template: None,
189            local_context_data: None,
190            tags: None,
191            custom_fields: None,
192            config_context: None,
193            created: None,
194            last_updated: None,
195            interface_count: None,
196            virtual_disk_count: None,
197        }
198    }
199}