Class LambdaIntegrationOptions.Builder
java.lang.Object
software.amazon.awscdk.services.apigateway.LambdaIntegrationOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<LambdaIntegrationOptions>
- Enclosing interface:
LambdaIntegrationOptions
@Stability(Stable)
public static final class LambdaIntegrationOptions.Builder
extends Object
implements software.amazon.jsii.Builder<LambdaIntegrationOptions>
A builder for
LambdaIntegrationOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowTestInvoke
(Boolean allowTestInvoke) Sets the value ofLambdaIntegrationOptions.getAllowTestInvoke()
build()
Builds the configured instance.cacheKeyParameters
(List<String> cacheKeyParameters) Sets the value ofIntegrationOptions.getCacheKeyParameters()
cacheNamespace
(String cacheNamespace) Sets the value ofIntegrationOptions.getCacheNamespace()
connectionType
(ConnectionType connectionType) Sets the value ofIntegrationOptions.getConnectionType()
contentHandling
(ContentHandling contentHandling) Sets the value ofIntegrationOptions.getContentHandling()
credentialsPassthrough
(Boolean credentialsPassthrough) Sets the value ofIntegrationOptions.getCredentialsPassthrough()
credentialsRole
(IRole credentialsRole) Sets the value ofIntegrationOptions.getCredentialsRole()
integrationResponses
(List<? extends IntegrationResponse> integrationResponses) Sets the value ofIntegrationOptions.getIntegrationResponses()
passthroughBehavior
(PassthroughBehavior passthroughBehavior) Sets the value ofIntegrationOptions.getPassthroughBehavior()
Sets the value ofLambdaIntegrationOptions.getProxy()
requestParameters
(Map<String, String> requestParameters) Sets the value ofIntegrationOptions.getRequestParameters()
requestTemplates
(Map<String, String> requestTemplates) Sets the value ofIntegrationOptions.getRequestTemplates()
Sets the value ofIntegrationOptions.getTimeout()
Sets the value ofIntegrationOptions.getVpcLink()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowTestInvoke
Sets the value ofLambdaIntegrationOptions.getAllowTestInvoke()
- Parameters:
allowTestInvoke
- Allow invoking method from AWS Console UI (for testing purposes). This will add another permission to the AWS Lambda resource policy which will allow thetest-invoke-stage
stage to invoke this handler. If this is set tofalse
, the function will only be usable from the deployment endpoint.- Returns:
this
-
proxy
Sets the value ofLambdaIntegrationOptions.getProxy()
- Parameters:
proxy
- Use proxy integration or normal (request/response mapping) integration.- Returns:
this
-
cacheKeyParameters
@Stability(Stable) public LambdaIntegrationOptions.Builder cacheKeyParameters(List<String> cacheKeyParameters) Sets the value ofIntegrationOptions.getCacheKeyParameters()
- Parameters:
cacheKeyParameters
- A list of request parameters whose values are to be cached. It determines request parameters that will make it into the cache key.- Returns:
this
-
cacheNamespace
Sets the value ofIntegrationOptions.getCacheNamespace()
- Parameters:
cacheNamespace
- An API-specific tag group of related cached parameters.- Returns:
this
-
connectionType
@Stability(Stable) public LambdaIntegrationOptions.Builder connectionType(ConnectionType connectionType) Sets the value ofIntegrationOptions.getConnectionType()
- Parameters:
connectionType
- The type of network connection to the integration endpoint.- Returns:
this
-
contentHandling
@Stability(Stable) public LambdaIntegrationOptions.Builder contentHandling(ContentHandling contentHandling) Sets the value ofIntegrationOptions.getContentHandling()
- Parameters:
contentHandling
- Specifies how to handle request payload content type conversions.- Returns:
this
-
credentialsPassthrough
@Stability(Stable) public LambdaIntegrationOptions.Builder credentialsPassthrough(Boolean credentialsPassthrough) Sets the value ofIntegrationOptions.getCredentialsPassthrough()
- Parameters:
credentialsPassthrough
- Requires that the caller's identity be passed through from the request.- Returns:
this
-
credentialsRole
Sets the value ofIntegrationOptions.getCredentialsRole()
- Parameters:
credentialsRole
- An IAM role that API Gateway assumes. Mutually exclusive withcredentialsPassThrough
.- Returns:
this
-
integrationResponses
@Stability(Stable) public LambdaIntegrationOptions.Builder integrationResponses(List<? extends IntegrationResponse> integrationResponses) Sets the value ofIntegrationOptions.getIntegrationResponses()
- Parameters:
integrationResponses
- The response that API Gateway provides after a method's backend completes processing a request. API Gateway intercepts the response from the backend so that you can control how API Gateway surfaces backend responses. For example, you can map the backend status codes to codes that you define.- Returns:
this
-
passthroughBehavior
@Stability(Stable) public LambdaIntegrationOptions.Builder passthroughBehavior(PassthroughBehavior passthroughBehavior) Sets the value ofIntegrationOptions.getPassthroughBehavior()
- Parameters:
passthroughBehavior
- Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.- Returns:
this
-
requestParameters
@Stability(Stable) public LambdaIntegrationOptions.Builder requestParameters(Map<String, String> requestParameters) Sets the value ofIntegrationOptions.getRequestParameters()
- Parameters:
requestParameters
- The request parameters that API Gateway sends with the backend request. Specify request parameters as key-value pairs (string-to-string mappings), with a destination as the key and a source as the value.Specify the destination by using the following pattern integration.request.location.name, where location is querystring, path, or header, and name is a valid, unique parameter name.
The source must be an existing method request parameter or a static value. You must enclose static values in single quotation marks and pre-encode these values based on their destination in the request.
- Returns:
this
-
requestTemplates
@Stability(Stable) public LambdaIntegrationOptions.Builder requestTemplates(Map<String, String> requestTemplates) Sets the value ofIntegrationOptions.getRequestTemplates()
- Parameters:
requestTemplates
- A map of Apache Velocity templates that are applied on the request payload. The template that API Gateway uses is based on the value of the Content-Type header that's sent by the client. The content type value is the key, and the template is the value (specified as a string), such as the following snippet:{ "application/json": "{ \"statusCode\": 200 }" }
- Returns:
this
-
timeout
Sets the value ofIntegrationOptions.getTimeout()
- Parameters:
timeout
- The maximum amount of time an integration will run before it returns without a response. Must be between 50 milliseconds and 29 seconds.- Returns:
this
-
vpcLink
Sets the value ofIntegrationOptions.getVpcLink()
- Parameters:
vpcLink
- The VpcLink used for the integration. Required if connectionType is VPC_LINK- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LambdaIntegrationOptions>
- Returns:
- a new instance of
LambdaIntegrationOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-