1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <note>
/// <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>
/// <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>
/// </note>
/// <p>Specifies the part of a web request that you want AWS WAF to inspect for cross-site scripting attacks and, if you want AWS WAF to inspect a header, the name of the header.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct XssMatchTuple {
    /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
    pub field_to_match: ::std::option::Option<crate::types::FieldToMatch>,
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
    /// <p>You can only specify a single type of TextTransformation.</p>
    /// <p><b>CMD_LINE</b></p>
    /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
    /// <ul>
    /// <li>
    /// <p>Delete the following characters: \ " ' ^</p></li>
    /// <li>
    /// <p>Delete spaces before the following characters: / (</p></li>
    /// <li>
    /// <p>Replace the following characters with a space: , ;</p></li>
    /// <li>
    /// <p>Replace multiple spaces with one space</p></li>
    /// <li>
    /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
    /// </ul>
    /// <p><b>COMPRESS_WHITE_SPACE</b></p>
    /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
    /// <ul>
    /// <li>
    /// <p>\f, formfeed, decimal 12</p></li>
    /// <li>
    /// <p>\t, tab, decimal 9</p></li>
    /// <li>
    /// <p>\n, newline, decimal 10</p></li>
    /// <li>
    /// <p>\r, carriage return, decimal 13</p></li>
    /// <li>
    /// <p>\v, vertical tab, decimal 11</p></li>
    /// <li>
    /// <p>non-breaking space, decimal 160</p></li>
    /// </ul>
    /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
    /// <p><b>HTML_ENTITY_DECODE</b></p>
    /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
    /// <ul>
    /// <li>
    /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)gt;</code> with <code>&gt;</code></p></li>
    /// <li>
    /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
    /// <li>
    /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
    /// </ul>
    /// <p><b>LOWERCASE</b></p>
    /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
    /// <p><b>URL_DECODE</b></p>
    /// <p>Use this option to decode a URL-encoded value.</p>
    /// <p><b>NONE</b></p>
    /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
    pub text_transformation: crate::types::TextTransformation,
}
impl XssMatchTuple {
    /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
    pub fn field_to_match(&self) -> ::std::option::Option<&crate::types::FieldToMatch> {
        self.field_to_match.as_ref()
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
    /// <p>You can only specify a single type of TextTransformation.</p>
    /// <p><b>CMD_LINE</b></p>
    /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
    /// <ul>
    /// <li>
    /// <p>Delete the following characters: \ " ' ^</p></li>
    /// <li>
    /// <p>Delete spaces before the following characters: / (</p></li>
    /// <li>
    /// <p>Replace the following characters with a space: , ;</p></li>
    /// <li>
    /// <p>Replace multiple spaces with one space</p></li>
    /// <li>
    /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
    /// </ul>
    /// <p><b>COMPRESS_WHITE_SPACE</b></p>
    /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
    /// <ul>
    /// <li>
    /// <p>\f, formfeed, decimal 12</p></li>
    /// <li>
    /// <p>\t, tab, decimal 9</p></li>
    /// <li>
    /// <p>\n, newline, decimal 10</p></li>
    /// <li>
    /// <p>\r, carriage return, decimal 13</p></li>
    /// <li>
    /// <p>\v, vertical tab, decimal 11</p></li>
    /// <li>
    /// <p>non-breaking space, decimal 160</p></li>
    /// </ul>
    /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
    /// <p><b>HTML_ENTITY_DECODE</b></p>
    /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
    /// <ul>
    /// <li>
    /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)gt;</code> with <code>&gt;</code></p></li>
    /// <li>
    /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
    /// <li>
    /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
    /// </ul>
    /// <p><b>LOWERCASE</b></p>
    /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
    /// <p><b>URL_DECODE</b></p>
    /// <p>Use this option to decode a URL-encoded value.</p>
    /// <p><b>NONE</b></p>
    /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
    pub fn text_transformation(&self) -> &crate::types::TextTransformation {
        &self.text_transformation
    }
}
impl XssMatchTuple {
    /// Creates a new builder-style object to manufacture [`XssMatchTuple`](crate::types::XssMatchTuple).
    pub fn builder() -> crate::types::builders::XssMatchTupleBuilder {
        crate::types::builders::XssMatchTupleBuilder::default()
    }
}

