aws_sdk_drs/operation/start_recovery/
_start_recovery_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct StartRecoveryInput {
6    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
7    pub source_servers: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>,
8    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
9    pub is_drill: ::std::option::Option<bool>,
10    /// <p>The tags to be associated with the Recovery Job.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl StartRecoveryInput {
14    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_servers.is_none()`.
17    pub fn source_servers(&self) -> &[crate::types::StartRecoveryRequestSourceServer] {
18        self.source_servers.as_deref().unwrap_or_default()
19    }
20    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
21    pub fn is_drill(&self) -> ::std::option::Option<bool> {
22        self.is_drill
23    }
24    /// <p>The tags to be associated with the Recovery Job.</p>
25    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26        self.tags.as_ref()
27    }
28}
29impl ::std::fmt::Debug for StartRecoveryInput {
30    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31        let mut formatter = f.debug_struct("StartRecoveryInput");
32        formatter.field("source_servers", &self.source_servers);
33        formatter.field("is_drill", &self.is_drill);
34        formatter.field("tags", &"*** Sensitive Data Redacted ***");
35        formatter.finish()
36    }
37}
38impl StartRecoveryInput {
39    /// Creates a new builder-style object to manufacture [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
40    pub fn builder() -> crate::operation::start_recovery::builders::StartRecoveryInputBuilder {
41        crate::operation::start_recovery::builders::StartRecoveryInputBuilder::default()
42    }
43}
44
45/// A builder for [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
47#[non_exhaustive]
48pub struct StartRecoveryInputBuilder {
49    pub(crate) source_servers: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>,
50    pub(crate) is_drill: ::std::option::Option<bool>,
51    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
52}
53impl StartRecoveryInputBuilder {
54    /// Appends an item to `source_servers`.
55    ///
56    /// To override the contents of this collection use [`set_source_servers`](Self::set_source_servers).
57    ///
58    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
59    pub fn source_servers(mut self, input: crate::types::StartRecoveryRequestSourceServer) -> Self {
60        let mut v = self.source_servers.unwrap_or_default();
61        v.push(input);
62        self.source_servers = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
66    pub fn set_source_servers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>>) -> Self {
67        self.source_servers = input;
68        self
69    }
70    /// <p>The Source Servers that we want to start a Recovery Job for.</p>
71    pub fn get_source_servers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StartRecoveryRequestSourceServer>> {
72        &self.source_servers
73    }
74    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
75    pub fn is_drill(mut self, input: bool) -> Self {
76        self.is_drill = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
80    pub fn set_is_drill(mut self, input: ::std::option::Option<bool>) -> Self {
81        self.is_drill = input;
82        self
83    }
84    /// <p>Whether this Source Server Recovery operation is a drill or not.</p>
85    pub fn get_is_drill(&self) -> &::std::option::Option<bool> {
86        &self.is_drill
87    }
88    /// Adds a key-value pair to `tags`.
89    ///
90    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
91    ///
92    /// <p>The tags to be associated with the Recovery Job.</p>
93    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
94        let mut hash_map = self.tags.unwrap_or_default();
95        hash_map.insert(k.into(), v.into());
96        self.tags = ::std::option::Option::Some(hash_map);
97        self
98    }
99    /// <p>The tags to be associated with the Recovery Job.</p>
100    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
101        self.tags = input;
102        self
103    }
104    /// <p>The tags to be associated with the Recovery Job.</p>
105    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
106        &self.tags
107    }
108    /// Consumes the builder and constructs a [`StartRecoveryInput`](crate::operation::start_recovery::StartRecoveryInput).
109    pub fn build(
110        self,
111    ) -> ::std::result::Result<crate::operation::start_recovery::StartRecoveryInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::start_recovery::StartRecoveryInput {
113            source_servers: self.source_servers,
114            is_drill: self.is_drill,
115            tags: self.tags,
116        })
117    }
118}
119impl ::std::fmt::Debug for StartRecoveryInputBuilder {
120    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
121        let mut formatter = f.debug_struct("StartRecoveryInputBuilder");
122        formatter.field("source_servers", &self.source_servers);
123        formatter.field("is_drill", &self.is_drill);
124        formatter.field("tags", &"*** Sensitive Data Redacted ***");
125        formatter.finish()
126    }
127}