aws_sdk_guardduty/operation/create_trusted_entity_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_trusted_entity_set::_create_trusted_entity_set_output::CreateTrustedEntitySetOutputBuilder;
3
4pub use crate::operation::create_trusted_entity_set::_create_trusted_entity_set_input::CreateTrustedEntitySetInputBuilder;
5
6impl crate::operation::create_trusted_entity_set::builders::CreateTrustedEntitySetInputBuilder {
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_trusted_entity_set::CreateTrustedEntitySetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_trusted_entity_set::CreateTrustedEntitySetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_trusted_entity_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTrustedEntitySet`.
24///
25/// <p>Creates a new trusted entity set. In the trusted entity set, you can provide IP addresses and domains that you believe are secure for communication in your Amazon Web Services environment. GuardDuty will not generate findings for the entries that are specified in a trusted entity set. At any given time, you can have only one trusted entity set.</p>
26/// <p>Only users of the administrator account can manage the entity sets, which automatically apply to member accounts.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateTrustedEntitySetFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_trusted_entity_set::builders::CreateTrustedEntitySetInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_trusted_entity_set::CreateTrustedEntitySetOutput,
36        crate::operation::create_trusted_entity_set::CreateTrustedEntitySetError,
37    > for CreateTrustedEntitySetFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_trusted_entity_set::CreateTrustedEntitySetOutput,
45            crate::operation::create_trusted_entity_set::CreateTrustedEntitySetError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateTrustedEntitySetFluentBuilder {
52    /// Creates a new `CreateTrustedEntitySetFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateTrustedEntitySet as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_trusted_entity_set::builders::CreateTrustedEntitySetInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_trusted_entity_set::CreateTrustedEntitySetOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_trusted_entity_set::CreateTrustedEntitySetError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_trusted_entity_set::CreateTrustedEntitySet::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_trusted_entity_set::CreateTrustedEntitySet::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_trusted_entity_set::CreateTrustedEntitySetOutput,
98        crate::operation::create_trusted_entity_set::CreateTrustedEntitySetError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The unique ID of the detector of the GuardDuty account for which you want to create a trusted entity set.</p>
113    /// <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>
114    pub fn detector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.detector_id(input.into());
116        self
117    }
118    /// <p>The unique ID of the detector of the GuardDuty account for which you want to create a trusted entity set.</p>
119    /// <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>
120    pub fn set_detector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_detector_id(input);
122        self
123    }
124    /// <p>The unique ID of the detector of the GuardDuty account for which you want to create a trusted entity set.</p>
125    /// <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>
126    pub fn get_detector_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_detector_id()
128    }
129    /// <p>A user-friendly name to identify the trusted entity set.</p>
130    /// <p>The name of your list can include lowercase letters, uppercase letters, numbers, dash (-), and underscore (_).</p>
131    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.name(input.into());
133        self
134    }
135    /// <p>A user-friendly name to identify the trusted entity set.</p>
136    /// <p>The name of your list can include lowercase letters, uppercase letters, numbers, dash (-), and underscore (_).</p>
137    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_name(input);
139        self
140    }
141    /// <p>A user-friendly name to identify the trusted entity set.</p>
142    /// <p>The name of your list can include lowercase letters, uppercase letters, numbers, dash (-), and underscore (_).</p>
143    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_name()
145    }
146    /// <p>The format of the file that contains the trusted entity set.</p>
147    pub fn format(mut self, input: crate::types::TrustedEntitySetFormat) -> Self {
148        self.inner = self.inner.format(input);
149        self
150    }
151    /// <p>The format of the file that contains the trusted entity set.</p>
152    pub fn set_format(mut self, input: ::std::option::Option<crate::types::TrustedEntitySetFormat>) -> Self {
153        self.inner = self.inner.set_format(input);
154        self
155    }
156    /// <p>The format of the file that contains the trusted entity set.</p>
157    pub fn get_format(&self) -> &::std::option::Option<crate::types::TrustedEntitySetFormat> {
158        self.inner.get_format()
159    }
160    /// <p>The URI of the file that contains the threat entity set. The format of the <code>Location</code> URL must be a valid Amazon S3 URL format. Invalid URL formats will result in an error, regardless of whether you activate the entity set or not. For more information about format of the location URLs, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html">Format of location URL under Step 2: Adding trusted or threat intelligence data</a> in the <i>Amazon GuardDuty User Guide</i>.</p>
161    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.location(input.into());
163        self
164    }
165    /// <p>The URI of the file that contains the threat entity set. The format of the <code>Location</code> URL must be a valid Amazon S3 URL format. Invalid URL formats will result in an error, regardless of whether you activate the entity set or not. For more information about format of the location URLs, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html">Format of location URL under Step 2: Adding trusted or threat intelligence data</a> in the <i>Amazon GuardDuty User Guide</i>.</p>
166    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_location(input);
168        self
169    }
170    /// <p>The URI of the file that contains the threat entity set. The format of the <code>Location</code> URL must be a valid Amazon S3 URL format. Invalid URL formats will result in an error, regardless of whether you activate the entity set or not. For more information about format of the location URLs, see <a href="https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html">Format of location URL under Step 2: Adding trusted or threat intelligence data</a> in the <i>Amazon GuardDuty User Guide</i>.</p>
171    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_location()
173    }
174    /// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket specified in the <b>location</b> parameter.</p>
175    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.expected_bucket_owner(input.into());
177        self
178    }
179    /// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket specified in the <b>location</b> parameter.</p>
180    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_expected_bucket_owner(input);
182        self
183    }
184    /// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket specified in the <b>location</b> parameter.</p>
185    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_expected_bucket_owner()
187    }
188    /// <p>A boolean value that indicates whether GuardDuty is to start using the uploaded trusted entity set.</p>
189    pub fn activate(mut self, input: bool) -> Self {
190        self.inner = self.inner.activate(input);
191        self
192    }
193    /// <p>A boolean value that indicates whether GuardDuty is to start using the uploaded trusted entity set.</p>
194    pub fn set_activate(mut self, input: ::std::option::Option<bool>) -> Self {
195        self.inner = self.inner.set_activate(input);
196        self
197    }
198    /// <p>A boolean value that indicates whether GuardDuty is to start using the uploaded trusted entity set.</p>
199    pub fn get_activate(&self) -> &::std::option::Option<bool> {
200        self.inner.get_activate()
201    }
202    /// <p>The idempotency token for the create request.</p>
203    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.client_token(input.into());
205        self
206    }
207    /// <p>The idempotency token for the create request.</p>
208    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_client_token(input);
210        self
211    }
212    /// <p>The idempotency token for the create request.</p>
213    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_client_token()
215    }
216    ///
217    /// Adds a key-value pair to `Tags`.
218    ///
219    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
220    ///
221    /// <p>The tags to be added to a new trusted entity set resource.</p>
222    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.tags(k.into(), v.into());
224        self
225    }
226    /// <p>The tags to be added to a new trusted entity set resource.</p>
227    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
228        self.inner = self.inner.set_tags(input);
229        self
230    }
231    /// <p>The tags to be added to a new trusted entity set resource.</p>
232    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
233        self.inner.get_tags()
234    }
235}