Class ErrorResponse.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.ErrorResponse.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ErrorResponse>
- Enclosing interface:
ErrorResponse
@Stability(Stable)
public static final class ErrorResponse.Builder
extends Object
implements software.amazon.jsii.Builder<ErrorResponse>
A builder for
ErrorResponse-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured instance.httpStatus(Number httpStatus) Sets the value ofErrorResponse.getHttpStatus()responseHttpStatus(Number responseHttpStatus) Sets the value ofErrorResponse.getResponseHttpStatus()responsePagePath(String responsePagePath) Sets the value ofErrorResponse.getResponsePagePath()Sets the value ofErrorResponse.getTtl()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpStatus
Sets the value ofErrorResponse.getHttpStatus()- Parameters:
httpStatus- The HTTP status code for which you want to specify a custom error page and/or a caching duration. This parameter is required.- Returns:
this
-
responseHttpStatus
Sets the value ofErrorResponse.getResponseHttpStatus()- Parameters:
responseHttpStatus- The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. If you specify a value forresponseHttpStatus, you must also specify a value forresponsePagePath.- Returns:
this
-
responsePagePath
Sets the value ofErrorResponse.getResponsePagePath()- Parameters:
responsePagePath- The path to the custom error page that you want CloudFront to return to a viewer when your origin returns thehttpStatus, for example, /4xx-errors/403-forbidden.html.- Returns:
this
-
ttl
Sets the value ofErrorResponse.getTtl()- Parameters:
ttl- The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ErrorResponse>- Returns:
- a new instance of
ErrorResponse - Throws:
NullPointerException- if any required attribute was not provided
-