aws_sdk_waf/operation/update_regex_pattern_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_regex_pattern_set::_update_regex_pattern_set_output::UpdateRegexPatternSetOutputBuilder;
3
4pub use crate::operation::update_regex_pattern_set::_update_regex_pattern_set_input::UpdateRegexPatternSetInputBuilder;
5
6impl crate::operation::update_regex_pattern_set::builders::UpdateRegexPatternSetInputBuilder {
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_pattern_set::UpdateRegexPatternSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_regex_pattern_set::UpdateRegexPatternSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_regex_pattern_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateRegexPatternSet`.
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>RegexPatternString</code> objects in a <code>RegexPatternSet</code>. For each <code>RegexPatternString</code> object, you specify the following values:</p>
30/// <ul>
31/// <li>
32/// <p>Whether to insert or delete the <code>RegexPatternString</code>.</p></li>
33/// <li>
34/// <p>The regular expression pattern that you want to insert or delete. For more information, see <code>RegexPatternSet</code>.</p></li>
35/// </ul>
36/// <p>For example, you can create a <code>RegexPatternString</code> such as <code>B\[a@\]dB\[o0\]t</code>. AWS WAF will match this <code>RegexPatternString</code> to:</p>
37/// <ul>
38/// <li>
39/// <p>BadBot</p></li>
40/// <li>
41/// <p>BadB0t</p></li>
42/// <li>
43/// <p>B@dBot</p></li>
44/// <li>
45/// <p>B@dB0t</p></li>
46/// </ul>
47/// <p>To create and configure a <code>RegexPatternSet</code>, perform the following steps:</p>
48/// <ol>
49/// <li>
50/// <p>Create a <code>RegexPatternSet.</code> For more information, see <code>CreateRegexPatternSet</code>.</p></li>
51/// <li>
52/// <p>Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> parameter of an <code>UpdateRegexPatternSet</code> request.</p></li>
53/// <li>
54/// <p>Submit an <code>UpdateRegexPatternSet</code> request to specify the regular expression pattern that you want AWS WAF to watch for.</p></li>
55/// </ol>
56/// <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>
57#[derive(::std::clone::Clone, ::std::fmt::Debug)]
58pub struct UpdateRegexPatternSetFluentBuilder {
59    handle: ::std::sync::Arc<crate::client::Handle>,
60    inner: crate::operation::update_regex_pattern_set::builders::UpdateRegexPatternSetInputBuilder,
61    config_override: ::std::option::Option<crate::config::Builder>,
62}
63impl
64    crate::client::customize::internal::CustomizableSend<
65        crate::operation::update_regex_pattern_set::UpdateRegexPatternSetOutput,
66        crate::operation::update_regex_pattern_set::UpdateRegexPatternSetError,
67    > for UpdateRegexPatternSetFluentBuilder
68{
69    fn send(
70        self,
71        config_override: crate::config::Builder,
72    ) -> crate::client::customize::internal::BoxFuture<
73        crate::client::customize::internal::SendResult<
74            crate::operation::update_regex_pattern_set::UpdateRegexPatternSetOutput,
75            crate::operation::update_regex_pattern_set::UpdateRegexPatternSetError,
76        >,
77    > {
78        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
79    }
80}
81impl UpdateRegexPatternSetFluentBuilder {
82    /// Creates a new `UpdateRegexPatternSetFluentBuilder`.
83    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
84        Self {
85            handle,
86            inner: ::std::default::Default::default(),
87            config_override: ::std::option::Option::None,
88        }
89    }
90    /// Access the UpdateRegexPatternSet as a reference.
91    pub fn as_input(&self) -> &crate::operation::update_regex_pattern_set::builders::UpdateRegexPatternSetInputBuilder {
92        &self.inner
93    }
94    /// Sends the request and returns the response.
95    ///
96    /// If an error occurs, an `SdkError` will be returned with additional details that
97    /// can be matched against.
98    ///
99    /// By default, any retryable failures will be retried twice. Retry behavior
100    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
101    /// set when configuring the client.
102    pub async fn send(
103        self,
104    ) -> ::std::result::Result<
105        crate::operation::update_regex_pattern_set::UpdateRegexPatternSetOutput,
106        ::aws_smithy_runtime_api::client::result::SdkError<
107            crate::operation::update_regex_pattern_set::UpdateRegexPatternSetError,
108            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
109        >,
110    > {
111        let input = self
112            .inner
113            .build()
114            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
115        let runtime_plugins = crate::operation::update_regex_pattern_set::UpdateRegexPatternSet::operation_runtime_plugins(
116            self.handle.runtime_plugins.clone(),
117            &self.handle.conf,
118            self.config_override,
119        );
120        crate::operation::update_regex_pattern_set::UpdateRegexPatternSet::orchestrate(&runtime_plugins, input).await
121    }
122
123    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
124    pub fn customize(
125        self,
126    ) -> crate::client::customize::CustomizableOperation<
127        crate::operation::update_regex_pattern_set::UpdateRegexPatternSetOutput,
128        crate::operation::update_regex_pattern_set::UpdateRegexPatternSetError,
129        Self,
130    > {
131        crate::client::customize::CustomizableOperation::new(self)
132    }
133    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
134        self.set_config_override(::std::option::Option::Some(config_override.into()));
135        self
136    }
137
138    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
139        self.config_override = config_override;
140        self
141    }
142    /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
143    pub fn regex_pattern_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.regex_pattern_set_id(input.into());
145        self
146    }
147    /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
148    pub fn set_regex_pattern_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_regex_pattern_set_id(input);
150        self
151    }
152    /// <p>The <code>RegexPatternSetId</code> of the <code>RegexPatternSet</code> that you want to update. <code>RegexPatternSetId</code> is returned by <code>CreateRegexPatternSet</code> and by <code>ListRegexPatternSets</code>.</p>
153    pub fn get_regex_pattern_set_id(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_regex_pattern_set_id()
155    }
156    ///
157    /// Appends an item to `Updates`.
158    ///
159    /// To override the contents of this collection use [`set_updates`](Self::set_updates).
160    ///
161    /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
162    pub fn updates(mut self, input: crate::types::RegexPatternSetUpdate) -> Self {
163        self.inner = self.inner.updates(input);
164        self
165    }
166    /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
167    pub fn set_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>>) -> Self {
168        self.inner = self.inner.set_updates(input);
169        self
170    }
171    /// <p>An array of <code>RegexPatternSetUpdate</code> objects that you want to insert into or delete from a <code>RegexPatternSet</code>.</p>
172    pub fn get_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RegexPatternSetUpdate>> {
173        self.inner.get_updates()
174    }
175    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
176    pub fn change_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.change_token(input.into());
178        self
179    }
180    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
181    pub fn set_change_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_change_token(input);
183        self
184    }
185    /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
186    pub fn get_change_token(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_change_token()
188    }
189}