aws_sdk_mgn/operation/start_test/
_start_test_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct StartTestInput {
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 StartTestInput {
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 StartTestInput {
30 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
31 let mut formatter = f.debug_struct("StartTestInput");
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 StartTestInput {
39 pub fn builder() -> crate::operation::start_test::builders::StartTestInputBuilder {
41 crate::operation::start_test::builders::StartTestInputBuilder::default()
42 }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
47#[non_exhaustive]
48pub struct StartTestInputBuilder {
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 StartTestInputBuilder {
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(self) -> ::std::result::Result<crate::operation::start_test::StartTestInput, ::aws_smithy_types::error::operation::BuildError> {
110 ::std::result::Result::Ok(crate::operation::start_test::StartTestInput {
111 source_server_ids: self.source_server_ids,
112 tags: self.tags,
113 account_id: self.account_id,
114 })
115 }
116}
117impl ::std::fmt::Debug for StartTestInputBuilder {
118 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
119 let mut formatter = f.debug_struct("StartTestInputBuilder");
120 formatter.field("source_server_ids", &self.source_server_ids);
121 formatter.field("tags", &"*** Sensitive Data Redacted ***");
122 formatter.field("account_id", &self.account_id);
123 formatter.finish()
124 }
125}