Class WebSocketApi.Builder
java.lang.Object
software.amazon.awscdk.services.apigatewayv2.WebSocketApi.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<WebSocketApi>
- Enclosing class:
WebSocketApi
@Stability(Stable)
public static final class WebSocketApi.Builder
extends Object
implements software.amazon.jsii.Builder<WebSocketApi>
A fluent builder for
WebSocketApi
.-
Method Summary
Modifier and TypeMethodDescriptionapiKeySelectionExpression
(WebSocketApiKeySelectionExpression apiKeySelectionExpression) An API key selection expression.Name for the WebSocket API resource.build()
connectRouteOptions
(WebSocketRouteOptions connectRouteOptions) Options to configure a '$connect' route.static WebSocketApi.Builder
defaultRouteOptions
(WebSocketRouteOptions defaultRouteOptions) Options to configure a '$default' route.description
(String description) The description of the API.disconnectRouteOptions
(WebSocketRouteOptions disconnectRouteOptions) Options to configure a '$disconnect' route.routeSelectionExpression
(String routeSelectionExpression) The route selection expression for the API.
-
Method Details
-
create
@Stability(Stable) public static WebSocketApi.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
WebSocketApi.Builder
.
-
apiKeySelectionExpression
@Stability(Stable) public WebSocketApi.Builder apiKeySelectionExpression(WebSocketApiKeySelectionExpression apiKeySelectionExpression) An API key selection expression.Providing this option will require an API Key be provided to access the API.
Default: - Key is not required to access these APIs
- Parameters:
apiKeySelectionExpression
- An API key selection expression. This parameter is required.- Returns:
this
-
apiName
Name for the WebSocket API resource.Default: - id of the WebSocketApi construct.
- Parameters:
apiName
- Name for the WebSocket API resource. This parameter is required.- Returns:
this
-
connectRouteOptions
@Stability(Stable) public WebSocketApi.Builder connectRouteOptions(WebSocketRouteOptions connectRouteOptions) Options to configure a '$connect' route.Default: - no '$connect' route configured
- Parameters:
connectRouteOptions
- Options to configure a '$connect' route. This parameter is required.- Returns:
this
-
defaultRouteOptions
@Stability(Stable) public WebSocketApi.Builder defaultRouteOptions(WebSocketRouteOptions defaultRouteOptions) Options to configure a '$default' route.Default: - no '$default' route configured
- Parameters:
defaultRouteOptions
- Options to configure a '$default' route. This parameter is required.- Returns:
this
-
description
The description of the API.Default: - none
- Parameters:
description
- The description of the API. This parameter is required.- Returns:
this
-
disconnectRouteOptions
@Stability(Stable) public WebSocketApi.Builder disconnectRouteOptions(WebSocketRouteOptions disconnectRouteOptions) Options to configure a '$disconnect' route.Default: - no '$disconnect' route configured
- Parameters:
disconnectRouteOptions
- Options to configure a '$disconnect' route. This parameter is required.- Returns:
this
-
routeSelectionExpression
@Stability(Stable) public WebSocketApi.Builder routeSelectionExpression(String routeSelectionExpression) The route selection expression for the API.Default: '$request.body.action'
- Parameters:
routeSelectionExpression
- The route selection expression for the API. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<WebSocketApi>
- Returns:
- a newly built instance of
WebSocketApi
.
-