aws_sdk_securityhub/operation/get_members/
_get_members_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, ::std::fmt::Debug)]
5pub struct GetMembersOutput {
6    /// <p>The list of details about the Security Hub member accounts.</p>
7    pub members: ::std::option::Option<::std::vec::Vec<crate::types::Member>>,
8    /// <p>The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address.</p>
9    pub unprocessed_accounts: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
10    _request_id: Option<String>,
11}
12impl GetMembersOutput {
13    /// <p>The list of details about the Security Hub member accounts.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.members.is_none()`.
16    pub fn members(&self) -> &[crate::types::Member] {
17        self.members.as_deref().unwrap_or_default()
18    }
19    /// <p>The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.unprocessed_accounts.is_none()`.
22    pub fn unprocessed_accounts(&self) -> &[crate::types::Result] {
23        self.unprocessed_accounts.as_deref().unwrap_or_default()
24    }
25}
26impl ::aws_types::request_id::RequestId for GetMembersOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl GetMembersOutput {
32    /// Creates a new builder-style object to manufacture [`GetMembersOutput`](crate::operation::get_members::GetMembersOutput).
33    pub fn builder() -> crate::operation::get_members::builders::GetMembersOutputBuilder {
34        crate::operation::get_members::builders::GetMembersOutputBuilder::default()
35    }
36}
37
38/// A builder for [`GetMembersOutput`](crate::operation::get_members::GetMembersOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct GetMembersOutputBuilder {
42    pub(crate) members: ::std::option::Option<::std::vec::Vec<crate::types::Member>>,
43    pub(crate) unprocessed_accounts: ::std::option::Option<::std::vec::Vec<crate::types::Result>>,
44    _request_id: Option<String>,
45}
46impl GetMembersOutputBuilder {
47    /// Appends an item to `members`.
48    ///
49    /// To override the contents of this collection use [`set_members`](Self::set_members).
50    ///
51    /// <p>The list of details about the Security Hub member accounts.</p>
52    pub fn members(mut self, input: crate::types::Member) -> Self {
53        let mut v = self.members.unwrap_or_default();
54        v.push(input);
55        self.members = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>The list of details about the Security Hub member accounts.</p>
59    pub fn set_members(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Member>>) -> Self {
60        self.members = input;
61        self
62    }
63    /// <p>The list of details about the Security Hub member accounts.</p>
64    pub fn get_members(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Member>> {
65        &self.members
66    }
67    /// Appends an item to `unprocessed_accounts`.
68    ///
69    /// To override the contents of this collection use [`set_unprocessed_accounts`](Self::set_unprocessed_accounts).
70    ///
71    /// <p>The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address.</p>
72    pub fn unprocessed_accounts(mut self, input: crate::types::Result) -> Self {
73        let mut v = self.unprocessed_accounts.unwrap_or_default();
74        v.push(input);
75        self.unprocessed_accounts = ::std::option::Option::Some(v);
76        self
77    }
78    /// <p>The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address.</p>
79    pub fn set_unprocessed_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Result>>) -> Self {
80        self.unprocessed_accounts = input;
81        self
82    }
83    /// <p>The list of Amazon Web Services accounts that could not be processed. For each account, the list includes the account ID and the email address.</p>
84    pub fn get_unprocessed_accounts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Result>> {
85        &self.unprocessed_accounts
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88        self._request_id = Some(request_id.into());
89        self
90    }
91
92    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93        self._request_id = request_id;
94        self
95    }
96    /// Consumes the builder and constructs a [`GetMembersOutput`](crate::operation::get_members::GetMembersOutput).
97    pub fn build(self) -> crate::operation::get_members::GetMembersOutput {
98        crate::operation::get_members::GetMembersOutput {
99            members: self.members,
100            unprocessed_accounts: self.unprocessed_accounts,
101            _request_id: self._request_id,
102        }
103    }
104}