Interface WebSocketRouteOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
WebSocketRouteProps
All Known Implementing Classes:
WebSocketRouteOptions.Jsii$Proxy, WebSocketRouteProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.87.0 (build 9892444)", date="2023-08-23T17:50:59.650Z") @Stability(Experimental) public interface WebSocketRouteOptions extends software.amazon.jsii.JsiiSerializable
(experimental) Options used to add route to the API.

Example:

 import software.amazon.awscdk.services.apigatewayv2.integrations.alpha.WebSocketLambdaIntegration;
 Function messageHandler;
 WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
 WebSocketStage.Builder.create(this, "mystage")
         .webSocketApi(webSocketApi)
         .stageName("dev")
         .autoDeploy(true)
         .build();
 webSocketApi.addRoute("sendmessage", WebSocketRouteOptions.builder()
         .integration(new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler))
         .build());
 
  • Method Details

    • getIntegration

      @Stability(Experimental) @NotNull WebSocketRouteIntegration getIntegration()
      (experimental) The integration to be configured on this route.
    • getAuthorizer

      @Stability(Experimental) @Nullable default IWebSocketRouteAuthorizer getAuthorizer()
      (experimental) The authorize to this route.

      You can only set authorizer to a $connect route.

      Default: - No Authorizer

    • getReturnResponse

      @Stability(Experimental) @Nullable default Boolean getReturnResponse()
      (experimental) Should the route send a response to the client.

      Default: false

    • builder

      @Stability(Experimental) static WebSocketRouteOptions.Builder builder()
      Returns:
      a WebSocketRouteOptions.Builder of WebSocketRouteOptions