@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)",
date="2022-08-17T17:31:19.171Z")
public class ResponseType
extends software.amazon.jsii.JsiiObject
Example:
RestApi api = new RestApi(this, "books-api"); api.addGatewayResponse("test-response", GatewayResponseOptions.builder() .type(ResponseType.ACCESS_DENIED) .statusCode("500") .responseHeaders(Map.of( "Access-Control-Allow-Origin", "test.com", "test-key", "test-value")) .templates(Map.of( "application/json", "{ \"message\": $context.error.messageString, \"statusCode\": \"488\", \"type\": \"$context.error.responseType\" }")) .build());
Modifier and Type | Field and Description |
---|---|
static ResponseType |
ACCESS_DENIED
The gateway response for authorization failure.
|
static ResponseType |
API_CONFIGURATION_ERROR
The gateway response for an invalid API configuration.
|
static ResponseType |
AUTHORIZER_CONFIGURATION_ERROR
The gateway response for failing to connect to a custom or Amazon Cognito authorizer.
|
static ResponseType |
AUTHORIZER_FAILURE
The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller.
|
static ResponseType |
BAD_REQUEST_BODY
The gateway response when the request body cannot be validated according to an enabled request validator.
|
static ResponseType |
BAD_REQUEST_PARAMETERS
The gateway response when the request parameter cannot be validated according to an enabled request validator.
|
static ResponseType |
DEFAULT_4_XX
The default gateway response for an unspecified response type with the status code of 4XX.
|
static ResponseType |
DEFAULT_5_XX
The default gateway response for an unspecified response type with a status code of 5XX.
|
static ResponseType |
EXPIRED_TOKEN
The gateway response for an AWS authentication token expired error.
|
static ResponseType |
INTEGRATION_FAILURE
The gateway response for an integration failed error.
|
static ResponseType |
INTEGRATION_TIMEOUT
The gateway response for an integration timed out error.
|
static ResponseType |
INVALID_API_KEY
The gateway response for an invalid API key submitted for a method requiring an API key.
|
static ResponseType |
INVALID_SIGNATURE
The gateway response for an invalid AWS signature error.
|
static ResponseType |
MISSING_AUTHENTICATION_TOKEN
The gateway response for a missing authentication token error, including the cases when the client attempts to invoke an unsupported API method or resource.
|
static ResponseType |
QUOTA_EXCEEDED
The gateway response for the usage plan quota exceeded error.
|
static ResponseType |
REQUEST_TOO_LARGE
The gateway response for the request too large error.
|
static ResponseType |
RESOURCE_NOT_FOUND
The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization.
|
static ResponseType |
THROTTLED
The gateway response when usage plan, method, stage, or account level throttling limits exceeded.
|
static ResponseType |
UNAUTHORIZED
The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.
|
static ResponseType |
UNSUPPORTED_MEDIA_TYPE
The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled.
|
static ResponseType |
WAF_FILTERED
The gateway response when a request is blocked by AWS WAF.
|
Modifier | Constructor and Description |
---|---|
protected |
ResponseType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ResponseType(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getResponseType()
Valid value of response type.
|
static ResponseType |
of(java.lang.String type)
A custom response type to support future cases.
|
public static final ResponseType ACCESS_DENIED
public static final ResponseType API_CONFIGURATION_ERROR
public static final ResponseType AUTHORIZER_CONFIGURATION_ERROR
public static final ResponseType AUTHORIZER_FAILURE
public static final ResponseType BAD_REQUEST_BODY
public static final ResponseType BAD_REQUEST_PARAMETERS
public static final ResponseType DEFAULT_4_XX
public static final ResponseType DEFAULT_5_XX
public static final ResponseType EXPIRED_TOKEN
public static final ResponseType INTEGRATION_FAILURE
public static final ResponseType INTEGRATION_TIMEOUT
public static final ResponseType INVALID_API_KEY
public static final ResponseType INVALID_SIGNATURE
public static final ResponseType MISSING_AUTHENTICATION_TOKEN
public static final ResponseType QUOTA_EXCEEDED
public static final ResponseType REQUEST_TOO_LARGE
public static final ResponseType RESOURCE_NOT_FOUND
public static final ResponseType THROTTLED
public static final ResponseType UNAUTHORIZED
public static final ResponseType UNSUPPORTED_MEDIA_TYPE
public static final ResponseType WAF_FILTERED
protected ResponseType(software.amazon.jsii.JsiiObjectRef objRef)
protected ResponseType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static ResponseType of(java.lang.String type)
type
- This parameter is required.public java.lang.String getResponseType()