oci_rust_sdk/core/models/
capacity_config.rs1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct CapacityConfig {
9 #[serde(skip_serializing_if = "Option::is_none")]
11 pub capacity_config_name: Option<String>,
12
13 #[serde(skip_serializing_if = "Option::is_none")]
14 pub supported_capabilities: Option<SupportedCapabilities>,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
18 pub is_default: Option<bool>,
19
20 #[serde(skip_serializing_if = "Option::is_none")]
22 pub capacity_bins: Option<Vec<CapacityBinPreview>>,
23}
24
25impl CapacityConfig {
26 pub fn new() -> Self {
28 Self {
29 capacity_config_name: None,
30
31 supported_capabilities: None,
32
33 is_default: None,
34
35 capacity_bins: None,
36 }
37 }
38
39 pub fn set_capacity_config_name(mut self, value: Option<String>) -> Self {
41 self.capacity_config_name = value;
42 self
43 }
44
45 pub fn set_supported_capabilities(mut self, value: Option<SupportedCapabilities>) -> Self {
47 self.supported_capabilities = value;
48 self
49 }
50
51 pub fn set_is_default(mut self, value: Option<bool>) -> Self {
53 self.is_default = value;
54 self
55 }
56
57 pub fn set_capacity_bins(mut self, value: Option<Vec<CapacityBinPreview>>) -> Self {
59 self.capacity_bins = value;
60 self
61 }
62
63 pub fn with_capacity_config_name(mut self, value: impl Into<String>) -> Self {
65 self.capacity_config_name = Some(value.into());
66 self
67 }
68
69 pub fn with_supported_capabilities(mut self, value: SupportedCapabilities) -> Self {
71 self.supported_capabilities = Some(value);
72 self
73 }
74
75 pub fn with_is_default(mut self, value: bool) -> Self {
77 self.is_default = Some(value);
78 self
79 }
80
81 pub fn with_capacity_bins(mut self, value: Vec<CapacityBinPreview>) -> Self {
83 self.capacity_bins = Some(value);
84 self
85 }
86}
87
88impl Default for CapacityConfig {
89 fn default() -> Self {
90 Self::new()
91 }
92}