aws_sdk_waf/operation/update_sql_injection_match_set/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_sql_injection_match_set::_update_sql_injection_match_set_output::UpdateSqlInjectionMatchSetOutputBuilder;
3
4pub use crate::operation::update_sql_injection_match_set::_update_sql_injection_match_set_input::UpdateSqlInjectionMatchSetInputBuilder;
5
6impl crate::operation::update_sql_injection_match_set::builders::UpdateSqlInjectionMatchSetInputBuilder {
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_sql_injection_match_set::UpdateSqlInjectionMatchSetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_sql_injection_match_set();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateSqlInjectionMatchSet`.
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>SqlInjectionMatchTuple</code> objects (filters) in a <code>SqlInjectionMatchSet</code>. For each <code>SqlInjectionMatchTuple</code> object, you specify the following values:</p>
30/// <ul>
31/// <li>
32/// <p><code>Action</code>: Whether to insert the object into or delete the object from the array. To change a <code>SqlInjectionMatchTuple</code>, you delete the existing object and add a new one.</p></li>
33/// <li>
34/// <p><code>FieldToMatch</code>: The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header or custom query parameter, the name of the header or parameter.</p></li>
35/// <li>
36/// <p><code>TextTransformation</code>: Which text transformation, if any, to perform on the web request before inspecting the request for snippets of malicious SQL code.</p>
37/// <p>You can only specify a single type of TextTransformation.</p></li>
38/// </ul>
39/// <p>You use <code>SqlInjectionMatchSet</code> objects to specify which CloudFront requests that you want to allow, block, or count. For example, if you're receiving requests that contain snippets of SQL code in the query string and you want to block the requests, you can create a <code>SqlInjectionMatchSet</code> with the applicable settings, and then configure AWS WAF to block the requests.</p>
40/// <p>To create and configure a <code>SqlInjectionMatchSet</code>, perform the following steps:</p>
41/// <ol>
42/// <li>
43/// <p>Submit a <code>CreateSqlInjectionMatchSet</code> request.</p></li>
44/// <li>
45/// <p>Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code> parameter of an <code>UpdateIPSet</code> request.</p></li>
46/// <li>
47/// <p>Submit an <code>UpdateSqlInjectionMatchSet</code> request to specify the parts of web requests that you want AWS WAF to inspect for snippets of SQL code.</p></li>
48/// </ol>
49/// <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>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct UpdateSqlInjectionMatchSetFluentBuilder {
52 handle: ::std::sync::Arc<crate::client::Handle>,
53 inner: crate::operation::update_sql_injection_match_set::builders::UpdateSqlInjectionMatchSetInputBuilder,
54 config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57 crate::client::customize::internal::CustomizableSend<
58 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetOutput,
59 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetError,
60 > for UpdateSqlInjectionMatchSetFluentBuilder
61{
62 fn send(
63 self,
64 config_override: crate::config::Builder,
65 ) -> crate::client::customize::internal::BoxFuture<
66 crate::client::customize::internal::SendResult<
67 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetOutput,
68 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetError,
69 >,
70 > {
71 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72 }
73}
74impl UpdateSqlInjectionMatchSetFluentBuilder {
75 /// Creates a new `UpdateSqlInjectionMatchSetFluentBuilder`.
76 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
77 Self {
78 handle,
79 inner: ::std::default::Default::default(),
80 config_override: ::std::option::Option::None,
81 }
82 }
83 /// Access the UpdateSqlInjectionMatchSet as a reference.
84 pub fn as_input(&self) -> &crate::operation::update_sql_injection_match_set::builders::UpdateSqlInjectionMatchSetInputBuilder {
85 &self.inner
86 }
87 /// Sends the request and returns the response.
88 ///
89 /// If an error occurs, an `SdkError` will be returned with additional details that
90 /// can be matched against.
91 ///
92 /// By default, any retryable failures will be retried twice. Retry behavior
93 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
94 /// set when configuring the client.
95 pub async fn send(
96 self,
97 ) -> ::std::result::Result<
98 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetOutput,
99 ::aws_smithy_runtime_api::client::result::SdkError<
100 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetError,
101 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
102 >,
103 > {
104 let input = self
105 .inner
106 .build()
107 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
108 let runtime_plugins = crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSet::operation_runtime_plugins(
109 self.handle.runtime_plugins.clone(),
110 &self.handle.conf,
111 self.config_override,
112 );
113 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSet::orchestrate(&runtime_plugins, input).await
114 }
115
116 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
117 pub fn customize(
118 self,
119 ) -> crate::client::customize::CustomizableOperation<
120 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetOutput,
121 crate::operation::update_sql_injection_match_set::UpdateSqlInjectionMatchSetError,
122 Self,
123 > {
124 crate::client::customize::CustomizableOperation::new(self)
125 }
126 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
127 self.set_config_override(::std::option::Option::Some(config_override.into()));
128 self
129 }
130
131 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
132 self.config_override = config_override;
133 self
134 }
135 /// <p>The <code>SqlInjectionMatchSetId</code> of the <code>SqlInjectionMatchSet</code> that you want to update. <code>SqlInjectionMatchSetId</code> is returned by <code>CreateSqlInjectionMatchSet</code> and by <code>ListSqlInjectionMatchSets</code>.</p>
136 pub fn sql_injection_match_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.sql_injection_match_set_id(input.into());
138 self
139 }
140 /// <p>The <code>SqlInjectionMatchSetId</code> of the <code>SqlInjectionMatchSet</code> that you want to update. <code>SqlInjectionMatchSetId</code> is returned by <code>CreateSqlInjectionMatchSet</code> and by <code>ListSqlInjectionMatchSets</code>.</p>
141 pub fn set_sql_injection_match_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_sql_injection_match_set_id(input);
143 self
144 }
145 /// <p>The <code>SqlInjectionMatchSetId</code> of the <code>SqlInjectionMatchSet</code> that you want to update. <code>SqlInjectionMatchSetId</code> is returned by <code>CreateSqlInjectionMatchSet</code> and by <code>ListSqlInjectionMatchSets</code>.</p>
146 pub fn get_sql_injection_match_set_id(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_sql_injection_match_set_id()
148 }
149 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
150 pub fn change_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.change_token(input.into());
152 self
153 }
154 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
155 pub fn set_change_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.inner = self.inner.set_change_token(input);
157 self
158 }
159 /// <p>The value returned by the most recent call to <code>GetChangeToken</code>.</p>
160 pub fn get_change_token(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_change_token()
162 }
163 ///
164 /// Appends an item to `Updates`.
165 ///
166 /// To override the contents of this collection use [`set_updates`](Self::set_updates).
167 ///
168 /// <p>An array of <code>SqlInjectionMatchSetUpdate</code> objects that you want to insert into or delete from a <code>SqlInjectionMatchSet</code>. For more information, see the applicable data types:</p>
169 /// <ul>
170 /// <li>
171 /// <p><code>SqlInjectionMatchSetUpdate</code>: Contains <code>Action</code> and <code>SqlInjectionMatchTuple</code></p></li>
172 /// <li>
173 /// <p><code>SqlInjectionMatchTuple</code>: Contains <code>FieldToMatch</code> and <code>TextTransformation</code></p></li>
174 /// <li>
175 /// <p><code>FieldToMatch</code>: Contains <code>Data</code> and <code>Type</code></p></li>
176 /// </ul>
177 pub fn updates(mut self, input: crate::types::SqlInjectionMatchSetUpdate) -> Self {
178 self.inner = self.inner.updates(input);
179 self
180 }
181 /// <p>An array of <code>SqlInjectionMatchSetUpdate</code> objects that you want to insert into or delete from a <code>SqlInjectionMatchSet</code>. For more information, see the applicable data types:</p>
182 /// <ul>
183 /// <li>
184 /// <p><code>SqlInjectionMatchSetUpdate</code>: Contains <code>Action</code> and <code>SqlInjectionMatchTuple</code></p></li>
185 /// <li>
186 /// <p><code>SqlInjectionMatchTuple</code>: Contains <code>FieldToMatch</code> and <code>TextTransformation</code></p></li>
187 /// <li>
188 /// <p><code>FieldToMatch</code>: Contains <code>Data</code> and <code>Type</code></p></li>
189 /// </ul>
190 pub fn set_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SqlInjectionMatchSetUpdate>>) -> Self {
191 self.inner = self.inner.set_updates(input);
192 self
193 }
194 /// <p>An array of <code>SqlInjectionMatchSetUpdate</code> objects that you want to insert into or delete from a <code>SqlInjectionMatchSet</code>. For more information, see the applicable data types:</p>
195 /// <ul>
196 /// <li>
197 /// <p><code>SqlInjectionMatchSetUpdate</code>: Contains <code>Action</code> and <code>SqlInjectionMatchTuple</code></p></li>
198 /// <li>
199 /// <p><code>SqlInjectionMatchTuple</code>: Contains <code>FieldToMatch</code> and <code>TextTransformation</code></p></li>
200 /// <li>
201 /// <p><code>FieldToMatch</code>: Contains <code>Data</code> and <code>Type</code></p></li>
202 /// </ul>
203 pub fn get_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SqlInjectionMatchSetUpdate>> {
204 self.inner.get_updates()
205 }
206}