aws_sdk_guardduty/operation/delete_members/
_delete_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 DeleteMembersInput {
6    /// <p>The unique ID of the detector of the GuardDuty account whose members you want to delete.</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 GuardDuty member accounts that you want to delete.</p>
10    pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11}
12impl DeleteMembersInput {
13    /// <p>The unique ID of the detector of the GuardDuty account whose members you want to delete.</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 IDs of the GuardDuty member accounts that you want to delete.</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_ids.is_none()`.
21    pub fn account_ids(&self) -> &[::std::string::String] {
22        self.account_ids.as_deref().unwrap_or_default()
23    }
24}
25impl DeleteMembersInput {
26    /// Creates a new builder-style object to manufacture [`DeleteMembersInput`](crate::operation::delete_members::DeleteMembersInput).
27    pub fn builder() -> crate::operation::delete_members::builders::DeleteMembersInputBuilder {
28        crate::operation::delete_members::builders::DeleteMembersInputBuilder::default()
29    }
30}
31
32/// A builder for [`DeleteMembersInput`](crate::operation::delete_members::DeleteMembersInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct DeleteMembersInputBuilder {
36    pub(crate) detector_id: ::std::option::Option<::std::string::String>,
37    pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
38}
39impl DeleteMembersInputBuilder {
40    /// <p>The unique ID of the detector of the GuardDuty account whose members you want to delete.</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 whose members you want to delete.</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 whose members you want to delete.</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_ids`.
59    ///
60    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
61    ///
62    /// <p>A list of account IDs of the GuardDuty member accounts that you want to delete.</p>
63    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        let mut v = self.account_ids.unwrap_or_default();
65        v.push(input.into());
66        self.account_ids = ::std::option::Option::Some(v);
67        self
68    }
69    /// <p>A list of account IDs of the GuardDuty member accounts that you want to delete.</p>
70    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
71        self.account_ids = input;
72        self
73    }
74    /// <p>A list of account IDs of the GuardDuty member accounts that you want to delete.</p>
75    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
76        &self.account_ids
77    }
78    /// Consumes the builder and constructs a [`DeleteMembersInput`](crate::operation::delete_members::DeleteMembersInput).
79    pub fn build(
80        self,
81    ) -> ::std::result::Result<crate::operation::delete_members::DeleteMembersInput, ::aws_smithy_types::error::operation::BuildError> {
82        ::std::result::Result::Ok(crate::operation::delete_members::DeleteMembersInput {
83            detector_id: self.detector_id,
84            account_ids: self.account_ids,
85        })
86    }
87}