Interface CustomResponse.Builder
-
- All Superinterfaces:
Buildable,CopyableBuilder<CustomResponse.Builder,CustomResponse>,SdkBuilder<CustomResponse.Builder,CustomResponse>,SdkPojo
- Enclosing class:
- CustomResponse
public static interface CustomResponse.Builder extends SdkPojo, CopyableBuilder<CustomResponse.Builder,CustomResponse>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CustomResponse.BuildercustomResponseBodyKey(String customResponseBodyKey)References the response body that you want WAF to return to the web request client.CustomResponse.BuilderresponseCode(Integer responseCode)The HTTP status code to return to the client.CustomResponse.BuilderresponseHeaders(Collection<CustomHTTPHeader> responseHeaders)The HTTP headers to use in the response.CustomResponse.BuilderresponseHeaders(Consumer<CustomHTTPHeader.Builder>... responseHeaders)The HTTP headers to use in the response.CustomResponse.BuilderresponseHeaders(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, sdkFieldNameToField, sdkFields
-
-
-
-
Method Detail
-
responseCode
CustomResponse.Builder responseCode(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.
- 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
CustomResponse.Builder customResponseBodyKey(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
CustomResponseBodiessetting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default actionBlockActionsetting, 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 theCustomResponseBodiessetting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default actionBlockActionsetting, you reference the response body using this key.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
responseHeaders
CustomResponse.Builder responseHeaders(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.
- 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
CustomResponse.Builder responseHeaders(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.
- 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
CustomResponse.Builder responseHeaders(Consumer<CustomHTTPHeader.Builder>... 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.Builderavoiding the need to create one manually viaCustomHTTPHeader.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed to#responseHeaders(List.) - 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:
#responseHeaders(java.util.Collection)
-
-