aws_sdk_securityhub/operation/create_members/_create_members_input.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 CreateMembersInput {
6 /// <p>The list of accounts to associate with the Security Hub administrator account. For each account, the list includes the account ID and optionally the email address.</p>
7 pub account_details: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetails>>,
8}
9impl CreateMembersInput {
10 /// <p>The list of accounts to associate with the Security Hub administrator account. For each account, the list includes the account ID and optionally the email address.</p>
11 ///
12 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.account_details.is_none()`.
13 pub fn account_details(&self) -> &[crate::types::AccountDetails] {
14 self.account_details.as_deref().unwrap_or_default()
15 }
16}
17impl CreateMembersInput {
18 /// Creates a new builder-style object to manufacture [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
19 pub fn builder() -> crate::operation::create_members::builders::CreateMembersInputBuilder {
20 crate::operation::create_members::builders::CreateMembersInputBuilder::default()
21 }
22}
23
24/// A builder for [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
25#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct CreateMembersInputBuilder {
28 pub(crate) account_details: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetails>>,
29}
30impl CreateMembersInputBuilder {
31 /// Appends an item to `account_details`.
32 ///
33 /// To override the contents of this collection use [`set_account_details`](Self::set_account_details).
34 ///
35 /// <p>The list of accounts to associate with the Security Hub administrator account. For each account, the list includes the account ID and optionally the email address.</p>
36 pub fn account_details(mut self, input: crate::types::AccountDetails) -> Self {
37 let mut v = self.account_details.unwrap_or_default();
38 v.push(input);
39 self.account_details = ::std::option::Option::Some(v);
40 self
41 }
42 /// <p>The list of accounts to associate with the Security Hub administrator account. For each account, the list includes the account ID and optionally the email address.</p>
43 pub fn set_account_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetails>>) -> Self {
44 self.account_details = input;
45 self
46 }
47 /// <p>The list of accounts to associate with the Security Hub administrator account. For each account, the list includes the account ID and optionally the email address.</p>
48 pub fn get_account_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccountDetails>> {
49 &self.account_details
50 }
51 /// Consumes the builder and constructs a [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
52 pub fn build(
53 self,
54 ) -> ::std::result::Result<crate::operation::create_members::CreateMembersInput, ::aws_smithy_types::error::operation::BuildError> {
55 ::std::result::Result::Ok(crate::operation::create_members::CreateMembersInput {
56 account_details: self.account_details,
57 })
58 }
59}