oci_rust_sdk/core/models/
dedicated_capacity_source.rs1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct DedicatedCapacitySource {
9 pub capacity_type: String,
10
11 #[serde(skip_serializing_if = "Option::is_none")]
13 pub compartment_id: Option<String>,
14}
15
16pub struct DedicatedCapacitySourceRequired {
18 pub capacity_type: String,
19}
20
21impl DedicatedCapacitySource {
22 pub fn new(required: DedicatedCapacitySourceRequired) -> Self {
24 Self {
25 capacity_type: required.capacity_type,
26
27 compartment_id: None,
28 }
29 }
30
31 pub fn set_compartment_id(mut self, value: Option<String>) -> Self {
33 self.compartment_id = value;
34 self
35 }
36
37 pub fn set_capacity_type(mut self, value: String) -> Self {
39 self.capacity_type = value;
40 self
41 }
42
43 pub fn with_compartment_id(mut self, value: impl Into<String>) -> Self {
45 self.compartment_id = Some(value.into());
46 self
47 }
48}