aws_sdk_guardduty/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 unique ID of the detector of the GuardDuty account for which you want to associate member accounts.</p>
7    /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
8    pub detector_id: ::std::option::Option<::std::string::String>,
9    /// <p>A list of account ID and email address pairs of the accounts that you want to associate with the GuardDuty administrator account.</p>
10    pub account_details: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetail>>,
11}
12impl CreateMembersInput {
13    /// <p>The unique ID of the detector of the GuardDuty account for which you want to associate member accounts.</p>
14    /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
15    pub fn detector_id(&self) -> ::std::option::Option<&str> {
16        self.detector_id.as_deref()
17    }
18    /// <p>A list of account ID and email address pairs of the accounts that you want to associate with the GuardDuty administrator account.</p>
19    ///
20    /// 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()`.
21    pub fn account_details(&self) -> &[crate::types::AccountDetail] {
22        self.account_details.as_deref().unwrap_or_default()
23    }
24}
25impl CreateMembersInput {
26    /// Creates a new builder-style object to manufacture [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
27    pub fn builder() -> crate::operation::create_members::builders::CreateMembersInputBuilder {
28        crate::operation::create_members::builders::CreateMembersInputBuilder::default()
29    }
30}
31
32/// A builder for [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct CreateMembersInputBuilder {
36    pub(crate) detector_id: ::std::option::Option<::std::string::String>,
37    pub(crate) account_details: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetail>>,
38}
39impl CreateMembersInputBuilder {
40    /// <p>The unique ID of the detector of the GuardDuty account for which you want to associate member accounts.</p>
41    /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
42    /// This field is required.
43    pub fn detector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        self.detector_id = ::std::option::Option::Some(input.into());
45        self
46    }
47    /// <p>The unique ID of the detector of the GuardDuty account for which you want to associate member accounts.</p>
48    /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
49    pub fn set_detector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.detector_id = input;
51        self
52    }
53    /// <p>The unique ID of the detector of the GuardDuty account for which you want to associate member accounts.</p>
54    /// <p>To find the <code>detectorId</code> in the current Region, see the Settings page in the GuardDuty console, or run the <a href="https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html">ListDetectors</a> API.</p>
55    pub fn get_detector_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.detector_id
57    }
58    /// Appends an item to `account_details`.
59    ///
60    /// To override the contents of this collection use [`set_account_details`](Self::set_account_details).
61    ///
62    /// <p>A list of account ID and email address pairs of the accounts that you want to associate with the GuardDuty administrator account.</p>
63    pub fn account_details(mut self, input: crate::types::AccountDetail) -> Self {
64        let mut v = self.account_details.unwrap_or_default();
65        v.push(input);
66        self.account_details = ::std::option::Option::Some(v);
67        self
68    }
69    /// <p>A list of account ID and email address pairs of the accounts that you want to associate with the GuardDuty administrator account.</p>
70    pub fn set_account_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccountDetail>>) -> Self {
71        self.account_details = input;
72        self
73    }
74    /// <p>A list of account ID and email address pairs of the accounts that you want to associate with the GuardDuty administrator account.</p>
75    pub fn get_account_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccountDetail>> {
76        &self.account_details
77    }
78    /// Consumes the builder and constructs a [`CreateMembersInput`](crate::operation::create_members::CreateMembersInput).
79    pub fn build(
80        self,
81    ) -> ::std::result::Result<crate::operation::create_members::CreateMembersInput, ::aws_smithy_types::error::operation::BuildError> {
82        ::std::result::Result::Ok(crate::operation::create_members::CreateMembersInput {
83            detector_id: self.detector_id,
84            account_details: self.account_details,
85        })
86    }
87}