oci_rust_sdk/core/models/
shape.rs1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct Shape {
9 pub shape: String,
11
12 #[serde(skip_serializing_if = "Option::is_none")]
14 pub baseline_ocpu_utilizations: Option<Vec<ShapeBaselineOcpuUtilizations>>,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
18 pub min_total_baseline_ocpus_required: Option<i64>,
19
20 #[serde(skip_serializing_if = "Option::is_none")]
22 pub processor_description: Option<String>,
23
24 #[serde(skip_serializing_if = "Option::is_none")]
26 pub ocpus: Option<i64>,
27
28 #[serde(skip_serializing_if = "Option::is_none")]
30 pub memory_in_gbs: Option<i64>,
31
32 #[serde(skip_serializing_if = "Option::is_none")]
34 pub network_ports: Option<i64>,
35
36 #[serde(skip_serializing_if = "Option::is_none")]
38 pub networking_bandwidth_in_gbps: Option<i64>,
39
40 #[serde(skip_serializing_if = "Option::is_none")]
42 pub max_vnic_attachments: Option<i64>,
43
44 #[serde(skip_serializing_if = "Option::is_none")]
46 pub gpus: Option<i64>,
47
48 #[serde(skip_serializing_if = "Option::is_none")]
50 pub gpu_description: Option<String>,
51
52 #[serde(skip_serializing_if = "Option::is_none")]
54 pub local_disks: Option<i64>,
55
56 #[serde(skip_serializing_if = "Option::is_none")]
58 pub local_disks_total_size_in_gbs: Option<i64>,
59
60 #[serde(skip_serializing_if = "Option::is_none")]
62 pub local_disk_description: Option<String>,
63
64 #[serde(skip_serializing_if = "Option::is_none")]
66 pub rdma_ports: Option<i64>,
67
68 #[serde(skip_serializing_if = "Option::is_none")]
70 pub rdma_bandwidth_in_gbps: Option<i64>,
71
72 #[serde(skip_serializing_if = "Option::is_none")]
74 pub is_live_migration_supported: Option<bool>,
75
76 #[serde(skip_serializing_if = "Option::is_none")]
77 pub ocpu_options: Option<ShapeOcpuOptions>,
78
79 #[serde(skip_serializing_if = "Option::is_none")]
80 pub memory_options: Option<ShapeMemoryOptions>,
81
82 #[serde(skip_serializing_if = "Option::is_none")]
83 pub networking_bandwidth_options: Option<ShapeNetworkingBandwidthOptions>,
84
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub max_vnic_attachment_options: Option<ShapeMaxVnicAttachmentOptions>,
87
88 #[serde(skip_serializing_if = "Option::is_none")]
89 pub platform_config_options: Option<ShapePlatformConfigOptions>,
90
91 #[serde(skip_serializing_if = "Option::is_none")]
93 pub is_billed_for_stopped_instance: Option<bool>,
94
95 #[serde(skip_serializing_if = "Option::is_none")]
97 pub billing_type: Option<ShapeBillingType>,
98
99 #[serde(skip_serializing_if = "Option::is_none")]
101 pub quota_names: Option<Vec<String>>,
102
103 #[serde(skip_serializing_if = "Option::is_none")]
105 pub is_subcore: Option<bool>,
106
107 #[serde(skip_serializing_if = "Option::is_none")]
109 pub is_flexible: Option<bool>,
110
111 #[serde(skip_serializing_if = "Option::is_none")]
113 pub resize_compatible_shapes: Option<Vec<String>>,
114
115 #[serde(skip_serializing_if = "Option::is_none")]
117 pub recommended_alternatives: Option<Vec<ShapeAlternativeObject>>,
118}
119
120pub struct ShapeRequired {
122 pub shape: String,
124}
125
126impl Shape {
127 pub fn new(required: ShapeRequired) -> Self {
129 Self {
130 shape: required.shape,
131
132 baseline_ocpu_utilizations: None,
133
134 min_total_baseline_ocpus_required: None,
135
136 processor_description: None,
137
138 ocpus: None,
139
140 memory_in_gbs: None,
141
142 network_ports: None,
143
144 networking_bandwidth_in_gbps: None,
145
146 max_vnic_attachments: None,
147
148 gpus: None,
149
150 gpu_description: None,
151
152 local_disks: None,
153
154 local_disks_total_size_in_gbs: None,
155
156 local_disk_description: None,
157
158 rdma_ports: None,
159
160 rdma_bandwidth_in_gbps: None,
161
162 is_live_migration_supported: None,
163
164 ocpu_options: None,
165
166 memory_options: None,
167
168 networking_bandwidth_options: None,
169
170 max_vnic_attachment_options: None,
171
172 platform_config_options: None,
173
174 is_billed_for_stopped_instance: None,
175
176 billing_type: None,
177
178 quota_names: None,
179
180 is_subcore: None,
181
182 is_flexible: None,
183
184 resize_compatible_shapes: None,
185
186 recommended_alternatives: None,
187 }
188 }
189
190 pub fn set_baseline_ocpu_utilizations(
192 mut self,
193 value: Option<Vec<ShapeBaselineOcpuUtilizations>>,
194 ) -> Self {
195 self.baseline_ocpu_utilizations = value;
196 self
197 }
198
199 pub fn set_min_total_baseline_ocpus_required(mut self, value: Option<i64>) -> Self {
201 self.min_total_baseline_ocpus_required = value;
202 self
203 }
204
205 pub fn set_shape(mut self, value: String) -> Self {
207 self.shape = value;
208 self
209 }
210
211 pub fn set_processor_description(mut self, value: Option<String>) -> Self {
213 self.processor_description = value;
214 self
215 }
216
217 pub fn set_ocpus(mut self, value: Option<i64>) -> Self {
219 self.ocpus = value;
220 self
221 }
222
223 pub fn set_memory_in_gbs(mut self, value: Option<i64>) -> Self {
225 self.memory_in_gbs = value;
226 self
227 }
228
229 pub fn set_network_ports(mut self, value: Option<i64>) -> Self {
231 self.network_ports = value;
232 self
233 }
234
235 pub fn set_networking_bandwidth_in_gbps(mut self, value: Option<i64>) -> Self {
237 self.networking_bandwidth_in_gbps = value;
238 self
239 }
240
241 pub fn set_max_vnic_attachments(mut self, value: Option<i64>) -> Self {
243 self.max_vnic_attachments = value;
244 self
245 }
246
247 pub fn set_gpus(mut self, value: Option<i64>) -> Self {
249 self.gpus = value;
250 self
251 }
252
253 pub fn set_gpu_description(mut self, value: Option<String>) -> Self {
255 self.gpu_description = value;
256 self
257 }
258
259 pub fn set_local_disks(mut self, value: Option<i64>) -> Self {
261 self.local_disks = value;
262 self
263 }
264
265 pub fn set_local_disks_total_size_in_gbs(mut self, value: Option<i64>) -> Self {
267 self.local_disks_total_size_in_gbs = value;
268 self
269 }
270
271 pub fn set_local_disk_description(mut self, value: Option<String>) -> Self {
273 self.local_disk_description = value;
274 self
275 }
276
277 pub fn set_rdma_ports(mut self, value: Option<i64>) -> Self {
279 self.rdma_ports = value;
280 self
281 }
282
283 pub fn set_rdma_bandwidth_in_gbps(mut self, value: Option<i64>) -> Self {
285 self.rdma_bandwidth_in_gbps = value;
286 self
287 }
288
289 pub fn set_is_live_migration_supported(mut self, value: Option<bool>) -> Self {
291 self.is_live_migration_supported = value;
292 self
293 }
294
295 pub fn set_ocpu_options(mut self, value: Option<ShapeOcpuOptions>) -> Self {
297 self.ocpu_options = value;
298 self
299 }
300
301 pub fn set_memory_options(mut self, value: Option<ShapeMemoryOptions>) -> Self {
303 self.memory_options = value;
304 self
305 }
306
307 pub fn set_networking_bandwidth_options(
309 mut self,
310 value: Option<ShapeNetworkingBandwidthOptions>,
311 ) -> Self {
312 self.networking_bandwidth_options = value;
313 self
314 }
315
316 pub fn set_max_vnic_attachment_options(
318 mut self,
319 value: Option<ShapeMaxVnicAttachmentOptions>,
320 ) -> Self {
321 self.max_vnic_attachment_options = value;
322 self
323 }
324
325 pub fn set_platform_config_options(
327 mut self,
328 value: Option<ShapePlatformConfigOptions>,
329 ) -> Self {
330 self.platform_config_options = value;
331 self
332 }
333
334 pub fn set_is_billed_for_stopped_instance(mut self, value: Option<bool>) -> Self {
336 self.is_billed_for_stopped_instance = value;
337 self
338 }
339
340 pub fn set_billing_type(mut self, value: Option<ShapeBillingType>) -> Self {
342 self.billing_type = value;
343 self
344 }
345
346 pub fn set_quota_names(mut self, value: Option<Vec<String>>) -> Self {
348 self.quota_names = value;
349 self
350 }
351
352 pub fn set_is_subcore(mut self, value: Option<bool>) -> Self {
354 self.is_subcore = value;
355 self
356 }
357
358 pub fn set_is_flexible(mut self, value: Option<bool>) -> Self {
360 self.is_flexible = value;
361 self
362 }
363
364 pub fn set_resize_compatible_shapes(mut self, value: Option<Vec<String>>) -> Self {
366 self.resize_compatible_shapes = value;
367 self
368 }
369
370 pub fn set_recommended_alternatives(
372 mut self,
373 value: Option<Vec<ShapeAlternativeObject>>,
374 ) -> Self {
375 self.recommended_alternatives = value;
376 self
377 }
378
379 pub fn with_baseline_ocpu_utilizations(
381 mut self,
382 value: Vec<ShapeBaselineOcpuUtilizations>,
383 ) -> Self {
384 self.baseline_ocpu_utilizations = Some(value);
385 self
386 }
387
388 pub fn with_min_total_baseline_ocpus_required(mut self, value: i64) -> Self {
390 self.min_total_baseline_ocpus_required = Some(value);
391 self
392 }
393
394 pub fn with_processor_description(mut self, value: impl Into<String>) -> Self {
396 self.processor_description = Some(value.into());
397 self
398 }
399
400 pub fn with_ocpus(mut self, value: i64) -> Self {
402 self.ocpus = Some(value);
403 self
404 }
405
406 pub fn with_memory_in_gbs(mut self, value: i64) -> Self {
408 self.memory_in_gbs = Some(value);
409 self
410 }
411
412 pub fn with_network_ports(mut self, value: i64) -> Self {
414 self.network_ports = Some(value);
415 self
416 }
417
418 pub fn with_networking_bandwidth_in_gbps(mut self, value: i64) -> Self {
420 self.networking_bandwidth_in_gbps = Some(value);
421 self
422 }
423
424 pub fn with_max_vnic_attachments(mut self, value: i64) -> Self {
426 self.max_vnic_attachments = Some(value);
427 self
428 }
429
430 pub fn with_gpus(mut self, value: i64) -> Self {
432 self.gpus = Some(value);
433 self
434 }
435
436 pub fn with_gpu_description(mut self, value: impl Into<String>) -> Self {
438 self.gpu_description = Some(value.into());
439 self
440 }
441
442 pub fn with_local_disks(mut self, value: i64) -> Self {
444 self.local_disks = Some(value);
445 self
446 }
447
448 pub fn with_local_disks_total_size_in_gbs(mut self, value: i64) -> Self {
450 self.local_disks_total_size_in_gbs = Some(value);
451 self
452 }
453
454 pub fn with_local_disk_description(mut self, value: impl Into<String>) -> Self {
456 self.local_disk_description = Some(value.into());
457 self
458 }
459
460 pub fn with_rdma_ports(mut self, value: i64) -> Self {
462 self.rdma_ports = Some(value);
463 self
464 }
465
466 pub fn with_rdma_bandwidth_in_gbps(mut self, value: i64) -> Self {
468 self.rdma_bandwidth_in_gbps = Some(value);
469 self
470 }
471
472 pub fn with_is_live_migration_supported(mut self, value: bool) -> Self {
474 self.is_live_migration_supported = Some(value);
475 self
476 }
477
478 pub fn with_ocpu_options(mut self, value: ShapeOcpuOptions) -> Self {
480 self.ocpu_options = Some(value);
481 self
482 }
483
484 pub fn with_memory_options(mut self, value: ShapeMemoryOptions) -> Self {
486 self.memory_options = Some(value);
487 self
488 }
489
490 pub fn with_networking_bandwidth_options(
492 mut self,
493 value: ShapeNetworkingBandwidthOptions,
494 ) -> Self {
495 self.networking_bandwidth_options = Some(value);
496 self
497 }
498
499 pub fn with_max_vnic_attachment_options(
501 mut self,
502 value: ShapeMaxVnicAttachmentOptions,
503 ) -> Self {
504 self.max_vnic_attachment_options = Some(value);
505 self
506 }
507
508 pub fn with_platform_config_options(mut self, value: ShapePlatformConfigOptions) -> Self {
510 self.platform_config_options = Some(value);
511 self
512 }
513
514 pub fn with_is_billed_for_stopped_instance(mut self, value: bool) -> Self {
516 self.is_billed_for_stopped_instance = Some(value);
517 self
518 }
519
520 pub fn with_billing_type(mut self, value: ShapeBillingType) -> Self {
522 self.billing_type = Some(value);
523 self
524 }
525
526 pub fn with_quota_names(mut self, value: Vec<String>) -> Self {
528 self.quota_names = Some(value);
529 self
530 }
531
532 pub fn with_is_subcore(mut self, value: bool) -> Self {
534 self.is_subcore = Some(value);
535 self
536 }
537
538 pub fn with_is_flexible(mut self, value: bool) -> Self {
540 self.is_flexible = Some(value);
541 self
542 }
543
544 pub fn with_resize_compatible_shapes(mut self, value: Vec<String>) -> Self {
546 self.resize_compatible_shapes = Some(value);
547 self
548 }
549
550 pub fn with_recommended_alternatives(mut self, value: Vec<ShapeAlternativeObject>) -> Self {
552 self.recommended_alternatives = Some(value);
553 self
554 }
555}