@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class CustomResponse extends Object implements Serializable, Cloneable, StructuredPojo
A custom response to send to the client. You can define a custom response for rule actions and default web ACL actions that are set to BlockAction.
For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.
Constructor and Description |
---|
CustomResponse() |
Modifier and Type | Method and Description |
---|---|
CustomResponse |
clone() |
boolean |
equals(Object obj) |
String |
getCustomResponseBodyKey()
References the response body that you want WAF to return to the web request client.
|
Integer |
getResponseCode()
The HTTP status code to return to the client.
|
List<CustomHTTPHeader> |
getResponseHeaders()
The HTTP headers to use in the response.
|
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setCustomResponseBodyKey(String customResponseBodyKey)
References the response body that you want WAF to return to the web request client.
|
void |
setResponseCode(Integer responseCode)
The HTTP status code to return to the client.
|
void |
setResponseHeaders(Collection<CustomHTTPHeader> responseHeaders)
The HTTP headers to use in the response.
|
String |
toString()
Returns a string representation of this object.
|
CustomResponse |
withCustomResponseBodyKey(String customResponseBodyKey)
References the response body that you want WAF to return to the web request client.
|
CustomResponse |
withResponseCode(Integer responseCode)
The HTTP status code to return to the client.
|
CustomResponse |
withResponseHeaders(Collection<CustomHTTPHeader> responseHeaders)
The HTTP headers to use in the response.
|
CustomResponse |
withResponseHeaders(CustomHTTPHeader... responseHeaders)
The HTTP headers to use in the response.
|
public void setResponseCode(Integer responseCode)
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
responseCode
- The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
public Integer getResponseCode()
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
public CustomResponse withResponseCode(Integer responseCode)
The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
responseCode
- The HTTP status code to return to the client.
For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.
public void setCustomResponseBodyKey(String customResponseBodyKey)
References the response body that you want WAF to return to the web request client. You can define a custom
response for a rule action or a default web ACL action that is set to block. To do this, you first define the
response body key and value in the CustomResponseBodies
setting for the WebACL or
RuleGroup where you want to use it. Then, in the rule action or web ACL default action
BlockAction
setting, you reference the response body using this key.
customResponseBodyKey
- References the response body that you want WAF to return to the web request client. You can define a
custom response for a rule action or a default web ACL action that is set to block. To do this, you first
define the response body key and value in the CustomResponseBodies
setting for the
WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default
action BlockAction
setting, you reference the response body using this key.public String getCustomResponseBodyKey()
References the response body that you want WAF to return to the web request client. You can define a custom
response for a rule action or a default web ACL action that is set to block. To do this, you first define the
response body key and value in the CustomResponseBodies
setting for the WebACL or
RuleGroup where you want to use it. Then, in the rule action or web ACL default action
BlockAction
setting, you reference the response body using this key.
CustomResponseBodies
setting for the
WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default
action BlockAction
setting, you reference the response body using this key.public CustomResponse withCustomResponseBodyKey(String customResponseBodyKey)
References the response body that you want WAF to return to the web request client. You can define a custom
response for a rule action or a default web ACL action that is set to block. To do this, you first define the
response body key and value in the CustomResponseBodies
setting for the WebACL or
RuleGroup where you want to use it. Then, in the rule action or web ACL default action
BlockAction
setting, you reference the response body using this key.
customResponseBodyKey
- References the response body that you want WAF to return to the web request client. You can define a
custom response for a rule action or a default web ACL action that is set to block. To do this, you first
define the response body key and value in the CustomResponseBodies
setting for the
WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default
action BlockAction
setting, you reference the response body using this key.public List<CustomHTTPHeader> getResponseHeaders()
The HTTP headers to use in the response. You can specify any header name except for content-type
.
Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
public void setResponseHeaders(Collection<CustomHTTPHeader> responseHeaders)
The HTTP headers to use in the response. You can specify any header name except for content-type
.
Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except for
content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
public CustomResponse withResponseHeaders(CustomHTTPHeader... responseHeaders)
The HTTP headers to use in the response. You can specify any header name except for content-type
.
Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
NOTE: This method appends the values to the existing list (if any). Use
setResponseHeaders(java.util.Collection)
or withResponseHeaders(java.util.Collection)
if you
want to override the existing values.
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except for
content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
public CustomResponse withResponseHeaders(Collection<CustomHTTPHeader> responseHeaders)
The HTTP headers to use in the response. You can specify any header name except for content-type
.
Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except for
content-type
. Duplicate header names are not allowed.
For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.
public String toString()
toString
in class Object
Object.toString()
public CustomResponse clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.