java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.eventsources.ApiEventSource
All Implemented Interfaces:
IEventSource, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:30.101Z") @Stability(Stable) public class ApiEventSource extends software.amazon.jsii.JsiiObject implements IEventSource
Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.apigateway.*;
 import software.amazon.awscdk.services.lambda.eventsources.*;
 Authorizer authorizer;
 Model model;
 RequestValidator requestValidator;
 ApiEventSource apiEventSource = ApiEventSource.Builder.create("method", "path")
         .apiKeyRequired(false)
         .authorizationScopes(List.of("authorizationScopes"))
         .authorizationType(AuthorizationType.NONE)
         .authorizer(authorizer)
         .methodResponses(List.of(MethodResponse.builder()
                 .statusCode("statusCode")
                 // the properties below are optional
                 .responseModels(Map.of(
                         "responseModelsKey", model))
                 .responseParameters(Map.of(
                         "responseParametersKey", false))
                 .build()))
         .operationName("operationName")
         .requestModels(Map.of(
                 "requestModelsKey", model))
         .requestParameters(Map.of(
                 "requestParametersKey", false))
         .requestValidator(requestValidator)
         .requestValidatorOptions(RequestValidatorOptions.builder()
                 .requestValidatorName("requestValidatorName")
                 .validateRequestBody(false)
                 .validateRequestParameters(false)
                 .build())
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for ApiEventSource.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IEventSource

    IEventSource.Jsii$Default, IEventSource.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    ApiEventSource(String method, String path)
     
     
    ApiEventSource(String method, String path, MethodOptions options)
     
    protected
    ApiEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ApiEventSource(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(IFunction target)
    Called by lambda.addEventSource to allow the event source to bind to this function.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • ApiEventSource

      protected ApiEventSource(software.amazon.jsii.JsiiObjectRef objRef)
    • ApiEventSource

      protected ApiEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ApiEventSource

      @Stability(Stable) public ApiEventSource(@NotNull String method, @NotNull String path, @Nullable MethodOptions options)
      Parameters:
      method - This parameter is required.
      path - This parameter is required.
      options -
    • ApiEventSource

      @Stability(Stable) public ApiEventSource(@NotNull String method, @NotNull String path)
      Parameters:
      method - This parameter is required.
      path - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) public void bind(@NotNull IFunction target)
      Called by lambda.addEventSource to allow the event source to bind to this function.

      Specified by:
      bind in interface IEventSource
      Parameters:
      target - This parameter is required.