oci_rust_sdk/core/models/
instance_pool_instance.rs1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3
4#[allow(unused_imports)]
5use super::*;
6#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct InstancePoolInstance {
10 pub id: String,
12
13 pub instance_pool_id: String,
15
16 pub availability_domain: String,
18
19 pub lifecycle_state: InstancePoolInstanceLifecycleState,
21
22 pub compartment_id: String,
24
25 pub instance_configuration_id: String,
27
28 pub region: String,
30
31 pub shape: String,
33
34 pub state: String,
36
37 pub time_created: DateTime<Utc>,
39
40 #[serde(skip_serializing_if = "Option::is_none")]
42 pub display_name: Option<String>,
43
44 #[serde(skip_serializing_if = "Option::is_none")]
46 pub fault_domain: Option<String>,
47
48 #[serde(skip_serializing_if = "Option::is_none")]
50 pub load_balancer_backends: Option<Vec<InstancePoolInstanceLoadBalancerBackend>>,
51}
52
53pub struct InstancePoolInstanceRequired {
55 pub id: String,
57
58 pub instance_pool_id: String,
60
61 pub availability_domain: String,
63
64 pub lifecycle_state: InstancePoolInstanceLifecycleState,
66
67 pub compartment_id: String,
69
70 pub instance_configuration_id: String,
72
73 pub region: String,
75
76 pub shape: String,
78
79 pub state: String,
81
82 pub time_created: DateTime<Utc>,
84}
85
86impl InstancePoolInstance {
87 pub fn new(required: InstancePoolInstanceRequired) -> Self {
89 Self {
90 id: required.id,
91
92 instance_pool_id: required.instance_pool_id,
93
94 availability_domain: required.availability_domain,
95
96 lifecycle_state: required.lifecycle_state,
97
98 compartment_id: required.compartment_id,
99
100 instance_configuration_id: required.instance_configuration_id,
101
102 region: required.region,
103
104 shape: required.shape,
105
106 state: required.state,
107
108 time_created: required.time_created,
109
110 display_name: None,
111
112 fault_domain: None,
113
114 load_balancer_backends: None,
115 }
116 }
117
118 pub fn set_id(mut self, value: String) -> Self {
120 self.id = value;
121 self
122 }
123
124 pub fn set_instance_pool_id(mut self, value: String) -> Self {
126 self.instance_pool_id = value;
127 self
128 }
129
130 pub fn set_availability_domain(mut self, value: String) -> Self {
132 self.availability_domain = value;
133 self
134 }
135
136 pub fn set_lifecycle_state(mut self, value: InstancePoolInstanceLifecycleState) -> Self {
138 self.lifecycle_state = value;
139 self
140 }
141
142 pub fn set_compartment_id(mut self, value: String) -> Self {
144 self.compartment_id = value;
145 self
146 }
147
148 pub fn set_display_name(mut self, value: Option<String>) -> Self {
150 self.display_name = value;
151 self
152 }
153
154 pub fn set_fault_domain(mut self, value: Option<String>) -> Self {
156 self.fault_domain = value;
157 self
158 }
159
160 pub fn set_instance_configuration_id(mut self, value: String) -> Self {
162 self.instance_configuration_id = value;
163 self
164 }
165
166 pub fn set_region(mut self, value: String) -> Self {
168 self.region = value;
169 self
170 }
171
172 pub fn set_shape(mut self, value: String) -> Self {
174 self.shape = value;
175 self
176 }
177
178 pub fn set_state(mut self, value: String) -> Self {
180 self.state = value;
181 self
182 }
183
184 pub fn set_time_created(mut self, value: DateTime<Utc>) -> Self {
186 self.time_created = value;
187 self
188 }
189
190 pub fn set_load_balancer_backends(
192 mut self,
193 value: Option<Vec<InstancePoolInstanceLoadBalancerBackend>>,
194 ) -> Self {
195 self.load_balancer_backends = value;
196 self
197 }
198
199 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
201 self.display_name = Some(value.into());
202 self
203 }
204
205 pub fn with_fault_domain(mut self, value: impl Into<String>) -> Self {
207 self.fault_domain = Some(value.into());
208 self
209 }
210
211 pub fn with_load_balancer_backends(
213 mut self,
214 value: Vec<InstancePoolInstanceLoadBalancerBackend>,
215 ) -> Self {
216 self.load_balancer_backends = Some(value);
217 self
218 }
219}