/* * 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.securityhub.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* 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 block. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsWafv2CustomResponseDetails implements Serializable, Cloneable, StructuredPojo { /** ** 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. *
*/ private String customResponseBodyKey; /** ** 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. *
*/ private Integer responseCode; /** ** The HTTP headers to use in the response. *
*/ private java.util.List* 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. *
* * @param 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. */ public void setCustomResponseBodyKey(String customResponseBodyKey) { this.customResponseBodyKey = 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. *
* * @return 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. */ public String getCustomResponseBodyKey() { return this.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. *
* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafv2CustomResponseDetails withCustomResponseBodyKey(String customResponseBodyKey) { setCustomResponseBodyKey(customResponseBodyKey); return this; } /** ** 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. *
* * @param 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 setResponseCode(Integer responseCode) { this.responseCode = 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. *
* * @return 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() { return this.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. *
* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafv2CustomResponseDetails withResponseCode(Integer responseCode) { setResponseCode(responseCode); return this; } /** ** The HTTP headers to use in the response. *
* * @return The HTTP headers to use in the response. */ public java.util.List* The HTTP headers to use in the response. *
* * @param responseHeaders * The HTTP headers to use in the response. */ public void setResponseHeaders(java.util.Collection* The HTTP headers to use in the response. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setResponseHeaders(java.util.Collection)} or {@link #withResponseHeaders(java.util.Collection)} if you * want to override the existing values. *
* * @param responseHeaders * The HTTP headers to use in the response. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafv2CustomResponseDetails withResponseHeaders(AwsWafv2CustomHttpHeader... responseHeaders) { if (this.responseHeaders == null) { setResponseHeaders(new java.util.ArrayList* The HTTP headers to use in the response. *
* * @param responseHeaders * The HTTP headers to use in the response. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsWafv2CustomResponseDetails withResponseHeaders(java.util.Collection