oci_rust_sdk/core/models/
boot_volume.rs1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[allow(unused_imports)]
6use super::*;
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct BootVolume {
11 pub availability_domain: String,
13
14 pub compartment_id: String,
16
17 pub id: String,
19
20 pub lifecycle_state: BootVolumeLifecycleState,
22
23 pub size_in_mbs: i64,
25
26 pub time_created: DateTime<Utc>,
28
29 #[serde(skip_serializing_if = "Option::is_none")]
31 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
32
33 #[serde(skip_serializing_if = "Option::is_none")]
35 pub system_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
36
37 #[serde(skip_serializing_if = "Option::is_none")]
39 pub display_name: Option<String>,
40
41 #[serde(skip_serializing_if = "Option::is_none")]
43 pub freeform_tags: Option<HashMap<String, String>>,
44
45 #[serde(skip_serializing_if = "Option::is_none")]
47 pub image_id: Option<String>,
48
49 #[serde(skip_serializing_if = "Option::is_none")]
51 pub is_hydrated: Option<bool>,
52
53 #[serde(skip_serializing_if = "Option::is_none")]
55 pub cluster_placement_group_id: Option<String>,
56
57 #[serde(skip_serializing_if = "Option::is_none")]
59 pub vpus_per_gb: Option<i64>,
60
61 #[serde(skip_serializing_if = "Option::is_none")]
63 pub size_in_gbs: Option<i64>,
64
65 #[serde(skip_serializing_if = "Option::is_none")]
66 pub source_details: Option<BootVolumeSourceFromBootVolumeBackupDetails>,
67
68 #[serde(skip_serializing_if = "Option::is_none")]
70 pub volume_group_id: Option<String>,
71
72 #[serde(skip_serializing_if = "Option::is_none")]
74 pub kms_key_id: Option<String>,
75
76 #[serde(skip_serializing_if = "Option::is_none")]
78 pub is_auto_tune_enabled: Option<bool>,
79
80 #[serde(skip_serializing_if = "Option::is_none")]
82 pub auto_tuned_vpus_per_gb: Option<i64>,
83
84 #[serde(skip_serializing_if = "Option::is_none")]
86 pub boot_volume_replicas: Option<Vec<BootVolumeReplicaInfo>>,
87
88 #[serde(skip_serializing_if = "Option::is_none")]
90 pub autotune_policies: Option<Vec<AutotunePolicy>>,
91}
92
93pub struct BootVolumeRequired {
95 pub availability_domain: String,
97
98 pub compartment_id: String,
100
101 pub id: String,
103
104 pub lifecycle_state: BootVolumeLifecycleState,
106
107 pub size_in_mbs: i64,
109
110 pub time_created: DateTime<Utc>,
112}
113
114impl BootVolume {
115 pub fn new(required: BootVolumeRequired) -> Self {
117 Self {
118 availability_domain: required.availability_domain,
119
120 compartment_id: required.compartment_id,
121
122 id: required.id,
123
124 lifecycle_state: required.lifecycle_state,
125
126 size_in_mbs: required.size_in_mbs,
127
128 time_created: required.time_created,
129
130 defined_tags: None,
131
132 system_tags: None,
133
134 display_name: None,
135
136 freeform_tags: None,
137
138 image_id: None,
139
140 is_hydrated: None,
141
142 cluster_placement_group_id: None,
143
144 vpus_per_gb: None,
145
146 size_in_gbs: None,
147
148 source_details: None,
149
150 volume_group_id: None,
151
152 kms_key_id: None,
153
154 is_auto_tune_enabled: None,
155
156 auto_tuned_vpus_per_gb: None,
157
158 boot_volume_replicas: None,
159
160 autotune_policies: None,
161 }
162 }
163
164 pub fn set_availability_domain(mut self, value: String) -> Self {
166 self.availability_domain = value;
167 self
168 }
169
170 pub fn set_compartment_id(mut self, value: String) -> Self {
172 self.compartment_id = value;
173 self
174 }
175
176 pub fn set_defined_tags(
178 mut self,
179 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
180 ) -> Self {
181 self.defined_tags = value;
182 self
183 }
184
185 pub fn set_system_tags(
187 mut self,
188 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
189 ) -> Self {
190 self.system_tags = value;
191 self
192 }
193
194 pub fn set_display_name(mut self, value: Option<String>) -> Self {
196 self.display_name = value;
197 self
198 }
199
200 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
202 self.freeform_tags = value;
203 self
204 }
205
206 pub fn set_id(mut self, value: String) -> Self {
208 self.id = value;
209 self
210 }
211
212 pub fn set_image_id(mut self, value: Option<String>) -> Self {
214 self.image_id = value;
215 self
216 }
217
218 pub fn set_is_hydrated(mut self, value: Option<bool>) -> Self {
220 self.is_hydrated = value;
221 self
222 }
223
224 pub fn set_cluster_placement_group_id(mut self, value: Option<String>) -> Self {
226 self.cluster_placement_group_id = value;
227 self
228 }
229
230 pub fn set_vpus_per_gb(mut self, value: Option<i64>) -> Self {
232 self.vpus_per_gb = value;
233 self
234 }
235
236 pub fn set_lifecycle_state(mut self, value: BootVolumeLifecycleState) -> Self {
238 self.lifecycle_state = value;
239 self
240 }
241
242 pub fn set_size_in_gbs(mut self, value: Option<i64>) -> Self {
244 self.size_in_gbs = value;
245 self
246 }
247
248 pub fn set_size_in_mbs(mut self, value: i64) -> Self {
250 self.size_in_mbs = value;
251 self
252 }
253
254 pub fn set_source_details(
256 mut self,
257 value: Option<BootVolumeSourceFromBootVolumeBackupDetails>,
258 ) -> Self {
259 self.source_details = value;
260 self
261 }
262
263 pub fn set_time_created(mut self, value: DateTime<Utc>) -> Self {
265 self.time_created = value;
266 self
267 }
268
269 pub fn set_volume_group_id(mut self, value: Option<String>) -> Self {
271 self.volume_group_id = value;
272 self
273 }
274
275 pub fn set_kms_key_id(mut self, value: Option<String>) -> Self {
277 self.kms_key_id = value;
278 self
279 }
280
281 pub fn set_is_auto_tune_enabled(mut self, value: Option<bool>) -> Self {
283 self.is_auto_tune_enabled = value;
284 self
285 }
286
287 pub fn set_auto_tuned_vpus_per_gb(mut self, value: Option<i64>) -> Self {
289 self.auto_tuned_vpus_per_gb = value;
290 self
291 }
292
293 pub fn set_boot_volume_replicas(mut self, value: Option<Vec<BootVolumeReplicaInfo>>) -> Self {
295 self.boot_volume_replicas = value;
296 self
297 }
298
299 pub fn set_autotune_policies(mut self, value: Option<Vec<AutotunePolicy>>) -> Self {
301 self.autotune_policies = value;
302 self
303 }
304
305 pub fn with_defined_tags(
307 mut self,
308 value: HashMap<String, HashMap<String, serde_json::Value>>,
309 ) -> Self {
310 self.defined_tags = Some(value);
311 self
312 }
313
314 pub fn with_system_tags(
316 mut self,
317 value: HashMap<String, HashMap<String, serde_json::Value>>,
318 ) -> Self {
319 self.system_tags = Some(value);
320 self
321 }
322
323 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
325 self.display_name = Some(value.into());
326 self
327 }
328
329 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
331 self.freeform_tags = Some(value);
332 self
333 }
334
335 pub fn with_image_id(mut self, value: impl Into<String>) -> Self {
337 self.image_id = Some(value.into());
338 self
339 }
340
341 pub fn with_is_hydrated(mut self, value: bool) -> Self {
343 self.is_hydrated = Some(value);
344 self
345 }
346
347 pub fn with_cluster_placement_group_id(mut self, value: impl Into<String>) -> Self {
349 self.cluster_placement_group_id = Some(value.into());
350 self
351 }
352
353 pub fn with_vpus_per_gb(mut self, value: i64) -> Self {
355 self.vpus_per_gb = Some(value);
356 self
357 }
358
359 pub fn with_size_in_gbs(mut self, value: i64) -> Self {
361 self.size_in_gbs = Some(value);
362 self
363 }
364
365 pub fn with_source_details(
367 mut self,
368 value: BootVolumeSourceFromBootVolumeBackupDetails,
369 ) -> Self {
370 self.source_details = Some(value);
371 self
372 }
373
374 pub fn with_volume_group_id(mut self, value: impl Into<String>) -> Self {
376 self.volume_group_id = Some(value.into());
377 self
378 }
379
380 pub fn with_kms_key_id(mut self, value: impl Into<String>) -> Self {
382 self.kms_key_id = Some(value.into());
383 self
384 }
385
386 pub fn with_is_auto_tune_enabled(mut self, value: bool) -> Self {
388 self.is_auto_tune_enabled = Some(value);
389 self
390 }
391
392 pub fn with_auto_tuned_vpus_per_gb(mut self, value: i64) -> Self {
394 self.auto_tuned_vpus_per_gb = Some(value);
395 self
396 }
397
398 pub fn with_boot_volume_replicas(mut self, value: Vec<BootVolumeReplicaInfo>) -> Self {
400 self.boot_volume_replicas = Some(value);
401 self
402 }
403
404 pub fn with_autotune_policies(mut self, value: Vec<AutotunePolicy>) -> Self {
406 self.autotune_policies = Some(value);
407 self
408 }
409}