/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.wafv2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Inspect all headers in the web request. You can specify the parts of the headers to inspect and you can narrow the * set of headers to inspect by including or excluding specific keys. *

*

* This is used to indicate the web request component to inspect, in the FieldToMatch specification. *

*

* If you want to inspect just the value of a single header, use the SingleHeader FieldToMatch * setting instead. *

*

* Example JSON: * "Headers": { "MatchPattern": { "All": {} }, "MatchScope": "KEY", "OversizeHandling": "MATCH" } *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Headers implements Serializable, Cloneable, StructuredPojo { /** *

* The filter to use to identify the subset of headers to inspect in a web request. *

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } *

*/ private HeaderMatchPattern matchPattern; /** *

* The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. *

*/ private String matchScope; /** *

* What WAF should do if the headers of the request are more numerous or larger than WAF can inspect. WAF does not * support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or 200 total * headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of header contents to * WAF. *

*

* The options for oversize handling are the following: *

* */ private String oversizeHandling; /** *

* The filter to use to identify the subset of headers to inspect in a web request. *

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } *

* * @param matchPattern * The filter to use to identify the subset of headers to inspect in a web request.

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } */ public void setMatchPattern(HeaderMatchPattern matchPattern) { this.matchPattern = matchPattern; } /** *

* The filter to use to identify the subset of headers to inspect in a web request. *

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } *

* * @return The filter to use to identify the subset of headers to inspect in a web request.

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } */ public HeaderMatchPattern getMatchPattern() { return this.matchPattern; } /** *

* The filter to use to identify the subset of headers to inspect in a web request. *

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } *

* * @param matchPattern * The filter to use to identify the subset of headers to inspect in a web request.

*

* You must specify exactly one setting: either All, IncludedHeaders, or * ExcludedHeaders. *

*

* Example JSON: "MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] } * @return Returns a reference to this object so that method calls can be chained together. */ public Headers withMatchPattern(HeaderMatchPattern matchPattern) { setMatchPattern(matchPattern); return this; } /** *

* The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. *

* * @param matchScope * The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. * @see MapMatchScope */ public void setMatchScope(String matchScope) { this.matchScope = matchScope; } /** *

* The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. *

* * @return The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. * @see MapMatchScope */ public String getMatchScope() { return this.matchScope; } /** *

* The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. *

* * @param matchScope * The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. * @return Returns a reference to this object so that method calls can be chained together. * @see MapMatchScope */ public Headers withMatchScope(String matchScope) { setMatchScope(matchScope); return this; } /** *

* The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. *

* * @param matchScope * The parts of the headers to match with the rule inspection criteria. If you specify All, WAF * inspects both keys and values. * @return Returns a reference to this object so that method calls can be chained together. * @see MapMatchScope */ public Headers withMatchScope(MapMatchScope matchScope) { this.matchScope = matchScope.toString(); return this; } /** *

* What WAF should do if the headers of the request are more numerous or larger than WAF can inspect. WAF does not * support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or 200 total * headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of header contents to * WAF. *

*

* The options for oversize handling are the following: *

* * * @param oversizeHandling * What WAF should do if the headers of the request are more numerous or larger than WAF can inspect. WAF * does not support inspecting the entire contents of request headers when they exceed 8 KB (8192 bytes) or * 200 total headers. The underlying host service forwards a maximum of 200 headers and at most 8 KB of * header contents to WAF.

*

* The options for oversize handling are the following: *

*