aws_sdk_securityir/operation/get_membership/
_get_membership_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetMembershipOutput {
6 pub membership_id: ::std::string::String,
8 pub account_id: ::std::option::Option<::std::string::String>,
10 pub region: ::std::option::Option<crate::types::AwsRegion>,
12 pub membership_name: ::std::option::Option<::std::string::String>,
14 pub membership_arn: ::std::option::Option<::std::string::String>,
16 pub membership_status: ::std::option::Option<crate::types::MembershipStatus>,
18 pub membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22 pub customer_type: ::std::option::Option<crate::types::CustomerType>,
24 pub number_of_accounts_covered: ::std::option::Option<i64>,
26 pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
28 pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
30 _request_id: Option<String>,
31}
32impl GetMembershipOutput {
33 pub fn membership_id(&self) -> &str {
35 use std::ops::Deref;
36 self.membership_id.deref()
37 }
38 pub fn account_id(&self) -> ::std::option::Option<&str> {
40 self.account_id.as_deref()
41 }
42 pub fn region(&self) -> ::std::option::Option<&crate::types::AwsRegion> {
44 self.region.as_ref()
45 }
46 pub fn membership_name(&self) -> ::std::option::Option<&str> {
48 self.membership_name.as_deref()
49 }
50 pub fn membership_arn(&self) -> ::std::option::Option<&str> {
52 self.membership_arn.as_deref()
53 }
54 pub fn membership_status(&self) -> ::std::option::Option<&crate::types::MembershipStatus> {
56 self.membership_status.as_ref()
57 }
58 pub fn membership_activation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
60 self.membership_activation_timestamp.as_ref()
61 }
62 pub fn membership_deactivation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
64 self.membership_deactivation_timestamp.as_ref()
65 }
66 pub fn customer_type(&self) -> ::std::option::Option<&crate::types::CustomerType> {
68 self.customer_type.as_ref()
69 }
70 pub fn number_of_accounts_covered(&self) -> ::std::option::Option<i64> {
72 self.number_of_accounts_covered
73 }
74 pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
78 self.incident_response_team.as_deref().unwrap_or_default()
79 }
80 pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
84 self.opt_in_features.as_deref().unwrap_or_default()
85 }
86}
87impl ::std::fmt::Debug for GetMembershipOutput {
88 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
89 let mut formatter = f.debug_struct("GetMembershipOutput");
90 formatter.field("membership_id", &self.membership_id);
91 formatter.field("account_id", &self.account_id);
92 formatter.field("region", &self.region);
93 formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
94 formatter.field("membership_arn", &self.membership_arn);
95 formatter.field("membership_status", &self.membership_status);
96 formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
97 formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
98 formatter.field("customer_type", &self.customer_type);
99 formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
100 formatter.field("incident_response_team", &self.incident_response_team);
101 formatter.field("opt_in_features", &self.opt_in_features);
102 formatter.field("_request_id", &self._request_id);
103 formatter.finish()
104 }
105}
106impl ::aws_types::request_id::RequestId for GetMembershipOutput {
107 fn request_id(&self) -> Option<&str> {
108 self._request_id.as_deref()
109 }
110}
111impl GetMembershipOutput {
112 pub fn builder() -> crate::operation::get_membership::builders::GetMembershipOutputBuilder {
114 crate::operation::get_membership::builders::GetMembershipOutputBuilder::default()
115 }
116}
117
118#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
120#[non_exhaustive]
121pub struct GetMembershipOutputBuilder {
122 pub(crate) membership_id: ::std::option::Option<::std::string::String>,
123 pub(crate) account_id: ::std::option::Option<::std::string::String>,
124 pub(crate) region: ::std::option::Option<crate::types::AwsRegion>,
125 pub(crate) membership_name: ::std::option::Option<::std::string::String>,
126 pub(crate) membership_arn: ::std::option::Option<::std::string::String>,
127 pub(crate) membership_status: ::std::option::Option<crate::types::MembershipStatus>,
128 pub(crate) membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
129 pub(crate) membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
130 pub(crate) customer_type: ::std::option::Option<crate::types::CustomerType>,
131 pub(crate) number_of_accounts_covered: ::std::option::Option<i64>,
132 pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
133 pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
134 _request_id: Option<String>,
135}
136impl GetMembershipOutputBuilder {
137 pub fn membership_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.membership_id = ::std::option::Option::Some(input.into());
141 self
142 }
143 pub fn set_membership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.membership_id = input;
146 self
147 }
148 pub fn get_membership_id(&self) -> &::std::option::Option<::std::string::String> {
150 &self.membership_id
151 }
152 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.account_id = ::std::option::Option::Some(input.into());
155 self
156 }
157 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.account_id = input;
160 self
161 }
162 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
164 &self.account_id
165 }
166 pub fn region(mut self, input: crate::types::AwsRegion) -> Self {
168 self.region = ::std::option::Option::Some(input);
169 self
170 }
171 pub fn set_region(mut self, input: ::std::option::Option<crate::types::AwsRegion>) -> Self {
173 self.region = input;
174 self
175 }
176 pub fn get_region(&self) -> &::std::option::Option<crate::types::AwsRegion> {
178 &self.region
179 }
180 pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182 self.membership_name = ::std::option::Option::Some(input.into());
183 self
184 }
185 pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187 self.membership_name = input;
188 self
189 }
190 pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
192 &self.membership_name
193 }
194 pub fn membership_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196 self.membership_arn = ::std::option::Option::Some(input.into());
197 self
198 }
199 pub fn set_membership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201 self.membership_arn = input;
202 self
203 }
204 pub fn get_membership_arn(&self) -> &::std::option::Option<::std::string::String> {
206 &self.membership_arn
207 }
208 pub fn membership_status(mut self, input: crate::types::MembershipStatus) -> Self {
210 self.membership_status = ::std::option::Option::Some(input);
211 self
212 }
213 pub fn set_membership_status(mut self, input: ::std::option::Option<crate::types::MembershipStatus>) -> Self {
215 self.membership_status = input;
216 self
217 }
218 pub fn get_membership_status(&self) -> &::std::option::Option<crate::types::MembershipStatus> {
220 &self.membership_status
221 }
222 pub fn membership_activation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
224 self.membership_activation_timestamp = ::std::option::Option::Some(input);
225 self
226 }
227 pub fn set_membership_activation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
229 self.membership_activation_timestamp = input;
230 self
231 }
232 pub fn get_membership_activation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
234 &self.membership_activation_timestamp
235 }
236 pub fn membership_deactivation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
238 self.membership_deactivation_timestamp = ::std::option::Option::Some(input);
239 self
240 }
241 pub fn set_membership_deactivation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
243 self.membership_deactivation_timestamp = input;
244 self
245 }
246 pub fn get_membership_deactivation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
248 &self.membership_deactivation_timestamp
249 }
250 pub fn customer_type(mut self, input: crate::types::CustomerType) -> Self {
252 self.customer_type = ::std::option::Option::Some(input);
253 self
254 }
255 pub fn set_customer_type(mut self, input: ::std::option::Option<crate::types::CustomerType>) -> Self {
257 self.customer_type = input;
258 self
259 }
260 pub fn get_customer_type(&self) -> &::std::option::Option<crate::types::CustomerType> {
262 &self.customer_type
263 }
264 pub fn number_of_accounts_covered(mut self, input: i64) -> Self {
266 self.number_of_accounts_covered = ::std::option::Option::Some(input);
267 self
268 }
269 pub fn set_number_of_accounts_covered(mut self, input: ::std::option::Option<i64>) -> Self {
271 self.number_of_accounts_covered = input;
272 self
273 }
274 pub fn get_number_of_accounts_covered(&self) -> &::std::option::Option<i64> {
276 &self.number_of_accounts_covered
277 }
278 pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
284 let mut v = self.incident_response_team.unwrap_or_default();
285 v.push(input);
286 self.incident_response_team = ::std::option::Option::Some(v);
287 self
288 }
289 pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
291 self.incident_response_team = input;
292 self
293 }
294 pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
296 &self.incident_response_team
297 }
298 pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
304 let mut v = self.opt_in_features.unwrap_or_default();
305 v.push(input);
306 self.opt_in_features = ::std::option::Option::Some(v);
307 self
308 }
309 pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
311 self.opt_in_features = input;
312 self
313 }
314 pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
316 &self.opt_in_features
317 }
318 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
319 self._request_id = Some(request_id.into());
320 self
321 }
322
323 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
324 self._request_id = request_id;
325 self
326 }
327 pub fn build(
331 self,
332 ) -> ::std::result::Result<crate::operation::get_membership::GetMembershipOutput, ::aws_smithy_types::error::operation::BuildError> {
333 ::std::result::Result::Ok(crate::operation::get_membership::GetMembershipOutput {
334 membership_id: self.membership_id.ok_or_else(|| {
335 ::aws_smithy_types::error::operation::BuildError::missing_field(
336 "membership_id",
337 "membership_id was not specified but it is required when building GetMembershipOutput",
338 )
339 })?,
340 account_id: self.account_id,
341 region: self.region,
342 membership_name: self.membership_name,
343 membership_arn: self.membership_arn,
344 membership_status: self.membership_status,
345 membership_activation_timestamp: self.membership_activation_timestamp,
346 membership_deactivation_timestamp: self.membership_deactivation_timestamp,
347 customer_type: self.customer_type,
348 number_of_accounts_covered: self.number_of_accounts_covered,
349 incident_response_team: self.incident_response_team,
350 opt_in_features: self.opt_in_features,
351 _request_id: self._request_id,
352 })
353 }
354}
355impl ::std::fmt::Debug for GetMembershipOutputBuilder {
356 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
357 let mut formatter = f.debug_struct("GetMembershipOutputBuilder");
358 formatter.field("membership_id", &self.membership_id);
359 formatter.field("account_id", &self.account_id);
360 formatter.field("region", &self.region);
361 formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
362 formatter.field("membership_arn", &self.membership_arn);
363 formatter.field("membership_status", &self.membership_status);
364 formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
365 formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
366 formatter.field("customer_type", &self.customer_type);
367 formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
368 formatter.field("incident_response_team", &self.incident_response_team);
369 formatter.field("opt_in_features", &self.opt_in_features);
370 formatter.field("_request_id", &self._request_id);
371 formatter.finish()
372 }
373}