1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableVirtualMachineWithConfigContextRequest {
15 #[serde(rename = "name")]
16 pub name: String,
17 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
19 pub status: Option<Status>,
20 #[serde(rename = "start_on_boot", skip_serializing_if = "Option::is_none")]
22 pub start_on_boot: Option<StartOnBoot>,
23 #[serde(
24 rename = "site",
25 default,
26 with = "::serde_with::rust::double_option",
27 skip_serializing_if = "Option::is_none"
28 )]
29 pub site: Option<Option<Box<crate::models::CreateAvailableVlanRequestSite>>>,
30 #[serde(
31 rename = "cluster",
32 default,
33 with = "::serde_with::rust::double_option",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub cluster: Option<Option<Box<crate::models::DeviceWithConfigContextRequestCluster>>>,
37 #[serde(
38 rename = "device",
39 default,
40 with = "::serde_with::rust::double_option",
41 skip_serializing_if = "Option::is_none"
42 )]
43 pub device: Option<Option<Box<crate::models::DeviceBayRequestInstalledDevice>>>,
44 #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
45 pub serial: Option<String>,
46 #[serde(
47 rename = "role",
48 default,
49 with = "::serde_with::rust::double_option",
50 skip_serializing_if = "Option::is_none"
51 )]
52 pub role: Option<
53 Option<Box<crate::models::PatchedWritableVirtualMachineWithConfigContextRequestRole>>,
54 >,
55 #[serde(
56 rename = "tenant",
57 default,
58 with = "::serde_with::rust::double_option",
59 skip_serializing_if = "Option::is_none"
60 )]
61 pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
62 #[serde(
63 rename = "platform",
64 default,
65 with = "::serde_with::rust::double_option",
66 skip_serializing_if = "Option::is_none"
67 )]
68 pub platform: Option<Option<Box<crate::models::DeviceTypeRequestDefaultPlatform>>>,
69 #[serde(
70 rename = "primary_ip4",
71 default,
72 with = "::serde_with::rust::double_option",
73 skip_serializing_if = "Option::is_none"
74 )]
75 pub primary_ip4: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
76 #[serde(
77 rename = "primary_ip6",
78 default,
79 with = "::serde_with::rust::double_option",
80 skip_serializing_if = "Option::is_none"
81 )]
82 pub primary_ip6: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
83 #[serde(
84 rename = "vcpus",
85 default,
86 with = "::serde_with::rust::double_option",
87 skip_serializing_if = "Option::is_none"
88 )]
89 pub vcpus: Option<Option<f64>>,
90 #[serde(
91 rename = "memory",
92 default,
93 with = "::serde_with::rust::double_option",
94 skip_serializing_if = "Option::is_none"
95 )]
96 pub memory: Option<Option<i32>>,
97 #[serde(
98 rename = "disk",
99 default,
100 with = "::serde_with::rust::double_option",
101 skip_serializing_if = "Option::is_none"
102 )]
103 pub disk: Option<Option<i32>>,
104 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
105 pub description: Option<String>,
106 #[serde(
107 rename = "owner",
108 default,
109 with = "::serde_with::rust::double_option",
110 skip_serializing_if = "Option::is_none"
111 )]
112 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
113 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
114 pub comments: Option<String>,
115 #[serde(
116 rename = "config_template",
117 default,
118 with = "::serde_with::rust::double_option",
119 skip_serializing_if = "Option::is_none"
120 )]
121 pub config_template: Option<Option<Box<crate::models::DeviceRoleRequestConfigTemplate>>>,
122 #[serde(
124 rename = "local_context_data",
125 default,
126 with = "::serde_with::rust::double_option",
127 skip_serializing_if = "Option::is_none"
128 )]
129 pub local_context_data: Option<Option<serde_json::Value>>,
130 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
131 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
132 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
133 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
134}
135
136impl WritableVirtualMachineWithConfigContextRequest {
137 pub fn new(name: String) -> WritableVirtualMachineWithConfigContextRequest {
139 WritableVirtualMachineWithConfigContextRequest {
140 name,
141 status: None,
142 start_on_boot: None,
143 site: None,
144 cluster: None,
145 device: None,
146 serial: None,
147 role: None,
148 tenant: None,
149 platform: None,
150 primary_ip4: None,
151 primary_ip6: None,
152 vcpus: None,
153 memory: None,
154 disk: None,
155 description: None,
156 owner: None,
157 comments: None,
158 config_template: None,
159 local_context_data: None,
160 tags: None,
161 custom_fields: None,
162 }
163 }
164}
165
166#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
168pub enum Status {
169 #[serde(rename = "offline")]
170 Offline,
171 #[serde(rename = "active")]
172 Active,
173 #[serde(rename = "planned")]
174 Planned,
175 #[serde(rename = "staged")]
176 Staged,
177 #[serde(rename = "failed")]
178 Failed,
179 #[serde(rename = "decommissioning")]
180 Decommissioning,
181 #[serde(rename = "paused")]
182 Paused,
183}
184
185impl Default for Status {
186 fn default() -> Status {
187 Self::Offline
188 }
189}
190#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
192pub enum StartOnBoot {
193 #[serde(rename = "on")]
194 On,
195 #[serde(rename = "off")]
196 Off,
197 #[serde(rename = "laststate")]
198 Laststate,
199}
200
201impl Default for StartOnBoot {
202 fn default() -> StartOnBoot {
203 Self::On
204 }
205}