Class ResponseType

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.apigateway.ResponseType
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:46.685Z") @Stability(Stable) public class ResponseType extends software.amazon.jsii.JsiiObject
Supported types of gateway responses.

Example:

 RestApi api = new RestApi(this, "books-api");
 api.addGatewayResponse("test-response", GatewayResponseOptions.builder()
         .type(ResponseType.ACCESS_DENIED)
         .statusCode("500")
         .responseHeaders(Map.of(
                 // Note that values must be enclosed within a pair of single quotes
                 "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());
 

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ResponseType
    The gateway response for authorization failure.
    static final ResponseType
    The gateway response for an invalid API configuration.
    static final ResponseType
    The gateway response for failing to connect to a custom or Amazon Cognito authorizer.
    static final ResponseType
    The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller.
    static final ResponseType
    The gateway response when the request body cannot be validated according to an enabled request validator.
    static final ResponseType
    The gateway response when the request parameter cannot be validated according to an enabled request validator.
    static final ResponseType
    The default gateway response for an unspecified response type with the status code of 4XX.
    static final ResponseType
    The default gateway response for an unspecified response type with a status code of 5XX.
    static final ResponseType
    The gateway response for an AWS authentication token expired error.
    static final ResponseType
    The gateway response for an integration failed error.
    static final ResponseType
    The gateway response for an integration timed out error.
    static final ResponseType
    The gateway response for an invalid API key submitted for a method requiring an API key.
    static final ResponseType
    The gateway response for an invalid AWS signature error.
    static final ResponseType
    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 final ResponseType
    The gateway response for the usage plan quota exceeded error.
    static final ResponseType
    The gateway response for the request too large error.
    static final ResponseType
    The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization.
    static final ResponseType
    The gateway response when usage plan, method, stage, or account level throttling limits exceeded.
    static final ResponseType
    The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.
    static final ResponseType
    The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled.
    static final ResponseType
    The gateway response when a request is blocked by AWS WAF.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ResponseType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ResponseType(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Valid value of response type.
    of(String type)
    A custom response type to support future cases.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • ACCESS_DENIED

      @Stability(Stable) public static final ResponseType ACCESS_DENIED
      The gateway response for authorization failure.
    • API_CONFIGURATION_ERROR

      @Stability(Stable) public static final ResponseType API_CONFIGURATION_ERROR
      The gateway response for an invalid API configuration.
    • AUTHORIZER_CONFIGURATION_ERROR

      @Stability(Stable) public static final ResponseType AUTHORIZER_CONFIGURATION_ERROR
      The gateway response for failing to connect to a custom or Amazon Cognito authorizer.
    • AUTHORIZER_FAILURE

      @Stability(Stable) public static final ResponseType AUTHORIZER_FAILURE
      The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller.
    • BAD_REQUEST_BODY

      @Stability(Stable) public static final ResponseType BAD_REQUEST_BODY
      The gateway response when the request body cannot be validated according to an enabled request validator.
    • BAD_REQUEST_PARAMETERS

      @Stability(Stable) public static final ResponseType BAD_REQUEST_PARAMETERS
      The gateway response when the request parameter cannot be validated according to an enabled request validator.
    • DEFAULT_4_XX

      @Stability(Stable) public static final ResponseType DEFAULT_4_XX
      The default gateway response for an unspecified response type with the status code of 4XX.
    • DEFAULT_5_XX

      @Stability(Stable) public static final ResponseType DEFAULT_5_XX
      The default gateway response for an unspecified response type with a status code of 5XX.
    • EXPIRED_TOKEN

      @Stability(Stable) public static final ResponseType EXPIRED_TOKEN
      The gateway response for an AWS authentication token expired error.
    • INTEGRATION_FAILURE

      @Stability(Stable) public static final ResponseType INTEGRATION_FAILURE
      The gateway response for an integration failed error.
    • INTEGRATION_TIMEOUT

      @Stability(Stable) public static final ResponseType INTEGRATION_TIMEOUT
      The gateway response for an integration timed out error.
    • INVALID_API_KEY

      @Stability(Stable) public static final ResponseType INVALID_API_KEY
      The gateway response for an invalid API key submitted for a method requiring an API key.
    • INVALID_SIGNATURE

      @Stability(Stable) public static final ResponseType INVALID_SIGNATURE
      The gateway response for an invalid AWS signature error.
    • MISSING_AUTHENTICATION_TOKEN

      @Stability(Stable) public static final 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.
    • QUOTA_EXCEEDED

      @Stability(Stable) public static final ResponseType QUOTA_EXCEEDED
      The gateway response for the usage plan quota exceeded error.
    • REQUEST_TOO_LARGE

      @Stability(Stable) public static final ResponseType REQUEST_TOO_LARGE
      The gateway response for the request too large error.
    • RESOURCE_NOT_FOUND

      @Stability(Stable) public static final ResponseType RESOURCE_NOT_FOUND
      The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization.
    • THROTTLED

      @Stability(Stable) public static final ResponseType THROTTLED
      The gateway response when usage plan, method, stage, or account level throttling limits exceeded.
    • UNAUTHORIZED

      @Stability(Stable) public static final ResponseType UNAUTHORIZED
      The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.
    • UNSUPPORTED_MEDIA_TYPE

      @Stability(Stable) public static final ResponseType UNSUPPORTED_MEDIA_TYPE
      The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled.
    • WAF_FILTERED

      @Stability(Stable) public static final ResponseType WAF_FILTERED
      The gateway response when a request is blocked by AWS WAF.
  • Constructor Details

    • ResponseType

      protected ResponseType(software.amazon.jsii.JsiiObjectRef objRef)
    • ResponseType

      protected ResponseType(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • of

      @Stability(Stable) @NotNull public static ResponseType of(@NotNull String type)
      A custom response type to support future cases.

      Parameters:
      type - This parameter is required.
    • getResponseType

      @Stability(Stable) @NotNull public String getResponseType()
      Valid value of response type.