@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.208Z") @Stability(value=Stable) 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 |
|---|---|
String |
getResponseType()
Valid value of response type.
|
static ResponseType |
of(String type)
A custom response type to support future cases.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final ResponseType ACCESS_DENIED
@Stability(value=Stable) public static final ResponseType API_CONFIGURATION_ERROR
@Stability(value=Stable) public static final ResponseType AUTHORIZER_CONFIGURATION_ERROR
@Stability(value=Stable) public static final ResponseType AUTHORIZER_FAILURE
@Stability(value=Stable) public static final ResponseType BAD_REQUEST_BODY
@Stability(value=Stable) public static final ResponseType BAD_REQUEST_PARAMETERS
@Stability(value=Stable) public static final ResponseType DEFAULT_4_XX
@Stability(value=Stable) public static final ResponseType DEFAULT_5_XX
@Stability(value=Stable) public static final ResponseType EXPIRED_TOKEN
@Stability(value=Stable) public static final ResponseType INTEGRATION_FAILURE
@Stability(value=Stable) public static final ResponseType INTEGRATION_TIMEOUT
@Stability(value=Stable) public static final ResponseType INVALID_API_KEY
@Stability(value=Stable) public static final ResponseType INVALID_SIGNATURE
@Stability(value=Stable) public static final ResponseType MISSING_AUTHENTICATION_TOKEN
@Stability(value=Stable) public static final ResponseType QUOTA_EXCEEDED
@Stability(value=Stable) public static final ResponseType REQUEST_TOO_LARGE
@Stability(value=Stable) public static final ResponseType RESOURCE_NOT_FOUND
@Stability(value=Stable) public static final ResponseType THROTTLED
@Stability(value=Stable) public static final ResponseType UNAUTHORIZED
@Stability(value=Stable) public static final ResponseType UNSUPPORTED_MEDIA_TYPE
@Stability(value=Stable) public static final ResponseType WAF_FILTERED
protected ResponseType(software.amazon.jsii.JsiiObjectRef objRef)
protected ResponseType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static ResponseType of(@NotNull String type)
type - This parameter is required.@Stability(value=Stable) @NotNull public String getResponseType()
Copyright © 2022. All rights reserved.