aws_sdk_securityir/operation/get_membership/
_get_membership_output.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 GetMembershipOutput {
6    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
7    pub membership_id: ::std::string::String,
8    /// <p>Response element for GetMembership that provides the configured account for managing the membership.</p>
9    pub account_id: ::std::option::Option<::std::string::String>,
10    /// <p>Response element for GetMembership that provides the configured region for managing the membership.</p>
11    pub region: ::std::option::Option<crate::types::AwsRegion>,
12    /// <p>Response element for GetMembership that provides the configured membership name.</p>
13    pub membership_name: ::std::option::Option<::std::string::String>,
14    /// <p>Response element for GetMembership that provides the membership ARN.</p>
15    pub membership_arn: ::std::option::Option<::std::string::String>,
16    /// <p>Response element for GetMembership that provides the current membership status.</p>
17    pub membership_status: ::std::option::Option<crate::types::MembershipStatus>,
18    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
19    pub membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
21    pub membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
23    pub customer_type: ::std::option::Option<crate::types::CustomerType>,
24    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
25    pub number_of_accounts_covered: ::std::option::Option<i64>,
26    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
27    pub incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
28    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
29    pub opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
30    _request_id: Option<String>,
31}
32impl GetMembershipOutput {
33    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
34    pub fn membership_id(&self) -> &str {
35        use std::ops::Deref;
36        self.membership_id.deref()
37    }
38    /// <p>Response element for GetMembership that provides the configured account for managing the membership.</p>
39    pub fn account_id(&self) -> ::std::option::Option<&str> {
40        self.account_id.as_deref()
41    }
42    /// <p>Response element for GetMembership that provides the configured region for managing the membership.</p>
43    pub fn region(&self) -> ::std::option::Option<&crate::types::AwsRegion> {
44        self.region.as_ref()
45    }
46    /// <p>Response element for GetMembership that provides the configured membership name.</p>
47    pub fn membership_name(&self) -> ::std::option::Option<&str> {
48        self.membership_name.as_deref()
49    }
50    /// <p>Response element for GetMembership that provides the membership ARN.</p>
51    pub fn membership_arn(&self) -> ::std::option::Option<&str> {
52        self.membership_arn.as_deref()
53    }
54    /// <p>Response element for GetMembership that provides the current membership status.</p>
55    pub fn membership_status(&self) -> ::std::option::Option<&crate::types::MembershipStatus> {
56        self.membership_status.as_ref()
57    }
58    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
59    pub fn membership_activation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
60        self.membership_activation_timestamp.as_ref()
61    }
62    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
63    pub fn membership_deactivation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
64        self.membership_deactivation_timestamp.as_ref()
65    }
66    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
67    pub fn customer_type(&self) -> ::std::option::Option<&crate::types::CustomerType> {
68        self.customer_type.as_ref()
69    }
70    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
71    pub fn number_of_accounts_covered(&self) -> ::std::option::Option<i64> {
72        self.number_of_accounts_covered
73    }
74    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
75    ///
76    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.incident_response_team.is_none()`.
77    pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
78        self.incident_response_team.as_deref().unwrap_or_default()
79    }
80    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
81    ///
82    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.opt_in_features.is_none()`.
83    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    /// Creates a new builder-style object to manufacture [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
113    pub fn builder() -> crate::operation::get_membership::builders::GetMembershipOutputBuilder {
114        crate::operation::get_membership::builders::GetMembershipOutputBuilder::default()
115    }
116}
117
118/// A builder for [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
119#[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    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
138    /// This field is required.
139    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    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
144    pub fn set_membership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.membership_id = input;
146        self
147    }
148    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
149    pub fn get_membership_id(&self) -> &::std::option::Option<::std::string::String> {
150        &self.membership_id
151    }
152    /// <p>Response element for GetMembership that provides the configured account for managing the membership.</p>
153    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    /// <p>Response element for GetMembership that provides the configured account for managing the membership.</p>
158    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.account_id = input;
160        self
161    }
162    /// <p>Response element for GetMembership that provides the configured account for managing the membership.</p>
163    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
164        &self.account_id
165    }
166    /// <p>Response element for GetMembership that provides the configured region for managing the membership.</p>
167    pub fn region(mut self, input: crate::types::AwsRegion) -> Self {
168        self.region = ::std::option::Option::Some(input);
169        self
170    }
171    /// <p>Response element for GetMembership that provides the configured region for managing the membership.</p>
172    pub fn set_region(mut self, input: ::std::option::Option<crate::types::AwsRegion>) -> Self {
173        self.region = input;
174        self
175    }
176    /// <p>Response element for GetMembership that provides the configured region for managing the membership.</p>
177    pub fn get_region(&self) -> &::std::option::Option<crate::types::AwsRegion> {
178        &self.region
179    }
180    /// <p>Response element for GetMembership that provides the configured membership name.</p>
181    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    /// <p>Response element for GetMembership that provides the configured membership name.</p>
186    pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.membership_name = input;
188        self
189    }
190    /// <p>Response element for GetMembership that provides the configured membership name.</p>
191    pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
192        &self.membership_name
193    }
194    /// <p>Response element for GetMembership that provides the membership ARN.</p>
195    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    /// <p>Response element for GetMembership that provides the membership ARN.</p>
200    pub fn set_membership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.membership_arn = input;
202        self
203    }
204    /// <p>Response element for GetMembership that provides the membership ARN.</p>
205    pub fn get_membership_arn(&self) -> &::std::option::Option<::std::string::String> {
206        &self.membership_arn
207    }
208    /// <p>Response element for GetMembership that provides the current membership status.</p>
209    pub fn membership_status(mut self, input: crate::types::MembershipStatus) -> Self {
210        self.membership_status = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>Response element for GetMembership that provides the current membership status.</p>
214    pub fn set_membership_status(mut self, input: ::std::option::Option<crate::types::MembershipStatus>) -> Self {
215        self.membership_status = input;
216        self
217    }
218    /// <p>Response element for GetMembership that provides the current membership status.</p>
219    pub fn get_membership_status(&self) -> &::std::option::Option<crate::types::MembershipStatus> {
220        &self.membership_status
221    }
222    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
223    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    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
228    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    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
233    pub fn get_membership_activation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
234        &self.membership_activation_timestamp
235    }
236    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
237    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    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
242    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    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
247    pub fn get_membership_deactivation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
248        &self.membership_deactivation_timestamp
249    }
250    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
251    pub fn customer_type(mut self, input: crate::types::CustomerType) -> Self {
252        self.customer_type = ::std::option::Option::Some(input);
253        self
254    }
255    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
256    pub fn set_customer_type(mut self, input: ::std::option::Option<crate::types::CustomerType>) -> Self {
257        self.customer_type = input;
258        self
259    }
260    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
261    pub fn get_customer_type(&self) -> &::std::option::Option<crate::types::CustomerType> {
262        &self.customer_type
263    }
264    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
265    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    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
270    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    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
275    pub fn get_number_of_accounts_covered(&self) -> &::std::option::Option<i64> {
276        &self.number_of_accounts_covered
277    }
278    /// Appends an item to `incident_response_team`.
279    ///
280    /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
281    ///
282    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
283    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    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
290    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    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
295    pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
296        &self.incident_response_team
297    }
298    /// Appends an item to `opt_in_features`.
299    ///
300    /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
301    ///
302    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
303    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    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
310    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    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
315    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    /// Consumes the builder and constructs a [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
328    /// This method will fail if any of the following fields are not set:
329    /// - [`membership_id`](crate::operation::get_membership::builders::GetMembershipOutputBuilder::membership_id)
330    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}