Class WebSocketIntegration.Builder
java.lang.Object
software.amazon.awscdk.services.apigatewayv2.WebSocketIntegration.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<WebSocketIntegration>
- Enclosing class:
WebSocketIntegration
@Stability(Stable)
public static final class WebSocketIntegration.Builder
extends Object
implements software.amazon.jsii.Builder<WebSocketIntegration>
A fluent builder for
WebSocketIntegration
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
contentHandling
(ContentHandling contentHandling) Specifies how to handle response payload content type conversions.static WebSocketIntegration.Builder
credentialsRole
(IRole credentialsRole) Specifies the IAM role required for the integration.integrationMethod
(String integrationMethod) Specifies the integration's HTTP method type.integrationType
(WebSocketIntegrationType integrationType) Integration type.integrationUri
(String integrationUri) Integration URI.passthroughBehavior
(PassthroughBehavior 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.requestParameters
(Map<String, String> requestParameters) The request parameters that API Gateway sends with the backend request.requestTemplates
(Map<String, String> requestTemplates) A map of Apache Velocity templates that are applied on the request payload.templateSelectionExpression
(String templateSelectionExpression) The template selection expression for the integration.The maximum amount of time an integration will run before it returns without a response.webSocketApi
(IWebSocketApi webSocketApi) The WebSocket API to which this integration should be bound.
-
Method Details
-
create
@Stability(Stable) public static WebSocketIntegration.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
WebSocketIntegration.Builder
.
-
integrationType
@Stability(Stable) public WebSocketIntegration.Builder integrationType(WebSocketIntegrationType integrationType) Integration type.- Parameters:
integrationType
- Integration type. This parameter is required.- Returns:
this
-
integrationUri
Integration URI.- Parameters:
integrationUri
- Integration URI. This parameter is required.- Returns:
this
-
webSocketApi
The WebSocket API to which this integration should be bound.- Parameters:
webSocketApi
- The WebSocket API to which this integration should be bound. This parameter is required.- Returns:
this
-
contentHandling
@Stability(Stable) public WebSocketIntegration.Builder contentHandling(ContentHandling contentHandling) Specifies how to handle response payload content type conversions.Default: - The response payload will be passed through from the integration response to the route response or method response without modification.
- Parameters:
contentHandling
- Specifies how to handle response payload content type conversions. This parameter is required.- Returns:
this
-
credentialsRole
Specifies the IAM role required for the integration.Default: - No IAM role required.
- Parameters:
credentialsRole
- Specifies the IAM role required for the integration. This parameter is required.- Returns:
this
-
integrationMethod
Specifies the integration's HTTP method type.Default: - No HTTP method required.
- Parameters:
integrationMethod
- Specifies the integration's HTTP method type. This parameter is required.- Returns:
this
-
passthroughBehavior
@Stability(Stable) public WebSocketIntegration.Builder passthroughBehavior(PassthroughBehavior 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.
Default: - No passthrough behavior required.
- 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. This parameter is required.- Returns:
this
-
requestParameters
@Stability(Stable) public WebSocketIntegration.Builder requestParameters(Map<String, String> 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.
Default: - No request parameters required.
- Parameters:
requestParameters
- The request parameters that API Gateway sends with the backend request. This parameter is required.- Returns:
this
-
requestTemplates
@Stability(Stable) public WebSocketIntegration.Builder requestTemplates(Map<String, String> requestTemplates) A map of Apache Velocity templates that are applied on the request payload.{ "application/json": "{ \"statusCode\": 200 }" }
Default: - No request templates required.
- Parameters:
requestTemplates
- A map of Apache Velocity templates that are applied on the request payload. This parameter is required.- Returns:
this
-
templateSelectionExpression
@Stability(Stable) public WebSocketIntegration.Builder templateSelectionExpression(String templateSelectionExpression) The template selection expression for the integration.Default: - No template selection expression required.
- Parameters:
templateSelectionExpression
- The template selection expression for the integration. This parameter is required.- Returns:
this
-
timeout
The maximum amount of time an integration will run before it returns without a response.Must be between 50 milliseconds and 29 seconds.
Default: Duration.seconds(29)
- Parameters:
timeout
- The maximum amount of time an integration will run before it returns without a response. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<WebSocketIntegration>
- Returns:
- a newly built instance of
WebSocketIntegration
.
-