aws_sdk_mgn/operation/create_application/
_create_application_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateApplicationInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12 pub account_id: ::std::option::Option<::std::string::String>,
14}
15impl CreateApplicationInput {
16 pub fn name(&self) -> ::std::option::Option<&str> {
18 self.name.as_deref()
19 }
20 pub fn description(&self) -> ::std::option::Option<&str> {
22 self.description.as_deref()
23 }
24 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26 self.tags.as_ref()
27 }
28 pub fn account_id(&self) -> ::std::option::Option<&str> {
30 self.account_id.as_deref()
31 }
32}
33impl ::std::fmt::Debug for CreateApplicationInput {
34 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35 let mut formatter = f.debug_struct("CreateApplicationInput");
36 formatter.field("name", &self.name);
37 formatter.field("description", &self.description);
38 formatter.field("tags", &"*** Sensitive Data Redacted ***");
39 formatter.field("account_id", &self.account_id);
40 formatter.finish()
41 }
42}
43impl CreateApplicationInput {
44 pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
46 crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct CreateApplicationInputBuilder {
54 pub(crate) name: ::std::option::Option<::std::string::String>,
55 pub(crate) description: ::std::option::Option<::std::string::String>,
56 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
57 pub(crate) account_id: ::std::option::Option<::std::string::String>,
58}
59impl CreateApplicationInputBuilder {
60 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.name = ::std::option::Option::Some(input.into());
64 self
65 }
66 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.name = input;
69 self
70 }
71 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
73 &self.name
74 }
75 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.description = ::std::option::Option::Some(input.into());
78 self
79 }
80 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.description = input;
83 self
84 }
85 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
87 &self.description
88 }
89 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
95 let mut hash_map = self.tags.unwrap_or_default();
96 hash_map.insert(k.into(), v.into());
97 self.tags = ::std::option::Option::Some(hash_map);
98 self
99 }
100 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
102 self.tags = input;
103 self
104 }
105 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
107 &self.tags
108 }
109 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.account_id = ::std::option::Option::Some(input.into());
112 self
113 }
114 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.account_id = input;
117 self
118 }
119 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
121 &self.account_id
122 }
123 pub fn build(
125 self,
126 ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
127 ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
128 name: self.name,
129 description: self.description,
130 tags: self.tags,
131 account_id: self.account_id,
132 })
133 }
134}
135impl ::std::fmt::Debug for CreateApplicationInputBuilder {
136 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
137 let mut formatter = f.debug_struct("CreateApplicationInputBuilder");
138 formatter.field("name", &self.name);
139 formatter.field("description", &self.description);
140 formatter.field("tags", &"*** Sensitive Data Redacted ***");
141 formatter.field("account_id", &self.account_id);
142 formatter.finish()
143 }
144}