oci_rust_sdk/core/models/
instance_pool_summary.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 InstancePoolSummary {
11 pub id: String,
13
14 pub compartment_id: String,
16
17 pub instance_configuration_id: String,
19
20 pub lifecycle_state: InstancePoolSummaryLifecycleState,
22
23 pub availability_domains: Vec<String>,
25
26 pub size: i64,
28
29 pub time_created: DateTime<Utc>,
31
32 #[serde(skip_serializing_if = "Option::is_none")]
34 pub display_name: Option<String>,
35
36 #[serde(skip_serializing_if = "Option::is_none")]
38 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
39
40 #[serde(skip_serializing_if = "Option::is_none")]
42 pub freeform_tags: Option<HashMap<String, String>>,
43}
44
45pub struct InstancePoolSummaryRequired {
47 pub id: String,
49
50 pub compartment_id: String,
52
53 pub instance_configuration_id: String,
55
56 pub lifecycle_state: InstancePoolSummaryLifecycleState,
58
59 pub availability_domains: Vec<String>,
61
62 pub size: i64,
64
65 pub time_created: DateTime<Utc>,
67}
68
69impl InstancePoolSummary {
70 pub fn new(required: InstancePoolSummaryRequired) -> Self {
72 Self {
73 id: required.id,
74
75 compartment_id: required.compartment_id,
76
77 instance_configuration_id: required.instance_configuration_id,
78
79 lifecycle_state: required.lifecycle_state,
80
81 availability_domains: required.availability_domains,
82
83 size: required.size,
84
85 time_created: required.time_created,
86
87 display_name: None,
88
89 defined_tags: None,
90
91 freeform_tags: None,
92 }
93 }
94
95 pub fn set_id(mut self, value: String) -> Self {
97 self.id = value;
98 self
99 }
100
101 pub fn set_compartment_id(mut self, value: String) -> Self {
103 self.compartment_id = value;
104 self
105 }
106
107 pub fn set_display_name(mut self, value: Option<String>) -> Self {
109 self.display_name = value;
110 self
111 }
112
113 pub fn set_instance_configuration_id(mut self, value: String) -> Self {
115 self.instance_configuration_id = value;
116 self
117 }
118
119 pub fn set_lifecycle_state(mut self, value: InstancePoolSummaryLifecycleState) -> Self {
121 self.lifecycle_state = value;
122 self
123 }
124
125 pub fn set_availability_domains(mut self, value: Vec<String>) -> Self {
127 self.availability_domains = value;
128 self
129 }
130
131 pub fn set_size(mut self, value: i64) -> Self {
133 self.size = value;
134 self
135 }
136
137 pub fn set_time_created(mut self, value: DateTime<Utc>) -> Self {
139 self.time_created = value;
140 self
141 }
142
143 pub fn set_defined_tags(
145 mut self,
146 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
147 ) -> Self {
148 self.defined_tags = value;
149 self
150 }
151
152 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
154 self.freeform_tags = value;
155 self
156 }
157
158 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
160 self.display_name = Some(value.into());
161 self
162 }
163
164 pub fn with_defined_tags(
166 mut self,
167 value: HashMap<String, HashMap<String, serde_json::Value>>,
168 ) -> Self {
169 self.defined_tags = Some(value);
170 self
171 }
172
173 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
175 self.freeform_tags = Some(value);
176 self
177 }
178}