Class ResponseType_
Supported types of gateway responses.
Inheritance
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ResponseType_ : DeputyBase
Syntax (vb)
Public Class ResponseType_
Inherits DeputyBase
Remarks
See: https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html
ExampleMetadata: infused
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> {
// Note that values must be enclosed within a pair of single quotes
{ "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\" }" }
}
});
Synopsis
Constructors
ResponseType_(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ResponseType_(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
ACCESS_DENIED | The gateway response for authorization failure. |
API_CONFIGURATION_ERROR | The gateway response for an invalid API configuration. |
AUTHORIZER_CONFIGURATION_ERROR | The gateway response for failing to connect to a custom or Amazon Cognito authorizer. |
AUTHORIZER_FAILURE | The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller. |
BAD_REQUEST_BODY | The gateway response when the request body cannot be validated according to an enabled request validator. |
BAD_REQUEST_PARAMETERS | The gateway response when the request parameter cannot be validated according to an enabled request validator. |
DEFAULT_4XX | The default gateway response for an unspecified response type with the status code of 4XX. |
DEFAULT_5XX | The default gateway response for an unspecified response type with a status code of 5XX. |
EXPIRED_TOKEN | The gateway response for an AWS authentication token expired error. |
INTEGRATION_FAILURE | The gateway response for an integration failed error. |
INTEGRATION_TIMEOUT | The gateway response for an integration timed out error. |
INVALID_API_KEY | The gateway response for an invalid API key submitted for a method requiring an API key. |
INVALID_SIGNATURE | The gateway response for an invalid AWS signature error. |
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 | The gateway response for the usage plan quota exceeded error. |
REQUEST_TOO_LARGE | The gateway response for the request too large error. |
RESOURCE_NOT_FOUND | The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization. |
ResponseType | Valid value of response type. |
THROTTLED | The gateway response when usage plan, method, stage, or account level throttling limits exceeded. |
UNAUTHORIZED | The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller. |
UNSUPPORTED_MEDIA_TYPE | The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled. |
WAF_FILTERED | The gateway response when a request is blocked by AWS WAF. |
Methods
Of(String) | A custom response type to support future cases. |
Constructors
ResponseType_(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ResponseType_(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ResponseType_(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ResponseType_(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
ACCESS_DENIED
The gateway response for authorization failure.
public static ResponseType_ ACCESS_DENIED { get; }
Property Value
API_CONFIGURATION_ERROR
The gateway response for an invalid API configuration.
public static ResponseType_ API_CONFIGURATION_ERROR { get; }
Property Value
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
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
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
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
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
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
EXPIRED_TOKEN
The gateway response for an AWS authentication token expired error.
public static ResponseType_ EXPIRED_TOKEN { get; }
Property Value
INTEGRATION_FAILURE
The gateway response for an integration failed error.
public static ResponseType_ INTEGRATION_FAILURE { get; }
Property Value
INTEGRATION_TIMEOUT
The gateway response for an integration timed out error.
public static ResponseType_ INTEGRATION_TIMEOUT { get; }
Property Value
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
INVALID_SIGNATURE
The gateway response for an invalid AWS signature error.
public static ResponseType_ INVALID_SIGNATURE { get; }
Property Value
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
QUOTA_EXCEEDED
The gateway response for the usage plan quota exceeded error.
public static ResponseType_ QUOTA_EXCEEDED { get; }
Property Value
REQUEST_TOO_LARGE
The gateway response for the request too large error.
public static ResponseType_ REQUEST_TOO_LARGE { get; }
Property Value
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
Valid value of response type.
public virtual string ResponseType { get; }
Property Value
System.String
THROTTLED
The gateway response when usage plan, method, stage, or account level throttling limits exceeded.
public static ResponseType_ THROTTLED { get; }
Property Value
UNAUTHORIZED
The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.
public static ResponseType_ UNAUTHORIZED { get; }
Property Value
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
WAF_FILTERED
The gateway response when a request is blocked by AWS WAF.
public static ResponseType_ WAF_FILTERED { get; }
Property Value
Methods
Of(String)
A custom response type to support future cases.
public static ResponseType_ Of(string type)
Parameters
- type System.String
Returns