aws_sdk_guardduty/operation/invite_members/
_invite_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 InviteMembersInput {
6    /// <p>The unique ID of the detector of the GuardDuty account with which you want to invite members.</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 IDs of the accounts that you want to invite to GuardDuty as members.</p>
10    pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>A Boolean value that specifies whether you want to disable email notification to the accounts that you are inviting to GuardDuty as members.</p>
12    pub disable_email_notification: ::std::option::Option<bool>,
13    /// <p>The invitation message that you want to send to the accounts that you're inviting to GuardDuty as members.</p>
14    pub message: ::std::option::Option<::std::string::String>,
15}
16impl InviteMembersInput {
17    /// <p>The unique ID of the detector of the GuardDuty account with which you want to invite members.</p>
18    /// <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>
19    pub fn detector_id(&self) -> ::std::option::Option<&str> {
20        self.detector_id.as_deref()
21    }
22    /// <p>A list of account IDs of the accounts that you want to invite to GuardDuty as members.</p>
23    ///
24    /// 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_ids.is_none()`.
25    pub fn account_ids(&self) -> &[::std::string::String] {
26        self.account_ids.as_deref().unwrap_or_default()
27    }
28    /// <p>A Boolean value that specifies whether you want to disable email notification to the accounts that you are inviting to GuardDuty as members.</p>
29    pub fn disable_email_notification(&self) -> ::std::option::Option<bool> {
30        self.disable_email_notification
31    }
32    /// <p>The invitation message that you want to send to the accounts that you're inviting to GuardDuty as members.</p>
33    pub fn message(&self) -> ::std::option::Option<&str> {
34        self.message.as_deref()
35    }
36}
37impl InviteMembersInput {
38    /// Creates a new builder-style object to manufacture [`InviteMembersInput`](crate::operation::invite_members::InviteMembersInput).
39    pub fn builder() -> crate::operation::invite_members::builders::InviteMembersInputBuilder {
40        crate::operation::invite_members::builders::InviteMembersInputBuilder::default()
41    }
42}
43
44/// A builder for [`InviteMembersInput`](crate::operation::invite_members::InviteMembersInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct InviteMembersInputBuilder {
48    pub(crate) detector_id: ::std::option::Option<::std::string::String>,
49    pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50    pub(crate) disable_email_notification: ::std::option::Option<bool>,
51    pub(crate) message: ::std::option::Option<::std::string::String>,
52}
53impl InviteMembersInputBuilder {
54    /// <p>The unique ID of the detector of the GuardDuty account with which you want to invite members.</p>
55    /// <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>
56    /// This field is required.
57    pub fn detector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.detector_id = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>The unique ID of the detector of the GuardDuty account with which you want to invite members.</p>
62    /// <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>
63    pub fn set_detector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.detector_id = input;
65        self
66    }
67    /// <p>The unique ID of the detector of the GuardDuty account with which you want to invite members.</p>
68    /// <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>
69    pub fn get_detector_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.detector_id
71    }
72    /// Appends an item to `account_ids`.
73    ///
74    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
75    ///
76    /// <p>A list of account IDs of the accounts that you want to invite to GuardDuty as members.</p>
77    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        let mut v = self.account_ids.unwrap_or_default();
79        v.push(input.into());
80        self.account_ids = ::std::option::Option::Some(v);
81        self
82    }
83    /// <p>A list of account IDs of the accounts that you want to invite to GuardDuty as members.</p>
84    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
85        self.account_ids = input;
86        self
87    }
88    /// <p>A list of account IDs of the accounts that you want to invite to GuardDuty as members.</p>
89    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
90        &self.account_ids
91    }
92    /// <p>A Boolean value that specifies whether you want to disable email notification to the accounts that you are inviting to GuardDuty as members.</p>
93    pub fn disable_email_notification(mut self, input: bool) -> Self {
94        self.disable_email_notification = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>A Boolean value that specifies whether you want to disable email notification to the accounts that you are inviting to GuardDuty as members.</p>
98    pub fn set_disable_email_notification(mut self, input: ::std::option::Option<bool>) -> Self {
99        self.disable_email_notification = input;
100        self
101    }
102    /// <p>A Boolean value that specifies whether you want to disable email notification to the accounts that you are inviting to GuardDuty as members.</p>
103    pub fn get_disable_email_notification(&self) -> &::std::option::Option<bool> {
104        &self.disable_email_notification
105    }
106    /// <p>The invitation message that you want to send to the accounts that you're inviting to GuardDuty as members.</p>
107    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.message = ::std::option::Option::Some(input.into());
109        self
110    }
111    /// <p>The invitation message that you want to send to the accounts that you're inviting to GuardDuty as members.</p>
112    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.message = input;
114        self
115    }
116    /// <p>The invitation message that you want to send to the accounts that you're inviting to GuardDuty as members.</p>
117    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
118        &self.message
119    }
120    /// Consumes the builder and constructs a [`InviteMembersInput`](crate::operation::invite_members::InviteMembersInput).
121    pub fn build(
122        self,
123    ) -> ::std::result::Result<crate::operation::invite_members::InviteMembersInput, ::aws_smithy_types::error::operation::BuildError> {
124        ::std::result::Result::Ok(crate::operation::invite_members::InviteMembersInput {
125            detector_id: self.detector_id,
126            account_ids: self.account_ids,
127            disable_email_notification: self.disable_email_notification,
128            message: self.message,
129        })
130    }
131}