aws_sdk_mgn/operation/start_cutover/
_start_cutover_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 StartCutoverInput {
6    /// <p>Start Cutover by Source Server IDs.</p>
7    pub source_server_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>Start Cutover by Tags.</p>
9    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    /// <p>Start Cutover by Account IDs</p>
11    pub account_id: ::std::option::Option<::std::string::String>,
12}
13impl StartCutoverInput {
14    /// <p>Start Cutover by 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 Cutover 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 Cutover by Account IDs</p>
25    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    /// Creates a new builder-style object to manufacture [`StartCutoverInput`](crate::operation::start_cutover::StartCutoverInput).
40    pub fn builder() -> crate::operation::start_cutover::builders::StartCutoverInputBuilder {
41        crate::operation::start_cutover::builders::StartCutoverInputBuilder::default()
42    }
43}
44
45/// A builder for [`StartCutoverInput`](crate::operation::start_cutover::StartCutoverInput).
46#[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    /// 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 Cutover by 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 Cutover by 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 Cutover by 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 Cutover 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 Cutover 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 Cutover 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 Cutover by Account IDs</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 Cutover by Account IDs</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 Cutover by Account IDs</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 [`StartCutoverInput`](crate::operation::start_cutover::StartCutoverInput).
109    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}