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 Details

    • 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 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.

      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 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.
      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 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.

      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 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.

      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 the CustomHTTPHeader.Builder avoiding the need to create one manually via CustomHTTPHeader.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to responseHeaders(List<CustomHTTPHeader>).

      Parameters:
      responseHeaders - a consumer that will call methods on CustomHTTPHeader.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: