Table of Contents

Class ResponseType_

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll

Supported types of gateway responses.

public class ResponseType_ : DeputyBase
Inheritance
ResponseType_

Examples

var api = new RestApi(this, "books-api");
             api.AddGatewayResponse("test-response", new GatewayResponseOptions {
                 Type = ResponseType.ACCESS_DENIED,
                 StatusCode = "500",
                 ResponseHeaders = new Dictionary<string, string> {
                     { "Access-Control-Allow-Origin", "test.com" },
                     { "test-key", "test-value" }
                 },
                 Templates = new Dictionary<string, string> {
                     { "application/json", "{ \"message\": $context.error.messageString, \"statusCode\": \"488\", \"type\": \"$context.error.responseType\" }" }
                 }
             });

Remarks

Properties

ACCESS_DENIED

The gateway response for authorization failure.

public static ResponseType_ ACCESS_DENIED { get; }

Property Value

ResponseType_

API_CONFIGURATION_ERROR

The gateway response for an invalid API configuration.

public static ResponseType_ API_CONFIGURATION_ERROR { get; }

Property Value

ResponseType_

AUTHORIZER_CONFIGURATION_ERROR

The gateway response for failing to connect to a custom or Amazon Cognito authorizer.

public static ResponseType_ AUTHORIZER_CONFIGURATION_ERROR { get; }

Property Value

ResponseType_

AUTHORIZER_FAILURE

The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller.

public static ResponseType_ AUTHORIZER_FAILURE { get; }

Property Value

ResponseType_

BAD_REQUEST_BODY

The gateway response when the request body cannot be validated according to an enabled request validator.

public static ResponseType_ BAD_REQUEST_BODY { get; }

Property Value

ResponseType_

BAD_REQUEST_PARAMETERS

The gateway response when the request parameter cannot be validated according to an enabled request validator.

public static ResponseType_ BAD_REQUEST_PARAMETERS { get; }

Property Value

ResponseType_

DEFAULT_4XX

The default gateway response for an unspecified response type with the status code of 4XX.

public static ResponseType_ DEFAULT_4XX { get; }

Property Value

ResponseType_

DEFAULT_5XX

The default gateway response for an unspecified response type with a status code of 5XX.

public static ResponseType_ DEFAULT_5XX { get; }

Property Value

ResponseType_

EXPIRED_TOKEN

The gateway response for an AWS authentication token expired error.

public static ResponseType_ EXPIRED_TOKEN { get; }

Property Value

ResponseType_

INTEGRATION_FAILURE

The gateway response for an integration failed error.

public static ResponseType_ INTEGRATION_FAILURE { get; }

Property Value

ResponseType_

INTEGRATION_TIMEOUT

The gateway response for an integration timed out error.

public static ResponseType_ INTEGRATION_TIMEOUT { get; }

Property Value

ResponseType_

INVALID_API_KEY

The gateway response for an invalid API key submitted for a method requiring an API key.

public static ResponseType_ INVALID_API_KEY { get; }

Property Value

ResponseType_

INVALID_SIGNATURE

The gateway response for an invalid AWS signature error.

public static ResponseType_ INVALID_SIGNATURE { get; }

Property Value

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.

public static ResponseType_ MISSING_AUTHENTICATION_TOKEN { get; }

Property Value

ResponseType_

QUOTA_EXCEEDED

The gateway response for the usage plan quota exceeded error.

public static ResponseType_ QUOTA_EXCEEDED { get; }

Property Value

ResponseType_

REQUEST_TOO_LARGE

The gateway response for the request too large error.

public static ResponseType_ REQUEST_TOO_LARGE { get; }

Property Value

ResponseType_

RESOURCE_NOT_FOUND

The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization.

public static ResponseType_ RESOURCE_NOT_FOUND { get; }

Property Value

ResponseType_

ResponseType

Valid value of response type.

public virtual string ResponseType { get; }

Property Value

string

THROTTLED

The gateway response when usage plan, method, stage, or account level throttling limits exceeded.

public static ResponseType_ THROTTLED { get; }

Property Value

ResponseType_

UNAUTHORIZED

The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.

public static ResponseType_ UNAUTHORIZED { get; }

Property Value

ResponseType_

UNSUPPORTED_MEDIA_TYPE

The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled.

public static ResponseType_ UNSUPPORTED_MEDIA_TYPE { get; }

Property Value

ResponseType_

WAF_FILTERED

The gateway response when a request is blocked by AWS WAF.

public static ResponseType_ WAF_FILTERED { get; }

Property Value

ResponseType_

Methods

Of(string)

A custom response type to support future cases.

public static ResponseType_ Of(string type)

Parameters

type string

Returns

ResponseType_