aws_sdk_mgn/operation/start_cutover/
_start_cutover_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct StartCutoverInput {
6 pub source_server_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10 pub account_id: ::std::option::Option<::std::string::String>,
12}
13impl StartCutoverInput {
14 pub fn source_server_ids(&self) -> &[::std::string::String] {
18 self.source_server_ids.as_deref().unwrap_or_default()
19 }
20 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
22 self.tags.as_ref()
23 }
24 pub fn account_id(&self) -> ::std::option::Option<&str> {
26 self.account_id.as_deref()
27 }
28}
29impl ::std::fmt::Debug for StartCutoverInput {
30 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31 let mut formatter = f.debug_struct("StartCutoverInput");
32 formatter.field("source_server_ids", &self.source_server_ids);
33 formatter.field("tags", &"*** Sensitive Data Redacted ***");
34 formatter.field("account_id", &self.account_id);
35 formatter.finish()
36 }
37}
38impl StartCutoverInput {
39 pub fn builder() -> crate::operation::start_cutover::builders::StartCutoverInputBuilder {
41 crate::operation::start_cutover::builders::StartCutoverInputBuilder::default()
42 }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
47#[non_exhaustive]
48pub struct StartCutoverInputBuilder {
49 pub(crate) source_server_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
51 pub(crate) account_id: ::std::option::Option<::std::string::String>,
52}
53impl StartCutoverInputBuilder {
54 pub fn source_server_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 let mut v = self.source_server_ids.unwrap_or_default();
61 v.push(input.into());
62 self.source_server_ids = ::std::option::Option::Some(v);
63 self
64 }
65 pub fn set_source_server_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
67 self.source_server_ids = input;
68 self
69 }
70 pub fn get_source_server_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
72 &self.source_server_ids
73 }
74 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
80 let mut hash_map = self.tags.unwrap_or_default();
81 hash_map.insert(k.into(), v.into());
82 self.tags = ::std::option::Option::Some(hash_map);
83 self
84 }
85 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
87 self.tags = input;
88 self
89 }
90 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
92 &self.tags
93 }
94 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.account_id = ::std::option::Option::Some(input.into());
97 self
98 }
99 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.account_id = input;
102 self
103 }
104 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
106 &self.account_id
107 }
108 pub fn build(
110 self,
111 ) -> ::std::result::Result<crate::operation::start_cutover::StartCutoverInput, ::aws_smithy_types::error::operation::BuildError> {
112 ::std::result::Result::Ok(crate::operation::start_cutover::StartCutoverInput {
113 source_server_ids: self.source_server_ids,
114 tags: self.tags,
115 account_id: self.account_id,
116 })
117 }
118}
119impl ::std::fmt::Debug for StartCutoverInputBuilder {
120 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
121 let mut formatter = f.debug_struct("StartCutoverInputBuilder");
122 formatter.field("source_server_ids", &self.source_server_ids);
123 formatter.field("tags", &"*** Sensitive Data Redacted ***");
124 formatter.field("account_id", &self.account_id);
125 formatter.finish()
126 }
127}