aws_sdk_detective/operation/create_members/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_members::_create_members_output::CreateMembersOutputBuilder;
3
4pub use crate::operation::create_members::_create_members_input::CreateMembersInputBuilder;
5
6impl crate::operation::create_members::builders::CreateMembersInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_members::CreateMembersOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_members::CreateMembersError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_members();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateMembers`.
24///
25/// <p><code>CreateMembers</code> is used to send invitations to accounts. For the organization behavior graph, the Detective administrator account uses <code>CreateMembers</code> to enable organization accounts as member accounts.</p>
26/// <p>For invited accounts, <code>CreateMembers</code> sends a request to invite the specified Amazon Web Services accounts to be member accounts in the behavior graph. This operation can only be called by the administrator account for a behavior graph.</p>
27/// <p><code>CreateMembers</code> verifies the accounts and then invites the verified accounts. The administrator can optionally specify to not send invitation emails to the member accounts. This would be used when the administrator manages their member accounts centrally.</p>
28/// <p>For organization accounts in the organization behavior graph, <code>CreateMembers</code> attempts to enable the accounts. The organization accounts do not receive invitations.</p>
29/// <p>The request provides the behavior graph ARN and the list of accounts to invite or to enable.</p>
30/// <p>The response separates the requested accounts into two lists:</p>
31/// <ul>
32/// <li>
33/// <p>The accounts that <code>CreateMembers</code> was able to process. For invited accounts, includes member accounts that are being verified, that have passed verification and are to be invited, and that have failed verification. For organization accounts in the organization behavior graph, includes accounts that can be enabled and that cannot be enabled.</p></li>
34/// <li>
35/// <p>The accounts that <code>CreateMembers</code> was unable to process. This list includes accounts that were already invited to be member accounts in the behavior graph.</p></li>
36/// </ul>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct CreateMembersFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::create_members::builders::CreateMembersInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44    crate::client::customize::internal::CustomizableSend<
45        crate::operation::create_members::CreateMembersOutput,
46        crate::operation::create_members::CreateMembersError,
47    > for CreateMembersFluentBuilder
48{
49    fn send(
50        self,
51        config_override: crate::config::Builder,
52    ) -> crate::client::customize::internal::BoxFuture<
53        crate::client::customize::internal::SendResult<
54            crate::operation::create_members::CreateMembersOutput,
55            crate::operation::create_members::CreateMembersError,
56        >,
57    > {
58        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59    }
60}
61impl CreateMembersFluentBuilder {
62    /// Creates a new `CreateMembersFluentBuilder`.
63    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64        Self {
65            handle,
66            inner: ::std::default::Default::default(),
67            config_override: ::std::option::Option::None,
68        }
69    }
70    /// Access the CreateMembers as a reference.
71    pub fn as_input(&self) -> &crate::operation::create_members::builders::CreateMembersInputBuilder {
72        &self.inner
73    }
74    /// Sends the request and returns the response.
75    ///
76    /// If an error occurs, an `SdkError` will be returned with additional details that
77    /// can be matched against.
78    ///
79    /// By default, any retryable failures will be retried twice. Retry behavior
80    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81    /// set when configuring the client.
82    pub async fn send(
83        self,
84    ) -> ::std::result::Result<
85        crate::operation::create_members::CreateMembersOutput,
86        ::aws_smithy_runtime_api::client::result::SdkError<
87            crate::operation::create_members::CreateMembersError,
88            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89        >,
90    > {
91        let input = self
92            .inner
93            .build()
94            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95        let runtime_plugins = crate::operation::create_members::CreateMembers::operation_runtime_plugins(
96            self.handle.runtime_plugins.clone(),
97            &self.handle.conf,
98            self.config_override,
99        );
100        crate::operation::create_members::CreateMembers::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::create_members::CreateMembersOutput,
108        crate::operation::create_members::CreateMembersError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    /// <p>The ARN of the behavior graph.</p>
123    pub fn graph_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.graph_arn(input.into());
125        self
126    }
127    /// <p>The ARN of the behavior graph.</p>
128    pub fn set_graph_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_graph_arn(input);
130        self
131    }
132    /// <p>The ARN of the behavior graph.</p>
133    pub fn get_graph_arn(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_graph_arn()
135    }
136    /// <p>Customized message text to include in the invitation email message to the invited member accounts.</p>
137    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.message(input.into());
139        self
140    }
141    /// <p>Customized message text to include in the invitation email message to the invited member accounts.</p>
142    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_message(input);
144        self
145    }
146    /// <p>Customized message text to include in the invitation email message to the invited member accounts.</p>
147    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_message()
149    }
150    /// <p>if set to <code>true</code>, then the invited accounts do not receive email notifications. By default, this is set to <code>false</code>, and the invited accounts receive email notifications.</p>
151    /// <p>Organization accounts in the organization behavior graph do not receive email notifications.</p>
152    pub fn disable_email_notification(mut self, input: bool) -> Self {
153        self.inner = self.inner.disable_email_notification(input);
154        self
155    }
156    /// <p>if set to <code>true</code>, then the invited accounts do not receive email notifications. By default, this is set to <code>false</code>, and the invited accounts receive email notifications.</p>
157    /// <p>Organization accounts in the organization behavior graph do not receive email notifications.</p>
158    pub fn set_disable_email_notification(mut self, input: ::std::option::Option<bool>) -> Self {
159        self.inner = self.inner.set_disable_email_notification(input);
160        self
161    }
162    /// <p>if set to <code>true</code>, then the invited accounts do not receive email notifications. By default, this is set to <code>false</code>, and the invited accounts receive email notifications.</p>
163    /// <p>Organization accounts in the organization behavior graph do not receive email notifications.</p>
164    pub fn get_disable_email_notification(&self) -> &::std::option::Option<bool> {
165        self.inner.get_disable_email_notification()
166    }
167    ///
168    /// Appends an item to `Accounts`.
169    ///
170    /// To override the contents of this collection use [`set_accounts`](Self::set_accounts).
171    ///
172    /// <p>The list of Amazon Web Services accounts to invite or to enable. You can invite or enable up to 50 accounts at a time. For each invited account, the account list contains the account identifier and the Amazon Web Services account root user email address. For organization accounts in the organization behavior graph, the email address is not required.</p>
173    pub fn accounts(mut self, input: crate::types::Account) -> Self {
174        self.inner = self.inner.accounts(input);
175        self
176    }
177    /// <p>The list of Amazon Web Services accounts to invite or to enable. You can invite or enable up to 50 accounts at a time. For each invited account, the account list contains the account identifier and the Amazon Web Services account root user email address. For organization accounts in the organization behavior graph, the email address is not required.</p>
178    pub fn set_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Account>>) -> Self {
179        self.inner = self.inner.set_accounts(input);
180        self
181    }
182    /// <p>The list of Amazon Web Services accounts to invite or to enable. You can invite or enable up to 50 accounts at a time. For each invited account, the account list contains the account identifier and the Amazon Web Services account root user email address. For organization accounts in the organization behavior graph, the email address is not required.</p>
183    pub fn get_accounts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Account>> {
184        self.inner.get_accounts()
185    }
186}