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 account configured to manage the membership.</p>
9    pub account_id: ::std::option::Option<::std::string::String>,
10    /// <p>Response element for GetMembership that provides the region configured to manage 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    /// <p>The <code>membershipAccountsConfigurations</code> field contains the configuration details for member accounts within the Amazon Web Services Organizations membership structure.</p>
31    /// <p>This field returns a structure containing information about:</p>
32    /// <ul>
33    /// <li>
34    /// <p>Account configurations for member accounts</p></li>
35    /// <li>
36    /// <p>Membership settings and preferences</p></li>
37    /// <li>
38    /// <p>Account-level permissions and roles</p></li>
39    /// </ul>
40    pub membership_accounts_configurations: ::std::option::Option<crate::types::MembershipAccountsConfigurations>,
41    _request_id: Option<String>,
42}
43impl GetMembershipOutput {
44    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
45    pub fn membership_id(&self) -> &str {
46        use std::ops::Deref;
47        self.membership_id.deref()
48    }
49    /// <p>Response element for GetMembership that provides the account configured to manage the membership.</p>
50    pub fn account_id(&self) -> ::std::option::Option<&str> {
51        self.account_id.as_deref()
52    }
53    /// <p>Response element for GetMembership that provides the region configured to manage the membership.</p>
54    pub fn region(&self) -> ::std::option::Option<&crate::types::AwsRegion> {
55        self.region.as_ref()
56    }
57    /// <p>Response element for GetMembership that provides the configured membership name.</p>
58    pub fn membership_name(&self) -> ::std::option::Option<&str> {
59        self.membership_name.as_deref()
60    }
61    /// <p>Response element for GetMembership that provides the membership ARN.</p>
62    pub fn membership_arn(&self) -> ::std::option::Option<&str> {
63        self.membership_arn.as_deref()
64    }
65    /// <p>Response element for GetMembership that provides the current membership status.</p>
66    pub fn membership_status(&self) -> ::std::option::Option<&crate::types::MembershipStatus> {
67        self.membership_status.as_ref()
68    }
69    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
70    pub fn membership_activation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71        self.membership_activation_timestamp.as_ref()
72    }
73    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
74    pub fn membership_deactivation_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
75        self.membership_deactivation_timestamp.as_ref()
76    }
77    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
78    pub fn customer_type(&self) -> ::std::option::Option<&crate::types::CustomerType> {
79        self.customer_type.as_ref()
80    }
81    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
82    pub fn number_of_accounts_covered(&self) -> ::std::option::Option<i64> {
83        self.number_of_accounts_covered
84    }
85    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
86    ///
87    /// 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()`.
88    pub fn incident_response_team(&self) -> &[crate::types::IncidentResponder] {
89        self.incident_response_team.as_deref().unwrap_or_default()
90    }
91    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
92    ///
93    /// 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()`.
94    pub fn opt_in_features(&self) -> &[crate::types::OptInFeature] {
95        self.opt_in_features.as_deref().unwrap_or_default()
96    }
97    /// <p>The <code>membershipAccountsConfigurations</code> field contains the configuration details for member accounts within the Amazon Web Services Organizations membership structure.</p>
98    /// <p>This field returns a structure containing information about:</p>
99    /// <ul>
100    /// <li>
101    /// <p>Account configurations for member accounts</p></li>
102    /// <li>
103    /// <p>Membership settings and preferences</p></li>
104    /// <li>
105    /// <p>Account-level permissions and roles</p></li>
106    /// </ul>
107    pub fn membership_accounts_configurations(&self) -> ::std::option::Option<&crate::types::MembershipAccountsConfigurations> {
108        self.membership_accounts_configurations.as_ref()
109    }
110}
111impl ::std::fmt::Debug for GetMembershipOutput {
112    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
113        let mut formatter = f.debug_struct("GetMembershipOutput");
114        formatter.field("membership_id", &self.membership_id);
115        formatter.field("account_id", &self.account_id);
116        formatter.field("region", &self.region);
117        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
118        formatter.field("membership_arn", &self.membership_arn);
119        formatter.field("membership_status", &self.membership_status);
120        formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
121        formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
122        formatter.field("customer_type", &self.customer_type);
123        formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
124        formatter.field("incident_response_team", &self.incident_response_team);
125        formatter.field("opt_in_features", &self.opt_in_features);
126        formatter.field("membership_accounts_configurations", &self.membership_accounts_configurations);
127        formatter.field("_request_id", &self._request_id);
128        formatter.finish()
129    }
130}
131impl ::aws_types::request_id::RequestId for GetMembershipOutput {
132    fn request_id(&self) -> Option<&str> {
133        self._request_id.as_deref()
134    }
135}
136impl GetMembershipOutput {
137    /// Creates a new builder-style object to manufacture [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
138    pub fn builder() -> crate::operation::get_membership::builders::GetMembershipOutputBuilder {
139        crate::operation::get_membership::builders::GetMembershipOutputBuilder::default()
140    }
141}
142
143/// A builder for [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
144#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
145#[non_exhaustive]
146pub struct GetMembershipOutputBuilder {
147    pub(crate) membership_id: ::std::option::Option<::std::string::String>,
148    pub(crate) account_id: ::std::option::Option<::std::string::String>,
149    pub(crate) region: ::std::option::Option<crate::types::AwsRegion>,
150    pub(crate) membership_name: ::std::option::Option<::std::string::String>,
151    pub(crate) membership_arn: ::std::option::Option<::std::string::String>,
152    pub(crate) membership_status: ::std::option::Option<crate::types::MembershipStatus>,
153    pub(crate) membership_activation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
154    pub(crate) membership_deactivation_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
155    pub(crate) customer_type: ::std::option::Option<crate::types::CustomerType>,
156    pub(crate) number_of_accounts_covered: ::std::option::Option<i64>,
157    pub(crate) incident_response_team: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>,
158    pub(crate) opt_in_features: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>,
159    pub(crate) membership_accounts_configurations: ::std::option::Option<crate::types::MembershipAccountsConfigurations>,
160    _request_id: Option<String>,
161}
162impl GetMembershipOutputBuilder {
163    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
164    /// This field is required.
165    pub fn membership_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.membership_id = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
170    pub fn set_membership_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.membership_id = input;
172        self
173    }
174    /// <p>Response element for GetMembership that provides the queried membership ID.</p>
175    pub fn get_membership_id(&self) -> &::std::option::Option<::std::string::String> {
176        &self.membership_id
177    }
178    /// <p>Response element for GetMembership that provides the account configured to manage the membership.</p>
179    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.account_id = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>Response element for GetMembership that provides the account configured to manage the membership.</p>
184    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.account_id = input;
186        self
187    }
188    /// <p>Response element for GetMembership that provides the account configured to manage the membership.</p>
189    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
190        &self.account_id
191    }
192    /// <p>Response element for GetMembership that provides the region configured to manage the membership.</p>
193    pub fn region(mut self, input: crate::types::AwsRegion) -> Self {
194        self.region = ::std::option::Option::Some(input);
195        self
196    }
197    /// <p>Response element for GetMembership that provides the region configured to manage the membership.</p>
198    pub fn set_region(mut self, input: ::std::option::Option<crate::types::AwsRegion>) -> Self {
199        self.region = input;
200        self
201    }
202    /// <p>Response element for GetMembership that provides the region configured to manage the membership.</p>
203    pub fn get_region(&self) -> &::std::option::Option<crate::types::AwsRegion> {
204        &self.region
205    }
206    /// <p>Response element for GetMembership that provides the configured membership name.</p>
207    pub fn membership_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.membership_name = ::std::option::Option::Some(input.into());
209        self
210    }
211    /// <p>Response element for GetMembership that provides the configured membership name.</p>
212    pub fn set_membership_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.membership_name = input;
214        self
215    }
216    /// <p>Response element for GetMembership that provides the configured membership name.</p>
217    pub fn get_membership_name(&self) -> &::std::option::Option<::std::string::String> {
218        &self.membership_name
219    }
220    /// <p>Response element for GetMembership that provides the membership ARN.</p>
221    pub fn membership_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.membership_arn = ::std::option::Option::Some(input.into());
223        self
224    }
225    /// <p>Response element for GetMembership that provides the membership ARN.</p>
226    pub fn set_membership_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.membership_arn = input;
228        self
229    }
230    /// <p>Response element for GetMembership that provides the membership ARN.</p>
231    pub fn get_membership_arn(&self) -> &::std::option::Option<::std::string::String> {
232        &self.membership_arn
233    }
234    /// <p>Response element for GetMembership that provides the current membership status.</p>
235    pub fn membership_status(mut self, input: crate::types::MembershipStatus) -> Self {
236        self.membership_status = ::std::option::Option::Some(input);
237        self
238    }
239    /// <p>Response element for GetMembership that provides the current membership status.</p>
240    pub fn set_membership_status(mut self, input: ::std::option::Option<crate::types::MembershipStatus>) -> Self {
241        self.membership_status = input;
242        self
243    }
244    /// <p>Response element for GetMembership that provides the current membership status.</p>
245    pub fn get_membership_status(&self) -> &::std::option::Option<crate::types::MembershipStatus> {
246        &self.membership_status
247    }
248    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
249    pub fn membership_activation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
250        self.membership_activation_timestamp = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
254    pub fn set_membership_activation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
255        self.membership_activation_timestamp = input;
256        self
257    }
258    /// <p>Response element for GetMembership that provides the configured membership activation timestamp.</p>
259    pub fn get_membership_activation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
260        &self.membership_activation_timestamp
261    }
262    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
263    pub fn membership_deactivation_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
264        self.membership_deactivation_timestamp = ::std::option::Option::Some(input);
265        self
266    }
267    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
268    pub fn set_membership_deactivation_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
269        self.membership_deactivation_timestamp = input;
270        self
271    }
272    /// <p>Response element for GetMembership that provides the configured membership name deactivation timestamp.</p>
273    pub fn get_membership_deactivation_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
274        &self.membership_deactivation_timestamp
275    }
276    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
277    pub fn customer_type(mut self, input: crate::types::CustomerType) -> Self {
278        self.customer_type = ::std::option::Option::Some(input);
279        self
280    }
281    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
282    pub fn set_customer_type(mut self, input: ::std::option::Option<crate::types::CustomerType>) -> Self {
283        self.customer_type = input;
284        self
285    }
286    /// <p>Response element for GetMembership that provides the configured membership type. Options include <code> Standalone | Organizations</code>.</p>
287    pub fn get_customer_type(&self) -> &::std::option::Option<crate::types::CustomerType> {
288        &self.customer_type
289    }
290    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
291    pub fn number_of_accounts_covered(mut self, input: i64) -> Self {
292        self.number_of_accounts_covered = ::std::option::Option::Some(input);
293        self
294    }
295    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
296    pub fn set_number_of_accounts_covered(mut self, input: ::std::option::Option<i64>) -> Self {
297        self.number_of_accounts_covered = input;
298        self
299    }
300    /// <p>Response element for GetMembership that provides the number of accounts in the membership.</p>
301    pub fn get_number_of_accounts_covered(&self) -> &::std::option::Option<i64> {
302        &self.number_of_accounts_covered
303    }
304    /// Appends an item to `incident_response_team`.
305    ///
306    /// To override the contents of this collection use [`set_incident_response_team`](Self::set_incident_response_team).
307    ///
308    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
309    pub fn incident_response_team(mut self, input: crate::types::IncidentResponder) -> Self {
310        let mut v = self.incident_response_team.unwrap_or_default();
311        v.push(input);
312        self.incident_response_team = ::std::option::Option::Some(v);
313        self
314    }
315    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
316    pub fn set_incident_response_team(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>>) -> Self {
317        self.incident_response_team = input;
318        self
319    }
320    /// <p>Response element for GetMembership that provides the configured membership incident response team members.</p>
321    pub fn get_incident_response_team(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncidentResponder>> {
322        &self.incident_response_team
323    }
324    /// Appends an item to `opt_in_features`.
325    ///
326    /// To override the contents of this collection use [`set_opt_in_features`](Self::set_opt_in_features).
327    ///
328    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
329    pub fn opt_in_features(mut self, input: crate::types::OptInFeature) -> Self {
330        let mut v = self.opt_in_features.unwrap_or_default();
331        v.push(input);
332        self.opt_in_features = ::std::option::Option::Some(v);
333        self
334    }
335    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
336    pub fn set_opt_in_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>>) -> Self {
337        self.opt_in_features = input;
338        self
339    }
340    /// <p>Response element for GetMembership that provides the if opt-in features have been enabled.</p>
341    pub fn get_opt_in_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptInFeature>> {
342        &self.opt_in_features
343    }
344    /// <p>The <code>membershipAccountsConfigurations</code> field contains the configuration details for member accounts within the Amazon Web Services Organizations membership structure.</p>
345    /// <p>This field returns a structure containing information about:</p>
346    /// <ul>
347    /// <li>
348    /// <p>Account configurations for member accounts</p></li>
349    /// <li>
350    /// <p>Membership settings and preferences</p></li>
351    /// <li>
352    /// <p>Account-level permissions and roles</p></li>
353    /// </ul>
354    pub fn membership_accounts_configurations(mut self, input: crate::types::MembershipAccountsConfigurations) -> Self {
355        self.membership_accounts_configurations = ::std::option::Option::Some(input);
356        self
357    }
358    /// <p>The <code>membershipAccountsConfigurations</code> field contains the configuration details for member accounts within the Amazon Web Services Organizations membership structure.</p>
359    /// <p>This field returns a structure containing information about:</p>
360    /// <ul>
361    /// <li>
362    /// <p>Account configurations for member accounts</p></li>
363    /// <li>
364    /// <p>Membership settings and preferences</p></li>
365    /// <li>
366    /// <p>Account-level permissions and roles</p></li>
367    /// </ul>
368    pub fn set_membership_accounts_configurations(mut self, input: ::std::option::Option<crate::types::MembershipAccountsConfigurations>) -> Self {
369        self.membership_accounts_configurations = input;
370        self
371    }
372    /// <p>The <code>membershipAccountsConfigurations</code> field contains the configuration details for member accounts within the Amazon Web Services Organizations membership structure.</p>
373    /// <p>This field returns a structure containing information about:</p>
374    /// <ul>
375    /// <li>
376    /// <p>Account configurations for member accounts</p></li>
377    /// <li>
378    /// <p>Membership settings and preferences</p></li>
379    /// <li>
380    /// <p>Account-level permissions and roles</p></li>
381    /// </ul>
382    pub fn get_membership_accounts_configurations(&self) -> &::std::option::Option<crate::types::MembershipAccountsConfigurations> {
383        &self.membership_accounts_configurations
384    }
385    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
386        self._request_id = Some(request_id.into());
387        self
388    }
389
390    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
391        self._request_id = request_id;
392        self
393    }
394    /// Consumes the builder and constructs a [`GetMembershipOutput`](crate::operation::get_membership::GetMembershipOutput).
395    /// This method will fail if any of the following fields are not set:
396    /// - [`membership_id`](crate::operation::get_membership::builders::GetMembershipOutputBuilder::membership_id)
397    pub fn build(
398        self,
399    ) -> ::std::result::Result<crate::operation::get_membership::GetMembershipOutput, ::aws_smithy_types::error::operation::BuildError> {
400        ::std::result::Result::Ok(crate::operation::get_membership::GetMembershipOutput {
401            membership_id: self.membership_id.ok_or_else(|| {
402                ::aws_smithy_types::error::operation::BuildError::missing_field(
403                    "membership_id",
404                    "membership_id was not specified but it is required when building GetMembershipOutput",
405                )
406            })?,
407            account_id: self.account_id,
408            region: self.region,
409            membership_name: self.membership_name,
410            membership_arn: self.membership_arn,
411            membership_status: self.membership_status,
412            membership_activation_timestamp: self.membership_activation_timestamp,
413            membership_deactivation_timestamp: self.membership_deactivation_timestamp,
414            customer_type: self.customer_type,
415            number_of_accounts_covered: self.number_of_accounts_covered,
416            incident_response_team: self.incident_response_team,
417            opt_in_features: self.opt_in_features,
418            membership_accounts_configurations: self.membership_accounts_configurations,
419            _request_id: self._request_id,
420        })
421    }
422}
423impl ::std::fmt::Debug for GetMembershipOutputBuilder {
424    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
425        let mut formatter = f.debug_struct("GetMembershipOutputBuilder");
426        formatter.field("membership_id", &self.membership_id);
427        formatter.field("account_id", &self.account_id);
428        formatter.field("region", &self.region);
429        formatter.field("membership_name", &"*** Sensitive Data Redacted ***");
430        formatter.field("membership_arn", &self.membership_arn);
431        formatter.field("membership_status", &self.membership_status);
432        formatter.field("membership_activation_timestamp", &self.membership_activation_timestamp);
433        formatter.field("membership_deactivation_timestamp", &self.membership_deactivation_timestamp);
434        formatter.field("customer_type", &self.customer_type);
435        formatter.field("number_of_accounts_covered", &self.number_of_accounts_covered);
436        formatter.field("incident_response_team", &self.incident_response_team);
437        formatter.field("opt_in_features", &self.opt_in_features);
438        formatter.field("membership_accounts_configurations", &self.membership_accounts_configurations);
439        formatter.field("_request_id", &self._request_id);
440        formatter.finish()
441    }
442}