/// A builder for [`XssMatchTuple`](crate::types::XssMatchTuple).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct XssMatchTupleBuilder {
    pub(crate) field_to_match: ::std::option::Option<crate::types::FieldToMatch>,
    pub(crate) text_transformation: ::std::option::Option<crate::types::TextTransformation>,
}
impl XssMatchTupleBuilder {
    /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
    /// This field is required.
    pub fn field_to_match(mut self, input: crate::types::FieldToMatch) -> Self {
        self.field_to_match = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
    pub fn set_field_to_match(mut self, input: ::std::option::Option<crate::types::FieldToMatch>) -> Self {
        self.field_to_match = input;
        self
    }
    /// <p>Specifies where in a web request to look for cross-site scripting attacks.</p>
    pub fn get_field_to_match(&self) -> &::std::option::Option<crate::types::FieldToMatch> {
        &self.field_to_match
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
    /// <p>You can only specify a single type of TextTransformation.</p>
    /// <p><b>CMD_LINE</b></p>
    /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
    /// <ul>
    /// <li>
    /// <p>Delete the following characters: \ " ' ^</p></li>
    /// <li>
    /// <p>Delete spaces before the following characters: / (</p></li>
    /// <li>
    /// <p>Replace the following characters with a space: , ;</p></li>
    /// <li>
    /// <p>Replace multiple spaces with one space</p></li>
    /// <li>
    /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
    /// </ul>
    /// <p><b>COMPRESS_WHITE_SPACE</b></p>
    /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
    /// <ul>
    /// <li>
    /// <p>\f, formfeed, decimal 12</p></li>
    /// <li>
    /// <p>\t, tab, decimal 9</p></li>
    /// <li>
    /// <p>\n, newline, decimal 10</p></li>
    /// <li>
    /// <p>\r, carriage return, decimal 13</p></li>
    /// <li>
    /// <p>\v, vertical tab, decimal 11</p></li>
    /// <li>
    /// <p>non-breaking space, decimal 160</p></li>
    /// </ul>
    /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
    /// <p><b>HTML_ENTITY_DECODE</b></p>
    /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
    /// <ul>
    /// <li>
    /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)gt;</code> with <code>&gt;</code></p></li>
    /// <li>
    /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
    /// <li>
    /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
    /// </ul>
    /// <p><b>LOWERCASE</b></p>
    /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
    /// <p><b>URL_DECODE</b></p>
    /// <p>Use this option to decode a URL-encoded value.</p>
    /// <p><b>NONE</b></p>
    /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
    /// This field is required.
    pub fn text_transformation(mut self, input: crate::types::TextTransformation) -> Self {
        self.text_transformation = ::std::option::Option::Some(input);
        self
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
    /// <p>You can only specify a single type of TextTransformation.</p>
    /// <p><b>CMD_LINE</b></p>
    /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
    /// <ul>
    /// <li>
    /// <p>Delete the following characters: \ " ' ^</p></li>
    /// <li>
    /// <p>Delete spaces before the following characters: / (</p></li>
    /// <li>
    /// <p>Replace the following characters with a space: , ;</p></li>
    /// <li>
    /// <p>Replace multiple spaces with one space</p></li>
    /// <li>
    /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
    /// </ul>
    /// <p><b>COMPRESS_WHITE_SPACE</b></p>
    /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
    /// <ul>
    /// <li>
    /// <p>\f, formfeed, decimal 12</p></li>
    /// <li>
    /// <p>\t, tab, decimal 9</p></li>
    /// <li>
    /// <p>\n, newline, decimal 10</p></li>
    /// <li>
    /// <p>\r, carriage return, decimal 13</p></li>
    /// <li>
    /// <p>\v, vertical tab, decimal 11</p></li>
    /// <li>
    /// <p>non-breaking space, decimal 160</p></li>
    /// </ul>
    /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
    /// <p><b>HTML_ENTITY_DECODE</b></p>
    /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
    /// <ul>
    /// <li>
    /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)gt;</code> with <code>&gt;</code></p></li>
    /// <li>
    /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
    /// <li>
    /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
    /// </ul>
    /// <p><b>LOWERCASE</b></p>
    /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
    /// <p><b>URL_DECODE</b></p>
    /// <p>Use this option to decode a URL-encoded value.</p>
    /// <p><b>NONE</b></p>
    /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
    pub fn set_text_transformation(mut self, input: ::std::option::Option<crate::types::TextTransformation>) -> Self {
        self.text_transformation = input;
        self
    }
    /// <p>Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass AWS WAF. If you specify a transformation, AWS WAF performs the transformation on <code>FieldToMatch</code> before inspecting it for a match.</p>
    /// <p>You can only specify a single type of TextTransformation.</p>
    /// <p><b>CMD_LINE</b></p>
    /// <p>When you're concerned that attackers are injecting an operating system command line command and using unusual formatting to disguise some or all of the command, use this option to perform the following transformations:</p>
    /// <ul>
    /// <li>
    /// <p>Delete the following characters: \ " ' ^</p></li>
    /// <li>
    /// <p>Delete spaces before the following characters: / (</p></li>
    /// <li>
    /// <p>Replace the following characters with a space: , ;</p></li>
    /// <li>
    /// <p>Replace multiple spaces with one space</p></li>
    /// <li>
    /// <p>Convert uppercase letters (A-Z) to lowercase (a-z)</p></li>
    /// </ul>
    /// <p><b>COMPRESS_WHITE_SPACE</b></p>
    /// <p>Use this option to replace the following characters with a space character (decimal 32):</p>
    /// <ul>
    /// <li>
    /// <p>\f, formfeed, decimal 12</p></li>
    /// <li>
    /// <p>\t, tab, decimal 9</p></li>
    /// <li>
    /// <p>\n, newline, decimal 10</p></li>
    /// <li>
    /// <p>\r, carriage return, decimal 13</p></li>
    /// <li>
    /// <p>\v, vertical tab, decimal 11</p></li>
    /// <li>
    /// <p>non-breaking space, decimal 160</p></li>
    /// </ul>
    /// <p><code>COMPRESS_WHITE_SPACE</code> also replaces multiple spaces with one space.</p>
    /// <p><b>HTML_ENTITY_DECODE</b></p>
    /// <p>Use this option to replace HTML-encoded characters with unencoded characters. <code>HTML_ENTITY_DECODE</code> performs the following operations:</p>
    /// <ul>
    /// <li>
    /// <p>Replaces <code>(ampersand)quot;</code> with <code>"</code></p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)nbsp;</code> with a non-breaking space, decimal 160</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)lt;</code> with a "less than" symbol</p></li>
    /// <li>
    /// <p>Replaces <code>(ampersand)gt;</code> with <code>&gt;</code></p></li>
    /// <li>
    /// <p>Replaces characters that are represented in hexadecimal format, <code>(ampersand)#xhhhh;</code>, with the corresponding characters</p></li>
    /// <li>
    /// <p>Replaces characters that are represented in decimal format, <code>(ampersand)#nnnn;</code>, with the corresponding characters</p></li>
    /// </ul>
    /// <p><b>LOWERCASE</b></p>
    /// <p>Use this option to convert uppercase letters (A-Z) to lowercase (a-z).</p>
    /// <p><b>URL_DECODE</b></p>
    /// <p>Use this option to decode a URL-encoded value.</p>
    /// <p><b>NONE</b></p>
    /// <p>Specify <code>NONE</code> if you don't want to perform any text transformations.</p>
    pub fn get_text_transformation(&self) -> &::std::option::Option<crate::types::TextTransformation> {
        &self.text_transformation
    }
    /// Consumes the builder and constructs a [`XssMatchTuple`](crate::types::XssMatchTuple).
    /// This method will fail if any of the following fields are not set:
    /// - [`text_transformation`](crate::types::builders::XssMatchTupleBuilder::text_transformation)
    pub fn build(self) -> ::std::result::Result<crate::types::XssMatchTuple, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::XssMatchTuple {
            field_to_match: self.field_to_match,
            text_transformation: self.text_transformation.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "text_transformation",
                    "text_transformation was not specified but it is required when building XssMatchTuple",
                )
            })?,
        })
    }
}