Skip to main content

aws_sdk_drs/types/
_recovery_instance.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A Recovery Instance is a replica of a Source Server running on EC2.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct RecoveryInstance {
7    /// <p>The EC2 instance ID of the Recovery Instance.</p>
8    pub ec2_instance_id: ::std::option::Option<::std::string::String>,
9    /// <p>The state of the EC2 instance for this Recovery Instance.</p>
10    pub ec2_instance_state: ::std::option::Option<crate::types::Ec2InstanceState>,
11    /// <p>The ID of the Job that created the Recovery Instance.</p>
12    pub job_id: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the Recovery Instance.</p>
14    pub recovery_instance_id: ::std::option::Option<::std::string::String>,
15    /// <p>The Source Server ID that this Recovery Instance is associated with.</p>
16    pub source_server_id: ::std::option::Option<::std::string::String>,
17    /// <p>The ARN of the Recovery Instance.</p>
18    pub arn: ::std::option::Option<::std::string::String>,
19    /// <p>An array of tags that are associated with the Recovery Instance.</p>
20    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21    /// <p>An object representing failback related information of the Recovery Instance.</p>
22    pub failback: ::std::option::Option<crate::types::RecoveryInstanceFailback>,
23    /// <p>The Data Replication Info of the Recovery Instance.</p>
24    pub data_replication_info: ::std::option::Option<crate::types::RecoveryInstanceDataReplicationInfo>,
25    /// <p>Properties of the Recovery Instance machine.</p>
26    pub recovery_instance_properties: ::std::option::Option<crate::types::RecoveryInstanceProperties>,
27    /// <p>The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.</p>
28    pub point_in_time_snapshot_date_time: ::std::option::Option<::std::string::String>,
29    /// <p>Whether this Recovery Instance was created for a drill or for an actual Recovery event.</p>
30    pub is_drill: ::std::option::Option<bool>,
31    /// <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
32    pub origin_environment: ::std::option::Option<crate::types::OriginEnvironment>,
33    /// <p>AWS availability zone associated with the recovery instance.</p>
34    pub origin_availability_zone: ::std::option::Option<::std::string::String>,
35    /// <p>The version of the DRS agent installed on the recovery instance</p>
36    pub agent_version: ::std::option::Option<::std::string::String>,
37    /// <p>The ARN of the source Outpost</p>
38    pub source_outpost_arn: ::std::option::Option<::std::string::String>,
39}
40impl RecoveryInstance {
41    /// <p>The EC2 instance ID of the Recovery Instance.</p>
42    pub fn ec2_instance_id(&self) -> ::std::option::Option<&str> {
43        self.ec2_instance_id.as_deref()
44    }
45    /// <p>The state of the EC2 instance for this Recovery Instance.</p>
46    pub fn ec2_instance_state(&self) -> ::std::option::Option<&crate::types::Ec2InstanceState> {
47        self.ec2_instance_state.as_ref()
48    }
49    /// <p>The ID of the Job that created the Recovery Instance.</p>
50    pub fn job_id(&self) -> ::std::option::Option<&str> {
51        self.job_id.as_deref()
52    }
53    /// <p>The ID of the Recovery Instance.</p>
54    pub fn recovery_instance_id(&self) -> ::std::option::Option<&str> {
55        self.recovery_instance_id.as_deref()
56    }
57    /// <p>The Source Server ID that this Recovery Instance is associated with.</p>
58    pub fn source_server_id(&self) -> ::std::option::Option<&str> {
59        self.source_server_id.as_deref()
60    }
61    /// <p>The ARN of the Recovery Instance.</p>
62    pub fn arn(&self) -> ::std::option::Option<&str> {
63        self.arn.as_deref()
64    }
65    /// <p>An array of tags that are associated with the Recovery Instance.</p>
66    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
67        self.tags.as_ref()
68    }
69    /// <p>An object representing failback related information of the Recovery Instance.</p>
70    pub fn failback(&self) -> ::std::option::Option<&crate::types::RecoveryInstanceFailback> {
71        self.failback.as_ref()
72    }
73    /// <p>The Data Replication Info of the Recovery Instance.</p>
74    pub fn data_replication_info(&self) -> ::std::option::Option<&crate::types::RecoveryInstanceDataReplicationInfo> {
75        self.data_replication_info.as_ref()
76    }
77    /// <p>Properties of the Recovery Instance machine.</p>
78    pub fn recovery_instance_properties(&self) -> ::std::option::Option<&crate::types::RecoveryInstanceProperties> {
79        self.recovery_instance_properties.as_ref()
80    }
81    /// <p>The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.</p>
82    pub fn point_in_time_snapshot_date_time(&self) -> ::std::option::Option<&str> {
83        self.point_in_time_snapshot_date_time.as_deref()
84    }
85    /// <p>Whether this Recovery Instance was created for a drill or for an actual Recovery event.</p>
86    pub fn is_drill(&self) -> ::std::option::Option<bool> {
87        self.is_drill
88    }
89    /// <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
90    pub fn origin_environment(&self) -> ::std::option::Option<&crate::types::OriginEnvironment> {
91        self.origin_environment.as_ref()
92    }
93    /// <p>AWS availability zone associated with the recovery instance.</p>
94    pub fn origin_availability_zone(&self) -> ::std::option::Option<&str> {
95        self.origin_availability_zone.as_deref()
96    }
97    /// <p>The version of the DRS agent installed on the recovery instance</p>
98    pub fn agent_version(&self) -> ::std::option::Option<&str> {
99        self.agent_version.as_deref()
100    }
101    /// <p>The ARN of the source Outpost</p>
102    pub fn source_outpost_arn(&self) -> ::std::option::Option<&str> {
103        self.source_outpost_arn.as_deref()
104    }
105}
106impl ::std::fmt::Debug for RecoveryInstance {
107    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
108        let mut formatter = f.debug_struct("RecoveryInstance");
109        formatter.field("ec2_instance_id", &self.ec2_instance_id);
110        formatter.field("ec2_instance_state", &self.ec2_instance_state);
111        formatter.field("job_id", &self.job_id);
112        formatter.field("recovery_instance_id", &self.recovery_instance_id);
113        formatter.field("source_server_id", &self.source_server_id);
114        formatter.field("arn", &self.arn);
115        formatter.field("tags", &"*** Sensitive Data Redacted ***");
116        formatter.field("failback", &self.failback);
117        formatter.field("data_replication_info", &self.data_replication_info);
118        formatter.field("recovery_instance_properties", &self.recovery_instance_properties);
119        formatter.field("point_in_time_snapshot_date_time", &self.point_in_time_snapshot_date_time);
120        formatter.field("is_drill", &self.is_drill);
121        formatter.field("origin_environment", &self.origin_environment);
122        formatter.field("origin_availability_zone", &self.origin_availability_zone);
123        formatter.field("agent_version", &self.agent_version);
124        formatter.field("source_outpost_arn", &self.source_outpost_arn);
125        formatter.finish()
126    }
127}
128impl RecoveryInstance {
129    /// Creates a new builder-style object to manufacture [`RecoveryInstance`](crate::types::RecoveryInstance).
130    pub fn builder() -> crate::types::builders::RecoveryInstanceBuilder {
131        crate::types::builders::RecoveryInstanceBuilder::default()
132    }
133}
134
135/// A builder for [`RecoveryInstance`](crate::types::RecoveryInstance).
136#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
137#[non_exhaustive]
138pub struct RecoveryInstanceBuilder {
139    pub(crate) ec2_instance_id: ::std::option::Option<::std::string::String>,
140    pub(crate) ec2_instance_state: ::std::option::Option<crate::types::Ec2InstanceState>,
141    pub(crate) job_id: ::std::option::Option<::std::string::String>,
142    pub(crate) recovery_instance_id: ::std::option::Option<::std::string::String>,
143    pub(crate) source_server_id: ::std::option::Option<::std::string::String>,
144    pub(crate) arn: ::std::option::Option<::std::string::String>,
145    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
146    pub(crate) failback: ::std::option::Option<crate::types::RecoveryInstanceFailback>,
147    pub(crate) data_replication_info: ::std::option::Option<crate::types::RecoveryInstanceDataReplicationInfo>,
148    pub(crate) recovery_instance_properties: ::std::option::Option<crate::types::RecoveryInstanceProperties>,
149    pub(crate) point_in_time_snapshot_date_time: ::std::option::Option<::std::string::String>,
150    pub(crate) is_drill: ::std::option::Option<bool>,
151    pub(crate) origin_environment: ::std::option::Option<crate::types::OriginEnvironment>,
152    pub(crate) origin_availability_zone: ::std::option::Option<::std::string::String>,
153    pub(crate) agent_version: ::std::option::Option<::std::string::String>,
154    pub(crate) source_outpost_arn: ::std::option::Option<::std::string::String>,
155}
156impl RecoveryInstanceBuilder {
157    /// <p>The EC2 instance ID of the Recovery Instance.</p>
158    pub fn ec2_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.ec2_instance_id = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The EC2 instance ID of the Recovery Instance.</p>
163    pub fn set_ec2_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.ec2_instance_id = input;
165        self
166    }
167    /// <p>The EC2 instance ID of the Recovery Instance.</p>
168    pub fn get_ec2_instance_id(&self) -> &::std::option::Option<::std::string::String> {
169        &self.ec2_instance_id
170    }
171    /// <p>The state of the EC2 instance for this Recovery Instance.</p>
172    pub fn ec2_instance_state(mut self, input: crate::types::Ec2InstanceState) -> Self {
173        self.ec2_instance_state = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>The state of the EC2 instance for this Recovery Instance.</p>
177    pub fn set_ec2_instance_state(mut self, input: ::std::option::Option<crate::types::Ec2InstanceState>) -> Self {
178        self.ec2_instance_state = input;
179        self
180    }
181    /// <p>The state of the EC2 instance for this Recovery Instance.</p>
182    pub fn get_ec2_instance_state(&self) -> &::std::option::Option<crate::types::Ec2InstanceState> {
183        &self.ec2_instance_state
184    }
185    /// <p>The ID of the Job that created the Recovery Instance.</p>
186    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.job_id = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>The ID of the Job that created the Recovery Instance.</p>
191    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.job_id = input;
193        self
194    }
195    /// <p>The ID of the Job that created the Recovery Instance.</p>
196    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
197        &self.job_id
198    }
199    /// <p>The ID of the Recovery Instance.</p>
200    pub fn recovery_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.recovery_instance_id = ::std::option::Option::Some(input.into());
202        self
203    }
204    /// <p>The ID of the Recovery Instance.</p>
205    pub fn set_recovery_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.recovery_instance_id = input;
207        self
208    }
209    /// <p>The ID of the Recovery Instance.</p>
210    pub fn get_recovery_instance_id(&self) -> &::std::option::Option<::std::string::String> {
211        &self.recovery_instance_id
212    }
213    /// <p>The Source Server ID that this Recovery Instance is associated with.</p>
214    pub fn source_server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.source_server_id = ::std::option::Option::Some(input.into());
216        self
217    }
218    /// <p>The Source Server ID that this Recovery Instance is associated with.</p>
219    pub fn set_source_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220        self.source_server_id = input;
221        self
222    }
223    /// <p>The Source Server ID that this Recovery Instance is associated with.</p>
224    pub fn get_source_server_id(&self) -> &::std::option::Option<::std::string::String> {
225        &self.source_server_id
226    }
227    /// <p>The ARN of the Recovery Instance.</p>
228    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.arn = ::std::option::Option::Some(input.into());
230        self
231    }
232    /// <p>The ARN of the Recovery Instance.</p>
233    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.arn = input;
235        self
236    }
237    /// <p>The ARN of the Recovery Instance.</p>
238    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
239        &self.arn
240    }
241    /// Adds a key-value pair to `tags`.
242    ///
243    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
244    ///
245    /// <p>An array of tags that are associated with the Recovery Instance.</p>
246    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
247        let mut hash_map = self.tags.unwrap_or_default();
248        hash_map.insert(k.into(), v.into());
249        self.tags = ::std::option::Option::Some(hash_map);
250        self
251    }
252    /// <p>An array of tags that are associated with the Recovery Instance.</p>
253    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
254        self.tags = input;
255        self
256    }
257    /// <p>An array of tags that are associated with the Recovery Instance.</p>
258    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
259        &self.tags
260    }
261    /// <p>An object representing failback related information of the Recovery Instance.</p>
262    pub fn failback(mut self, input: crate::types::RecoveryInstanceFailback) -> Self {
263        self.failback = ::std::option::Option::Some(input);
264        self
265    }
266    /// <p>An object representing failback related information of the Recovery Instance.</p>
267    pub fn set_failback(mut self, input: ::std::option::Option<crate::types::RecoveryInstanceFailback>) -> Self {
268        self.failback = input;
269        self
270    }
271    /// <p>An object representing failback related information of the Recovery Instance.</p>
272    pub fn get_failback(&self) -> &::std::option::Option<crate::types::RecoveryInstanceFailback> {
273        &self.failback
274    }
275    /// <p>The Data Replication Info of the Recovery Instance.</p>
276    pub fn data_replication_info(mut self, input: crate::types::RecoveryInstanceDataReplicationInfo) -> Self {
277        self.data_replication_info = ::std::option::Option::Some(input);
278        self
279    }
280    /// <p>The Data Replication Info of the Recovery Instance.</p>
281    pub fn set_data_replication_info(mut self, input: ::std::option::Option<crate::types::RecoveryInstanceDataReplicationInfo>) -> Self {
282        self.data_replication_info = input;
283        self
284    }
285    /// <p>The Data Replication Info of the Recovery Instance.</p>
286    pub fn get_data_replication_info(&self) -> &::std::option::Option<crate::types::RecoveryInstanceDataReplicationInfo> {
287        &self.data_replication_info
288    }
289    /// <p>Properties of the Recovery Instance machine.</p>
290    pub fn recovery_instance_properties(mut self, input: crate::types::RecoveryInstanceProperties) -> Self {
291        self.recovery_instance_properties = ::std::option::Option::Some(input);
292        self
293    }
294    /// <p>Properties of the Recovery Instance machine.</p>
295    pub fn set_recovery_instance_properties(mut self, input: ::std::option::Option<crate::types::RecoveryInstanceProperties>) -> Self {
296        self.recovery_instance_properties = input;
297        self
298    }
299    /// <p>Properties of the Recovery Instance machine.</p>
300    pub fn get_recovery_instance_properties(&self) -> &::std::option::Option<crate::types::RecoveryInstanceProperties> {
301        &self.recovery_instance_properties
302    }
303    /// <p>The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.</p>
304    pub fn point_in_time_snapshot_date_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.point_in_time_snapshot_date_time = ::std::option::Option::Some(input.into());
306        self
307    }
308    /// <p>The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.</p>
309    pub fn set_point_in_time_snapshot_date_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
310        self.point_in_time_snapshot_date_time = input;
311        self
312    }
313    /// <p>The date and time of the Point in Time (PIT) snapshot that this Recovery Instance was launched from.</p>
314    pub fn get_point_in_time_snapshot_date_time(&self) -> &::std::option::Option<::std::string::String> {
315        &self.point_in_time_snapshot_date_time
316    }
317    /// <p>Whether this Recovery Instance was created for a drill or for an actual Recovery event.</p>
318    pub fn is_drill(mut self, input: bool) -> Self {
319        self.is_drill = ::std::option::Option::Some(input);
320        self
321    }
322    /// <p>Whether this Recovery Instance was created for a drill or for an actual Recovery event.</p>
323    pub fn set_is_drill(mut self, input: ::std::option::Option<bool>) -> Self {
324        self.is_drill = input;
325        self
326    }
327    /// <p>Whether this Recovery Instance was created for a drill or for an actual Recovery event.</p>
328    pub fn get_is_drill(&self) -> &::std::option::Option<bool> {
329        &self.is_drill
330    }
331    /// <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
332    pub fn origin_environment(mut self, input: crate::types::OriginEnvironment) -> Self {
333        self.origin_environment = ::std::option::Option::Some(input);
334        self
335    }
336    /// <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
337    pub fn set_origin_environment(mut self, input: ::std::option::Option<crate::types::OriginEnvironment>) -> Self {
338        self.origin_environment = input;
339        self
340    }
341    /// <p>Environment (On Premises / AWS) of the instance that the recovery instance originated from.</p>
342    pub fn get_origin_environment(&self) -> &::std::option::Option<crate::types::OriginEnvironment> {
343        &self.origin_environment
344    }
345    /// <p>AWS availability zone associated with the recovery instance.</p>
346    pub fn origin_availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
347        self.origin_availability_zone = ::std::option::Option::Some(input.into());
348        self
349    }
350    /// <p>AWS availability zone associated with the recovery instance.</p>
351    pub fn set_origin_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
352        self.origin_availability_zone = input;
353        self
354    }
355    /// <p>AWS availability zone associated with the recovery instance.</p>
356    pub fn get_origin_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
357        &self.origin_availability_zone
358    }
359    /// <p>The version of the DRS agent installed on the recovery instance</p>
360    pub fn agent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361        self.agent_version = ::std::option::Option::Some(input.into());
362        self
363    }
364    /// <p>The version of the DRS agent installed on the recovery instance</p>
365    pub fn set_agent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
366        self.agent_version = input;
367        self
368    }
369    /// <p>The version of the DRS agent installed on the recovery instance</p>
370    pub fn get_agent_version(&self) -> &::std::option::Option<::std::string::String> {
371        &self.agent_version
372    }
373    /// <p>The ARN of the source Outpost</p>
374    pub fn source_outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
375        self.source_outpost_arn = ::std::option::Option::Some(input.into());
376        self
377    }
378    /// <p>The ARN of the source Outpost</p>
379    pub fn set_source_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
380        self.source_outpost_arn = input;
381        self
382    }
383    /// <p>The ARN of the source Outpost</p>
384    pub fn get_source_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
385        &self.source_outpost_arn
386    }
387    /// Consumes the builder and constructs a [`RecoveryInstance`](crate::types::RecoveryInstance).
388    pub fn build(self) -> crate::types::RecoveryInstance {
389        crate::types::RecoveryInstance {
390            ec2_instance_id: self.ec2_instance_id,
391            ec2_instance_state: self.ec2_instance_state,
392            job_id: self.job_id,
393            recovery_instance_id: self.recovery_instance_id,
394            source_server_id: self.source_server_id,
395            arn: self.arn,
396            tags: self.tags,
397            failback: self.failback,
398            data_replication_info: self.data_replication_info,
399            recovery_instance_properties: self.recovery_instance_properties,
400            point_in_time_snapshot_date_time: self.point_in_time_snapshot_date_time,
401            is_drill: self.is_drill,
402            origin_environment: self.origin_environment,
403            origin_availability_zone: self.origin_availability_zone,
404            agent_version: self.agent_version,
405            source_outpost_arn: self.source_outpost_arn,
406        }
407    }
408}
409impl ::std::fmt::Debug for RecoveryInstanceBuilder {
410    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
411        let mut formatter = f.debug_struct("RecoveryInstanceBuilder");
412        formatter.field("ec2_instance_id", &self.ec2_instance_id);
413        formatter.field("ec2_instance_state", &self.ec2_instance_state);
414        formatter.field("job_id", &self.job_id);
415        formatter.field("recovery_instance_id", &self.recovery_instance_id);
416        formatter.field("source_server_id", &self.source_server_id);
417        formatter.field("arn", &self.arn);
418        formatter.field("tags", &"*** Sensitive Data Redacted ***");
419        formatter.field("failback", &self.failback);
420        formatter.field("data_replication_info", &self.data_replication_info);
421        formatter.field("recovery_instance_properties", &self.recovery_instance_properties);
422        formatter.field("point_in_time_snapshot_date_time", &self.point_in_time_snapshot_date_time);
423        formatter.field("is_drill", &self.is_drill);
424        formatter.field("origin_environment", &self.origin_environment);
425        formatter.field("origin_availability_zone", &self.origin_availability_zone);
426        formatter.field("agent_version", &self.agent_version);
427        formatter.field("source_outpost_arn", &self.source_outpost_arn);
428        formatter.finish()
429    }
430}