oci_rust_sdk/core/models/
shape_ocpu_options.rs1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct ShapeOcpuOptions {
9 #[serde(skip_serializing_if = "Option::is_none")]
11 pub min: Option<i64>,
12
13 #[serde(skip_serializing_if = "Option::is_none")]
15 pub max: Option<i64>,
16
17 #[serde(skip_serializing_if = "Option::is_none")]
19 pub max_per_numa_node: Option<i64>,
20}
21
22impl ShapeOcpuOptions {
23 pub fn new() -> Self {
25 Self {
26 min: None,
27
28 max: None,
29
30 max_per_numa_node: None,
31 }
32 }
33
34 pub fn set_min(mut self, value: Option<i64>) -> Self {
36 self.min = value;
37 self
38 }
39
40 pub fn set_max(mut self, value: Option<i64>) -> Self {
42 self.max = value;
43 self
44 }
45
46 pub fn set_max_per_numa_node(mut self, value: Option<i64>) -> Self {
48 self.max_per_numa_node = value;
49 self
50 }
51
52 pub fn with_min(mut self, value: i64) -> Self {
54 self.min = Some(value);
55 self
56 }
57
58 pub fn with_max(mut self, value: i64) -> Self {
60 self.max = Some(value);
61 self
62 }
63
64 pub fn with_max_per_numa_node(mut self, value: i64) -> Self {
66 self.max_per_numa_node = Some(value);
67 self
68 }
69}
70
71impl Default for ShapeOcpuOptions {
72 fn default() -> Self {
73 Self::new()
74 }
75}