aws_sdk_wafregional/operation/update_xss_match_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_xss_match_set::_update_xss_match_set_output::UpdateXssMatchSetOutputBuilder;
3
4pub use crate::operation::update_xss_match_set::_update_xss_match_set_input::UpdateXssMatchSetInputBuilder;
5
6impl crate::operation::update_xss_match_set::builders::UpdateXssMatchSetInputBuilder {
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_xss_match_set::UpdateXssMatchSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_xss_match_set::UpdateXssMatchSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_xss_match_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateXssMatchSet`.
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>XssMatchTuple</code> objects (filters) in an <code>XssMatchSet</code>. For each <code>XssMatchTuple</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 an <code>XssMatchTuple</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 cross-site scripting attacks.</p>
37/// <p>You can only specify a single type of TextTransformation.</p></li>
38/// </ul>
39/// <p>You use <code>XssMatchSet</code> objects to specify which CloudFront requests that you want to allow, block, or count. For example, if you're receiving requests that contain cross-site scripting attacks in the request body and you want to block the requests, you can create an <code>XssMatchSet</code> with the applicable settings, and then configure AWS WAF to block the requests.</p>
40/// <p>To create and configure an <code>XssMatchSet</code>, perform the following steps:</p>
41/// <ol>
42/// <li>
43/// <p>Submit a <code>CreateXssMatchSet</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>UpdateXssMatchSet</code> request to specify the parts of web requests that you want AWS WAF to inspect for cross-site scripting attacks.</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 UpdateXssMatchSetFluentBuilder {
52    handle: ::std::sync::Arc<crate::client::Handle>,
53    inner: crate::operation::update_xss_match_set::builders::UpdateXssMatchSetInputBuilder,
54    config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57    crate::client::customize::internal::CustomizableSend<
58        crate::operation::update_xss_match_set::UpdateXssMatchSetOutput,
59        crate::operation::update_xss_match_set::UpdateXssMatchSetError,
60    > for UpdateXssMatchSetFluentBuilder
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_xss_match_set::UpdateXssMatchSetOutput,
68            crate::operation::update_xss_match_set::UpdateXssMatchSetError,
69        >,
70    > {
71        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72    }
73}
74impl UpdateXssMatchSetFluentBuilder {
75    /// Creates a new `UpdateXssMatchSetFluentBuilder`.
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 UpdateXssMatchSet as a reference.
84    pub fn as_input(&self) -> &crate::operation::update_xss_match_set::builders::UpdateXssMatchSetInputBuilder {
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_xss_match_set::UpdateXssMatchSetOutput,
99        ::aws_smithy_runtime_api::client::result::SdkError<
100            crate::operation::update_xss_match_set::UpdateXssMatchSetError,
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_xss_match_set::UpdateXssMatchSet::operation_runtime_plugins(
109            self.handle.runtime_plugins.clone(),
110            &self.handle.conf,
111            self.config_override,
112        );
113        crate::operation::update_xss_match_set::UpdateXssMatchSet::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_xss_match_set::UpdateXssMatchSetOutput,
121        crate::operation::update_xss_match_set::UpdateXssMatchSetError,
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>XssMatchSetId</code> of the <code>XssMatchSet</code> that you want to update. <code>XssMatchSetId</code> is returned by <code>CreateXssMatchSet</code> and by <code>ListXssMatchSets</code>.</p>
136    pub fn xss_match_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.xss_match_set_id(input.into());
138        self
139    }
140    /// <p>The <code>XssMatchSetId</code> of the <code>XssMatchSet</code> that you want to update. <code>XssMatchSetId</code> is returned by <code>CreateXssMatchSet</code> and by <code>ListXssMatchSets</code>.</p>
141    pub fn set_xss_match_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_xss_match_set_id(input);
143        self
144    }
145    /// <p>The <code>XssMatchSetId</code> of the <code>XssMatchSet</code> that you want to update. <code>XssMatchSetId</code> is returned by <code>CreateXssMatchSet</code> and by <code>ListXssMatchSets</code>.</p>
146    pub fn get_xss_match_set_id(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_xss_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>XssMatchSetUpdate</code> objects that you want to insert into or delete from an <code>XssMatchSet</code>. For more information, see the applicable data types:</p>
169    /// <ul>
170    /// <li>
171    /// <p><code>XssMatchSetUpdate</code>: Contains <code>Action</code> and <code>XssMatchTuple</code></p></li>
172    /// <li>
173    /// <p><code>XssMatchTuple</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::XssMatchSetUpdate) -> Self {
178        self.inner = self.inner.updates(input);
179        self
180    }
181    /// <p>An array of <code>XssMatchSetUpdate</code> objects that you want to insert into or delete from an <code>XssMatchSet</code>. For more information, see the applicable data types:</p>
182    /// <ul>
183    /// <li>
184    /// <p><code>XssMatchSetUpdate</code>: Contains <code>Action</code> and <code>XssMatchTuple</code></p></li>
185    /// <li>
186    /// <p><code>XssMatchTuple</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::XssMatchSetUpdate>>) -> Self {
191        self.inner = self.inner.set_updates(input);
192        self
193    }
194    /// <p>An array of <code>XssMatchSetUpdate</code> objects that you want to insert into or delete from an <code>XssMatchSet</code>. For more information, see the applicable data types:</p>
195    /// <ul>
196    /// <li>
197    /// <p><code>XssMatchSetUpdate</code>: Contains <code>Action</code> and <code>XssMatchTuple</code></p></li>
198    /// <li>
199    /// <p><code>XssMatchTuple</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::XssMatchSetUpdate>> {
204        self.inner.get_updates()
205    }
206}