Interface CustomResponse.Builder
- All Superinterfaces:
Buildable
,CopyableBuilder<CustomResponse.Builder,
,CustomResponse> SdkBuilder<CustomResponse.Builder,
,CustomResponse> SdkPojo
- Enclosing class:
CustomResponse
-
Method Summary
Modifier and TypeMethodDescriptioncustomResponseBodyKey
(String customResponseBodyKey) References the response body that you want WAF to return to the web request client.responseCode
(Integer responseCode) The HTTP status code to return to the client.responseHeaders
(Collection<CustomHTTPHeader> responseHeaders) The HTTP headers to use in the response.responseHeaders
(Consumer<CustomHTTPHeader.Builder>... responseHeaders) The HTTP headers to use in the response.responseHeaders
(CustomHTTPHeader... responseHeaders) The HTTP headers to use in the response.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
Method Details
-
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.
- Parameters:
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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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 actionBlockAction
setting, you reference the response body using this key.- Parameters:
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 theCustomResponseBodies
setting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default actionBlockAction
setting, you reference the response body using this key.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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.
- Parameters:
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except forcontent-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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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.
- Parameters:
responseHeaders
- The HTTP headers to use in the response. You can specify any header name except forcontent-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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
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.
This is a convenience method that creates an instance of theCustomHTTPHeader.Builder
avoiding the need to create one manually viaCustomHTTPHeader.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toresponseHeaders(List<CustomHTTPHeader>)
.- Parameters:
responseHeaders
- a consumer that will call methods onCustomHTTPHeader.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-