Interface GatewayResponseOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
GatewayResponseProps
- All Known Implementing Classes:
GatewayResponseOptions.Jsii$Proxy,GatewayResponseProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:30.297Z")
@Stability(Stable)
public interface GatewayResponseOptions
extends software.amazon.jsii.JsiiSerializable
Options to add gateway response.
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());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forGatewayResponseOptionsstatic final classAn implementation forGatewayResponseOptions -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getType
Response type to associate with gateway response.- See Also:
-
getResponseHeaders
Custom headers parameters for response.Default: - no headers
-
getStatusCode
Http status code for response.Default: - standard http status code for the response type.
-
getTemplates
Custom templates to get mapped as response.Default: - Response from api will be returned without applying any transformation.
-
builder
- Returns:
- a
GatewayResponseOptions.BuilderofGatewayResponseOptions
-