aws_sdk_securityir/operation/create_membership/
_create_membership_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateMembershipInput {
6 pub client_token: ::std::option::Option<::std::string::String>,
8 pub membership_name: ::std::option::Option<::std::string::String>,
10 pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
12 pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
14 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl CreateMembershipInput {
18 pub fn client_token(&self) -> ::std::option::Option<&str> {
20 self.client_token.as_deref()
21 }
22 pub fn membership_name(&self) -> ::std::option::Option<&str> {
24 self.membership_name.as_deref()
25 }
26 pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
30 self.incident_response_team.as_deref().unwrap_or_default()
31 }
32 pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
36 self.opt_in_features.as_deref().unwrap_or_default()
37 }
38 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40 self.tags.as_ref()
41 }
42}
43impl ::std::fmt::Debug for CreateMembershipInput {
44 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
45 let mut formatter = f.debug_struct("CreateMembershipInput");
46 formatter.field("client_token", &self.client_token);
47 formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
48 formatter.field("incident_response_team", &self.incident_response_team);
49 formatter.field("opt_in_features", &self.opt_in_features);
50 formatter.field("tags", &self.tags);
51 formatter.finish()
52 }
53}
54impl CreateMembershipInput {
55 pub fn builder() -> crate::operation::create_membership::builders::CreateMembershipInputBuilder {
57 crate::operation::create_membership::builders::CreateMembershipInputBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
63#[non_exhaustive]
64pub struct CreateMembershipInputBuilder {
65 pub(crate) client_token: ::std::option::Option<::std::string::String>,
66 pub(crate) membership_name: ::std::option::Option<::std::string::String>,
67 pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
68 pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
69 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
70}
71impl CreateMembershipInputBuilder {
72 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.client_token = ::std::option::Option::Some(input.into());
75 self
76 }
77 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.client_token = input;
80 self
81 }
82 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
84 &self.client_token
85 }
86 pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.membership_name = ::std::option::Option::Some(input.into());
90 self
91 }
92 pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.membership_name = input;
95 self
96 }
97 pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
99 &self.membership_name
100 }
101 pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
107 let mut v = self.incident_response_team.unwrap_or_default();
108 v.push(input);
109 self.incident_response_team = ::std::option::Option::Some(v);
110 self
111 }
112 pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
114 self.incident_response_team = input;
115 self
116 }
117 pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
119 &self.incident_response_team
120 }
121 pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
127 let mut v = self.opt_in_features.unwrap_or_default();
128 v.push(input);
129 self.opt_in_features = ::std::option::Option::Some(v);
130 self
131 }
132 pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
134 self.opt_in_features = input;
135 self
136 }
137 pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
139 &self.opt_in_features
140 }
141 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
147 let mut hash_map = self.tags.unwrap_or_default();
148 hash_map.insert(k.into(), v.into());
149 self.tags = ::std::option::Option::Some(hash_map);
150 self
151 }
152 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
154 self.tags = input;
155 self
156 }
157 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
159 &self.tags
160 }
161 pub fn build(
163 self,
164 ) -> ::std::result::Result<crate::operation::create_membership::CreateMembershipInput, ::aws_smithy_types::error::operation::BuildError> {
165 ::std::result::Result::Ok(crate::operation::create_membership::CreateMembershipInput {
166 client_token: self.client_token,
167 membership_name: self.membership_name,
168 incident_response_team: self.incident_response_team,
169 opt_in_features: self.opt_in_features,
170 tags: self.tags,
171 })
172 }
173}
174impl ::std::fmt::Debug for CreateMembershipInputBuilder {
175 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
176 let mut formatter = f.debug_struct("CreateMembershipInputBuilder");
177 formatter.field("client_token", &self.client_token);
178 formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
179 formatter.field("incident_response_team", &self.incident_response_team);
180 formatter.field("opt_in_features", &self.opt_in_features);
181 formatter.field("tags", &self.tags);
182 formatter.finish()
183 }
184}