aws_sdk_waf/operation/update_regex_match_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_regex_match_set::_update_regex_match_set_output::UpdateRegexMatchSetOutputBuilder;
3
4pub use crate::operation::update_regex_match_set::_update_regex_match_set_input::UpdateRegexMatchSetInputBuilder;
5
6impl crate::operation::update_regex_match_set::builders::UpdateRegexMatchSetInputBuilder {
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::update_regex_match_set::UpdateRegexMatchSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_regex_match_set::UpdateRegexMatchSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_regex_match_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateRegexMatchSet`.
24///
25/// <note>
26/// <p>This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS WAF Classic</a> in the developer guide.</p>
27/// <p><b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints for regional and global use.</p>
28/// </note>
29/// <p>Inserts or deletes <code>RegexMatchTuple</code> objects (filters) in a <code>RegexMatchSet</code>. For each <code>RegexMatchSetUpdate</code> object, you specify the following values:</p>
30/// <ul>
31/// <li>
32/// <p>Whether to insert or delete the object from the array. If you want to change a <code>RegexMatchSetUpdate</code> object, you delete the existing object and add a new one.</p></li>
33/// <li>
34/// <p>The part of a web request that you want AWS WAF to inspectupdate, such as a query string or the value of the <code>User-Agent</code> header.</p></li>
35/// <li>
36/// <p>The identifier of the pattern (a regular expression) that you want AWS WAF to look for. For more information, see <code>RegexPatternSet</code>.</p></li>
37/// <li>
38/// <p>Whether to perform any conversions on the request, such as converting it to lowercase, before inspecting it for the specified string.</p></li>
39/// </ul>
40/// <p>For example, you can create a <code>RegexPatternSet</code> that matches any requests with <code>User-Agent</code> headers that contain the string <code>B\[a@\]dB\[o0\]t</code>. You can then configure AWS WAF to reject those requests.</p>
41/// <p>To create and configure a <code>RegexMatchSet</code>, perform the following steps:</p>
42/// <ol>
43/// <li>
44/// <p>Create a <code>RegexMatchSet.</code> For more information, see <code>CreateRegexMatchSet</code>.</p></li>
45/// <li>
46/// <p>Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> parameter of an <code>UpdateRegexMatchSet</code> request.</p></li>
47/// <li>
48/// <p>Submit an <code>UpdateRegexMatchSet</code> request to specify the part of the request that you want AWS WAF to inspect (for example, the header or the URI) and the identifier of the <code>RegexPatternSet</code> that contain the regular expression patters you want AWS WAF to watch for.</p></li>
49/// </ol>
50/// <p>For more information about how to use the AWS WAF API to allow or block HTTP requests, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer Guide</a>.</p>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct UpdateRegexMatchSetFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::update_regex_match_set::builders::UpdateRegexMatchSetInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::update_regex_match_set::UpdateRegexMatchSetOutput,
60        crate::operation::update_regex_match_set::UpdateRegexMatchSetError,
61    > for UpdateRegexMatchSetFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::update_regex_match_set::UpdateRegexMatchSetOutput,
69            crate::operation::update_regex_match_set::UpdateRegexMatchSetError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl UpdateRegexMatchSetFluentBuilder {
76    /// Creates a new `UpdateRegexMatchSetFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the UpdateRegexMatchSet as a reference.
85    pub fn as_input(&self) -> &crate::operation::update_regex_match_set::builders::UpdateRegexMatchSetInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::update_regex_match_set::UpdateRegexMatchSetOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::update_regex_match_set::UpdateRegexMatchSetError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::update_regex_match_set::UpdateRegexMatchSet::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::update_regex_match_set::UpdateRegexMatchSet::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::update_regex_match_set::UpdateRegexMatchSetOutput,
122        crate::operation::update_regex_match_set::UpdateRegexMatchSetError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The <code>RegexMatchSetId</code> of the <code>RegexMatchSet</code> that you want to update. <code>RegexMatchSetId</code> is returned by <code>CreateRegexMatchSet</code> and by <code>ListRegexMatchSets</code>.</p>
137    pub fn regex_match_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.regex_match_set_id(input.into());
139        self
140    }
141    /// <p>The <code>RegexMatchSetId</code> of the <code>RegexMatchSet</code> that you want to update. <code>RegexMatchSetId</code> is returned by <code>CreateRegexMatchSet</code> and by <code>ListRegexMatchSets</code>.</p>
142    pub fn set_regex_match_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_regex_match_set_id(input);
144        self
145    }
146    /// <p>The <code>RegexMatchSetId</code> of the <code>RegexMatchSet</code> that you want to update. <code>RegexMatchSetId</code> is returned by <code>CreateRegexMatchSet</code> and by <code>ListRegexMatchSets</code>.</p>
147    pub fn get_regex_match_set_id(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_regex_match_set_id()
149    }
150    ///
151    /// Appends an item to `Updates`.
152    ///
153    /// To override the contents of this collection use [`set_updates`](Self::set_updates).
154    ///
155    /// <p>An array of <code>RegexMatchSetUpdate</code> objects that you want to insert into or delete from a <code>RegexMatchSet</code>. For more information, see <code>RegexMatchTuple</code>.</p>
156    pub fn updates(mut self, input: crate::types::RegexMatchSetUpdate) -> Self {
157        self.inner = self.inner.updates(input);
158        self
159    }
160    /// <p>An array of <code>RegexMatchSetUpdate</code> objects that you want to insert into or delete from a <code>RegexMatchSet</code>. For more information, see <code>RegexMatchTuple</code>.</p>
161    pub fn set_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RegexMatchSetUpdate>>) -> Self {
162        self.inner = self.inner.set_updates(input);
163        self
164    }
165    /// <p>An array of <code>RegexMatchSetUpdate</code> objects that you want to insert into or delete from a <code>RegexMatchSet</code>. For more information, see <code>RegexMatchTuple</code>.</p>
166    pub fn get_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RegexMatchSetUpdate>> {
167        self.inner.get_updates()
168    }
169    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
170    pub fn change_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.change_token(input.into());
172        self
173    }
174    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
175    pub fn set_change_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_change_token(input);
177        self
178    }
179    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
180    pub fn get_change_token(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_change_token()
182    }
183}