/* * 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.cloudfront.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* A complex type that controls: *
** Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning * the response to the viewer. *
** How long CloudFront caches HTTP status codes in the 4xx and 5xx range. *
** For more information about custom error pages, see Customizing Error * Responses in the Amazon CloudFront Developer Guide. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CustomErrorResponses implements Serializable, Cloneable { /** *
* The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If
* Quantity
is 0
, you can omit Items
.
*
* A complex type that contains a CustomErrorResponse
element for each HTTP status code for which you
* want to specify a custom error page and/or a caching duration.
*
* The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If
* Quantity
is 0
, you can omit Items
.
*
Quantity
is 0
, you can omit Items
.
*/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
/**
*
* The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If
* Quantity
is 0
, you can omit Items
.
*
Quantity
is 0
, you can omit Items
.
*/
public Integer getQuantity() {
return this.quantity;
}
/**
*
* The number of HTTP status codes for which you want to specify a custom error page and/or a caching duration. If
* Quantity
is 0
, you can omit Items
.
*
Quantity
is 0
, you can omit Items
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomErrorResponses withQuantity(Integer quantity) {
setQuantity(quantity);
return this;
}
/**
*
* A complex type that contains a CustomErrorResponse
element for each HTTP status code for which you
* want to specify a custom error page and/or a caching duration.
*
CustomErrorResponse
element for each HTTP status code for
* which you want to specify a custom error page and/or a caching duration.
*/
public java.util.List
* A complex type that contains a CustomErrorResponse
element for each HTTP status code for which you
* want to specify a custom error page and/or a caching duration.
*
CustomErrorResponse
element for each HTTP status code for
* which you want to specify a custom error page and/or a caching duration.
*/
public void setItems(java.util.Collection
* A complex type that contains a CustomErrorResponse
element for each HTTP status code for which you
* want to specify a custom error page and/or a caching duration.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setItems(java.util.Collection)} or {@link #withItems(java.util.Collection)} if you want to override the * existing values. *
* * @param items * A complex type that contains aCustomErrorResponse
element for each HTTP status code for
* which you want to specify a custom error page and/or a caching duration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomErrorResponses withItems(CustomErrorResponse... items) {
if (this.items == null) {
setItems(new com.amazonaws.internal.SdkInternalList
* A complex type that contains a CustomErrorResponse
element for each HTTP status code for which you
* want to specify a custom error page and/or a caching duration.
*
CustomErrorResponse
element for each HTTP status code for
* which you want to specify a custom error page and/or a caching duration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CustomErrorResponses withItems(java.util.Collection