aws_sdk_wafv2/operation/get_rate_based_statement_managed_keys/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_rate_based_statement_managed_keys::_get_rate_based_statement_managed_keys_output::GetRateBasedStatementManagedKeysOutputBuilder;
3
4pub use crate::operation::get_rate_based_statement_managed_keys::_get_rate_based_statement_managed_keys_input::GetRateBasedStatementManagedKeysInputBuilder;
5
6impl crate::operation::get_rate_based_statement_managed_keys::builders::GetRateBasedStatementManagedKeysInputBuilder {
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::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_rate_based_statement_managed_keys();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetRateBasedStatementManagedKeys`.
24///
25/// <p>Retrieves the IP addresses that are currently blocked by a rate-based rule instance. This is only available for rate-based rules that aggregate solely on the IP address or on the forwarded IP address.</p>
26/// <p>The maximum number of addresses that can be blocked for a single rate-based rule instance is 10,000. If more than 10,000 addresses exceed the rate limit, those with the highest rates are blocked.</p>
27/// <p>For a rate-based rule that you've defined inside a rule group, provide the name of the rule group reference statement in your request, in addition to the rate-based rule name and the web ACL name.</p>
28/// <p>WAF monitors web requests and manages keys independently for each unique combination of web ACL, optional rule group, and rate-based rule. For example, if you define a rate-based rule inside a rule group, and then use the rule group in a web ACL, WAF monitors web requests and manages keys for that web ACL, rule group reference statement, and rate-based rule instance. If you use the same rule group in a second web ACL, WAF monitors web requests and manages keys for this second usage completely independent of your first.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct GetRateBasedStatementManagedKeysFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::get_rate_based_statement_managed_keys::builders::GetRateBasedStatementManagedKeysInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysOutput,
38        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysError,
39    > for GetRateBasedStatementManagedKeysFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysOutput,
47            crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl GetRateBasedStatementManagedKeysFluentBuilder {
54    /// Creates a new `GetRateBasedStatementManagedKeysFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the GetRateBasedStatementManagedKeys as a reference.
63    pub fn as_input(&self) -> &crate::operation::get_rate_based_statement_managed_keys::builders::GetRateBasedStatementManagedKeysInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeys::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeys::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysOutput,
100        crate::operation::get_rate_based_statement_managed_keys::GetRateBasedStatementManagedKeysError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
115    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
116    /// <ul>
117    /// <li>
118    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
119    /// <li>
120    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
121    /// </ul>
122    pub fn scope(mut self, input: crate::types::Scope) -> Self {
123        self.inner = self.inner.scope(input);
124        self
125    }
126    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
127    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
128    /// <ul>
129    /// <li>
130    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
131    /// <li>
132    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
133    /// </ul>
134    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
135        self.inner = self.inner.set_scope(input);
136        self
137    }
138    /// <p>Specifies whether this is for a global resource type, such as a Amazon CloudFront distribution. For an Amplify application, use <code>CLOUDFRONT</code>.</p>
139    /// <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p>
140    /// <ul>
141    /// <li>
142    /// <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li>
143    /// <li>
144    /// <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li>
145    /// </ul>
146    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
147        self.inner.get_scope()
148    }
149    /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
150    pub fn web_acl_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.web_acl_name(input.into());
152        self
153    }
154    /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
155    pub fn set_web_acl_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_web_acl_name(input);
157        self
158    }
159    /// <p>The name of the web ACL. You cannot change the name of a web ACL after you create it.</p>
160    pub fn get_web_acl_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_web_acl_name()
162    }
163    /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
164    pub fn web_acl_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.web_acl_id(input.into());
166        self
167    }
168    /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
169    pub fn set_web_acl_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_web_acl_id(input);
171        self
172    }
173    /// <p>The unique identifier for the web ACL. This ID is returned in the responses to create and list commands. You provide it to operations like update and delete.</p>
174    pub fn get_web_acl_id(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_web_acl_id()
176    }
177    /// <p>The name of the rule group reference statement in your web ACL. This is required only when you have the rate-based rule nested inside a rule group.</p>
178    pub fn rule_group_rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.rule_group_rule_name(input.into());
180        self
181    }
182    /// <p>The name of the rule group reference statement in your web ACL. This is required only when you have the rate-based rule nested inside a rule group.</p>
183    pub fn set_rule_group_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_rule_group_rule_name(input);
185        self
186    }
187    /// <p>The name of the rule group reference statement in your web ACL. This is required only when you have the rate-based rule nested inside a rule group.</p>
188    pub fn get_rule_group_rule_name(&self) -> &::std::option::Option<::std::string::String> {
189        self.inner.get_rule_group_rule_name()
190    }
191    /// <p>The name of the rate-based rule to get the keys for. If you have the rule defined inside a rule group that you're using in your web ACL, also provide the name of the rule group reference statement in the request parameter <code>RuleGroupRuleName</code>.</p>
192    pub fn rule_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.rule_name(input.into());
194        self
195    }
196    /// <p>The name of the rate-based rule to get the keys for. If you have the rule defined inside a rule group that you're using in your web ACL, also provide the name of the rule group reference statement in the request parameter <code>RuleGroupRuleName</code>.</p>
197    pub fn set_rule_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_rule_name(input);
199        self
200    }
201    /// <p>The name of the rate-based rule to get the keys for. If you have the rule defined inside a rule group that you're using in your web ACL, also provide the name of the rule group reference statement in the request parameter <code>RuleGroupRuleName</code>.</p>
202    pub fn get_rule_name(&self) -> &::std::option::Option<::std::string::String> {
203        self.inner.get_rule_name()
204    }
205}