@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.162Z") @Stability(value=Stable) public interface GatewayResponseOptions extends software.amazon.jsii.JsiiSerializable
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 | Interface and Description |
|---|---|
static class |
GatewayResponseOptions.Builder
A builder for
GatewayResponseOptions |
static class |
GatewayResponseOptions.Jsii$Proxy
An implementation for
GatewayResponseOptions |
| Modifier and Type | Method and Description |
|---|---|
static GatewayResponseOptions.Builder |
builder() |
default Map<String,String> |
getResponseHeaders()
Custom headers parameters for response.
|
default String |
getStatusCode()
Http status code for response.
|
default Map<String,String> |
getTemplates()
Custom templates to get mapped as response.
|
ResponseType |
getType()
Response type to associate with gateway response.
|
@Stability(value=Stable) @NotNull ResponseType getType()
@Stability(value=Stable) @Nullable default Map<String,String> getResponseHeaders()
Default: - no headers
@Stability(value=Stable) @Nullable default String getStatusCode()
Default: - standard http status code for the response type.
@Stability(value=Stable) @Nullable default Map<String,String> getTemplates()
Default: - Response from api will be returned without applying any transformation.
@Stability(value=Stable) static GatewayResponseOptions.Builder builder()
GatewayResponseOptions.Builder of GatewayResponseOptionsCopyright © 2022. All rights reserved.