aws_sdk_mgn/operation/start_test/
_start_test_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 StartTestInput {
6    /// <p>Start Test for Source Server IDs.</p>
7    pub source_server_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>Start Test by Tags.</p>
9    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    /// <p>Start Test for Account ID.</p>
11    pub account_id: ::std::option::Option<::std::string::String>,
12}
13impl StartTestInput {
14    /// <p>Start Test for Source Server IDs.</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_server_ids.is_none()`.
17    pub fn source_server_ids(&self) -> &[::std::string::String] {
18        self.source_server_ids.as_deref().unwrap_or_default()
19    }
20    /// <p>Start Test by Tags.</p>
21    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
22        self.tags.as_ref()
23    }
24    /// <p>Start Test for Account ID.</p>
25    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    /// Creates a new builder-style object to manufacture [`StartTestInput`](crate::operation::start_test::StartTestInput).
40    pub fn builder() -> crate::operation::start_test::builders::StartTestInputBuilder {
41        crate::operation::start_test::builders::StartTestInputBuilder::default()
42    }
43}
44
45/// A builder for [`StartTestInput`](crate::operation::start_test::StartTestInput).
46#[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    /// Appends an item to `source_server_ids`.
55    ///
56    /// To override the contents of this collection use [`set_source_server_ids`](Self::set_source_server_ids).
57    ///
58    /// <p>Start Test for Source Server IDs.</p>
59    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    /// <p>Start Test for Source Server IDs.</p>
66    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    /// <p>Start Test for Source Server IDs.</p>
71    pub fn get_source_server_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
72        &self.source_server_ids
73    }
74    /// Adds a key-value pair to `tags`.
75    ///
76    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
77    ///
78    /// <p>Start Test by Tags.</p>
79    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    /// <p>Start Test by Tags.</p>
86    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    /// <p>Start Test by Tags.</p>
91    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
92        &self.tags
93    }
94    /// <p>Start Test for Account ID.</p>
95    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    /// <p>Start Test for Account ID.</p>
100    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.account_id = input;
102        self
103    }
104    /// <p>Start Test for Account ID.</p>
105    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
106        &self.account_id
107    }
108    /// Consumes the builder and constructs a [`StartTestInput`](crate::operation::start_test::StartTestInput).
109    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}