@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-11T19:24:23.300Z") @Stability(value=Experimental) 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()
(experimental) Custom headers parameters for response.
|
default String |
getStatusCode()
(experimental) Http status code for response.
|
default Map<String,String> |
getTemplates()
(experimental) Custom templates to get mapped as response.
|
ResponseType |
getType()
(experimental) Response type to associate with gateway response.
|
@Stability(value=Experimental) @NotNull ResponseType getType()
https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html@Stability(value=Experimental) @Nullable default Map<String,String> getResponseHeaders()
Default: - no headers
@Stability(value=Experimental) @Nullable default String getStatusCode()
Default: - standard http status code for the response type.
@Stability(value=Experimental) @Nullable default Map<String,String> getTemplates()
Default: - Response from api will be returned without applying any transformation.
@Stability(value=Experimental) static GatewayResponseOptions.Builder builder()
GatewayResponseOptions.Builder of GatewayResponseOptionsCopyright © 2022. All rights reserved.