All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.lambda.model.CreateEventSourceMappingRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Lambda module holds the client classes that are used for communicating with AWS Lambda Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.lambda.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateEventSourceMappingRequest extends LambdaRequest implements
        ToCopyableBuilder {
    private static final SdkField EVENT_SOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EventSourceArn").getter(getter(CreateEventSourceMappingRequest::eventSourceArn))
            .setter(setter(Builder::eventSourceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventSourceArn").build()).build();

    private static final SdkField FUNCTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("FunctionName").getter(getter(CreateEventSourceMappingRequest::functionName))
            .setter(setter(Builder::functionName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FunctionName").build()).build();

    private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("Enabled").getter(getter(CreateEventSourceMappingRequest::enabled)).setter(setter(Builder::enabled))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build();

    private static final SdkField BATCH_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("BatchSize").getter(getter(CreateEventSourceMappingRequest::batchSize))
            .setter(setter(Builder::batchSize))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BatchSize").build()).build();

    private static final SdkField FILTER_CRITERIA_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("FilterCriteria")
            .getter(getter(CreateEventSourceMappingRequest::filterCriteria)).setter(setter(Builder::filterCriteria))
            .constructor(FilterCriteria::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilterCriteria").build()).build();

    private static final SdkField MAXIMUM_BATCHING_WINDOW_IN_SECONDS_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("MaximumBatchingWindowInSeconds")
            .getter(getter(CreateEventSourceMappingRequest::maximumBatchingWindowInSeconds))
            .setter(setter(Builder::maximumBatchingWindowInSeconds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaximumBatchingWindowInSeconds")
                    .build()).build();

    private static final SdkField PARALLELIZATION_FACTOR_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("ParallelizationFactor").getter(getter(CreateEventSourceMappingRequest::parallelizationFactor))
            .setter(setter(Builder::parallelizationFactor))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParallelizationFactor").build())
            .build();

    private static final SdkField STARTING_POSITION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StartingPosition").getter(getter(CreateEventSourceMappingRequest::startingPositionAsString))
            .setter(setter(Builder::startingPosition))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartingPosition").build()).build();

    private static final SdkField STARTING_POSITION_TIMESTAMP_FIELD = SdkField
            . builder(MarshallingType.INSTANT).memberName("StartingPositionTimestamp")
            .getter(getter(CreateEventSourceMappingRequest::startingPositionTimestamp))
            .setter(setter(Builder::startingPositionTimestamp))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartingPositionTimestamp").build())
            .build();

    private static final SdkField DESTINATION_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("DestinationConfig")
            .getter(getter(CreateEventSourceMappingRequest::destinationConfig)).setter(setter(Builder::destinationConfig))
            .constructor(DestinationConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationConfig").build()).build();

    private static final SdkField MAXIMUM_RECORD_AGE_IN_SECONDS_FIELD = SdkField
            . builder(MarshallingType.INTEGER).memberName("MaximumRecordAgeInSeconds")
            .getter(getter(CreateEventSourceMappingRequest::maximumRecordAgeInSeconds))
            .setter(setter(Builder::maximumRecordAgeInSeconds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaximumRecordAgeInSeconds").build())
            .build();

    private static final SdkField BISECT_BATCH_ON_FUNCTION_ERROR_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("BisectBatchOnFunctionError")
            .getter(getter(CreateEventSourceMappingRequest::bisectBatchOnFunctionError))
            .setter(setter(Builder::bisectBatchOnFunctionError))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BisectBatchOnFunctionError").build())
            .build();

    private static final SdkField MAXIMUM_RETRY_ATTEMPTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("MaximumRetryAttempts").getter(getter(CreateEventSourceMappingRequest::maximumRetryAttempts))
            .setter(setter(Builder::maximumRetryAttempts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaximumRetryAttempts").build())
            .build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Tags")
            .getter(getter(CreateEventSourceMappingRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField TUMBLING_WINDOW_IN_SECONDS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("TumblingWindowInSeconds").getter(getter(CreateEventSourceMappingRequest::tumblingWindowInSeconds))
            .setter(setter(Builder::tumblingWindowInSeconds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TumblingWindowInSeconds").build())
            .build();

    private static final SdkField> TOPICS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Topics")
            .getter(getter(CreateEventSourceMappingRequest::topics))
            .setter(setter(Builder::topics))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Topics").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> QUEUES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Queues")
            .getter(getter(CreateEventSourceMappingRequest::queues))
            .setter(setter(Builder::queues))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Queues").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> SOURCE_ACCESS_CONFIGURATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SourceAccessConfigurations")
            .getter(getter(CreateEventSourceMappingRequest::sourceAccessConfigurations))
            .setter(setter(Builder::sourceAccessConfigurations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceAccessConfigurations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(SourceAccessConfiguration::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField SELF_MANAGED_EVENT_SOURCE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("SelfManagedEventSource")
            .getter(getter(CreateEventSourceMappingRequest::selfManagedEventSource))
            .setter(setter(Builder::selfManagedEventSource)).constructor(SelfManagedEventSource::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelfManagedEventSource").build())
            .build();

    private static final SdkField> FUNCTION_RESPONSE_TYPES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("FunctionResponseTypes")
            .getter(getter(CreateEventSourceMappingRequest::functionResponseTypesAsStrings))
            .setter(setter(Builder::functionResponseTypesWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FunctionResponseTypes").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("AmazonManagedKafkaEventSourceConfig")
            .getter(getter(CreateEventSourceMappingRequest::amazonManagedKafkaEventSourceConfig))
            .setter(setter(Builder::amazonManagedKafkaEventSourceConfig))
            .constructor(AmazonManagedKafkaEventSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                    .locationName("AmazonManagedKafkaEventSourceConfig").build()).build();

    private static final SdkField SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("SelfManagedKafkaEventSourceConfig")
            .getter(getter(CreateEventSourceMappingRequest::selfManagedKafkaEventSourceConfig))
            .setter(setter(Builder::selfManagedKafkaEventSourceConfig))
            .constructor(SelfManagedKafkaEventSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelfManagedKafkaEventSourceConfig")
                    .build()).build();

    private static final SdkField SCALING_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ScalingConfig")
            .getter(getter(CreateEventSourceMappingRequest::scalingConfig)).setter(setter(Builder::scalingConfig))
            .constructor(ScalingConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScalingConfig").build()).build();

    private static final SdkField DOCUMENT_DB_EVENT_SOURCE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("DocumentDBEventSourceConfig")
            .getter(getter(CreateEventSourceMappingRequest::documentDBEventSourceConfig))
            .setter(setter(Builder::documentDBEventSourceConfig))
            .constructor(DocumentDBEventSourceConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DocumentDBEventSourceConfig")
                    .build()).build();

    private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("KMSKeyArn").getter(getter(CreateEventSourceMappingRequest::kmsKeyArn))
            .setter(setter(Builder::kmsKeyArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KMSKeyArn").build()).build();

    private static final SdkField METRICS_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("MetricsConfig")
            .getter(getter(CreateEventSourceMappingRequest::metricsConfig)).setter(setter(Builder::metricsConfig))
            .constructor(EventSourceMappingMetricsConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricsConfig").build()).build();

    private static final SdkField PROVISIONED_POLLER_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ProvisionedPollerConfig")
            .getter(getter(CreateEventSourceMappingRequest::provisionedPollerConfig))
            .setter(setter(Builder::provisionedPollerConfig)).constructor(ProvisionedPollerConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedPollerConfig").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EVENT_SOURCE_ARN_FIELD,
            FUNCTION_NAME_FIELD, ENABLED_FIELD, BATCH_SIZE_FIELD, FILTER_CRITERIA_FIELD,
            MAXIMUM_BATCHING_WINDOW_IN_SECONDS_FIELD, PARALLELIZATION_FACTOR_FIELD, STARTING_POSITION_FIELD,
            STARTING_POSITION_TIMESTAMP_FIELD, DESTINATION_CONFIG_FIELD, MAXIMUM_RECORD_AGE_IN_SECONDS_FIELD,
            BISECT_BATCH_ON_FUNCTION_ERROR_FIELD, MAXIMUM_RETRY_ATTEMPTS_FIELD, TAGS_FIELD, TUMBLING_WINDOW_IN_SECONDS_FIELD,
            TOPICS_FIELD, QUEUES_FIELD, SOURCE_ACCESS_CONFIGURATIONS_FIELD, SELF_MANAGED_EVENT_SOURCE_FIELD,
            FUNCTION_RESPONSE_TYPES_FIELD, AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD,
            SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD, SCALING_CONFIG_FIELD, DOCUMENT_DB_EVENT_SOURCE_CONFIG_FIELD,
            KMS_KEY_ARN_FIELD, METRICS_CONFIG_FIELD, PROVISIONED_POLLER_CONFIG_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("EventSourceArn", EVENT_SOURCE_ARN_FIELD);
                    put("FunctionName", FUNCTION_NAME_FIELD);
                    put("Enabled", ENABLED_FIELD);
                    put("BatchSize", BATCH_SIZE_FIELD);
                    put("FilterCriteria", FILTER_CRITERIA_FIELD);
                    put("MaximumBatchingWindowInSeconds", MAXIMUM_BATCHING_WINDOW_IN_SECONDS_FIELD);
                    put("ParallelizationFactor", PARALLELIZATION_FACTOR_FIELD);
                    put("StartingPosition", STARTING_POSITION_FIELD);
                    put("StartingPositionTimestamp", STARTING_POSITION_TIMESTAMP_FIELD);
                    put("DestinationConfig", DESTINATION_CONFIG_FIELD);
                    put("MaximumRecordAgeInSeconds", MAXIMUM_RECORD_AGE_IN_SECONDS_FIELD);
                    put("BisectBatchOnFunctionError", BISECT_BATCH_ON_FUNCTION_ERROR_FIELD);
                    put("MaximumRetryAttempts", MAXIMUM_RETRY_ATTEMPTS_FIELD);
                    put("Tags", TAGS_FIELD);
                    put("TumblingWindowInSeconds", TUMBLING_WINDOW_IN_SECONDS_FIELD);
                    put("Topics", TOPICS_FIELD);
                    put("Queues", QUEUES_FIELD);
                    put("SourceAccessConfigurations", SOURCE_ACCESS_CONFIGURATIONS_FIELD);
                    put("SelfManagedEventSource", SELF_MANAGED_EVENT_SOURCE_FIELD);
                    put("FunctionResponseTypes", FUNCTION_RESPONSE_TYPES_FIELD);
                    put("AmazonManagedKafkaEventSourceConfig", AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD);
                    put("SelfManagedKafkaEventSourceConfig", SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG_FIELD);
                    put("ScalingConfig", SCALING_CONFIG_FIELD);
                    put("DocumentDBEventSourceConfig", DOCUMENT_DB_EVENT_SOURCE_CONFIG_FIELD);
                    put("KMSKeyArn", KMS_KEY_ARN_FIELD);
                    put("MetricsConfig", METRICS_CONFIG_FIELD);
                    put("ProvisionedPollerConfig", PROVISIONED_POLLER_CONFIG_FIELD);
                }
            });

    private final String eventSourceArn;

    private final String functionName;

    private final Boolean enabled;

    private final Integer batchSize;

    private final FilterCriteria filterCriteria;

    private final Integer maximumBatchingWindowInSeconds;

    private final Integer parallelizationFactor;

    private final String startingPosition;

    private final Instant startingPositionTimestamp;

    private final DestinationConfig destinationConfig;

    private final Integer maximumRecordAgeInSeconds;

    private final Boolean bisectBatchOnFunctionError;

    private final Integer maximumRetryAttempts;

    private final Map tags;

    private final Integer tumblingWindowInSeconds;

    private final List topics;

    private final List queues;

    private final List sourceAccessConfigurations;

    private final SelfManagedEventSource selfManagedEventSource;

    private final List functionResponseTypes;

    private final AmazonManagedKafkaEventSourceConfig amazonManagedKafkaEventSourceConfig;

    private final SelfManagedKafkaEventSourceConfig selfManagedKafkaEventSourceConfig;

    private final ScalingConfig scalingConfig;

    private final DocumentDBEventSourceConfig documentDBEventSourceConfig;

    private final String kmsKeyArn;

    private final EventSourceMappingMetricsConfig metricsConfig;

    private final ProvisionedPollerConfig provisionedPollerConfig;

    private CreateEventSourceMappingRequest(BuilderImpl builder) {
        super(builder);
        this.eventSourceArn = builder.eventSourceArn;
        this.functionName = builder.functionName;
        this.enabled = builder.enabled;
        this.batchSize = builder.batchSize;
        this.filterCriteria = builder.filterCriteria;
        this.maximumBatchingWindowInSeconds = builder.maximumBatchingWindowInSeconds;
        this.parallelizationFactor = builder.parallelizationFactor;
        this.startingPosition = builder.startingPosition;
        this.startingPositionTimestamp = builder.startingPositionTimestamp;
        this.destinationConfig = builder.destinationConfig;
        this.maximumRecordAgeInSeconds = builder.maximumRecordAgeInSeconds;
        this.bisectBatchOnFunctionError = builder.bisectBatchOnFunctionError;
        this.maximumRetryAttempts = builder.maximumRetryAttempts;
        this.tags = builder.tags;
        this.tumblingWindowInSeconds = builder.tumblingWindowInSeconds;
        this.topics = builder.topics;
        this.queues = builder.queues;
        this.sourceAccessConfigurations = builder.sourceAccessConfigurations;
        this.selfManagedEventSource = builder.selfManagedEventSource;
        this.functionResponseTypes = builder.functionResponseTypes;
        this.amazonManagedKafkaEventSourceConfig = builder.amazonManagedKafkaEventSourceConfig;
        this.selfManagedKafkaEventSourceConfig = builder.selfManagedKafkaEventSourceConfig;
        this.scalingConfig = builder.scalingConfig;
        this.documentDBEventSourceConfig = builder.documentDBEventSourceConfig;
        this.kmsKeyArn = builder.kmsKeyArn;
        this.metricsConfig = builder.metricsConfig;
        this.provisionedPollerConfig = builder.provisionedPollerConfig;
    }

    /**
     * 

* The Amazon Resource Name (ARN) of the event source. *

*
    *
  • *

    * Amazon Kinesis – The ARN of the data stream or a stream consumer. *

    *
  • *
  • *

    * Amazon DynamoDB Streams – The ARN of the stream. *

    *
  • *
  • *

    * Amazon Simple Queue Service – The ARN of the queue. *

    *
  • *
  • *

    * Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for * cross-account event source * mappings). *

    *
  • *
  • *

    * Amazon MQ – The ARN of the broker. *

    *
  • *
  • *

    * Amazon DocumentDB – The ARN of the DocumentDB change stream. *

    *
  • *
* * @return The Amazon Resource Name (ARN) of the event source.

*
    *
  • *

    * Amazon Kinesis – The ARN of the data stream or a stream consumer. *

    *
  • *
  • *

    * Amazon DynamoDB Streams – The ARN of the stream. *

    *
  • *
  • *

    * Amazon Simple Queue Service – The ARN of the queue. *

    *
  • *
  • *

    * Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC * connection (for cross-account event * source mappings). *

    *
  • *
  • *

    * Amazon MQ – The ARN of the broker. *

    *
  • *
  • *

    * Amazon DocumentDB – The ARN of the DocumentDB change stream. *

    *
  • */ public final String eventSourceArn() { return eventSourceArn; } /** *

    * The name or ARN of the Lambda function. *

    *

    * Name formats *

    *
      *
    • *

      * Function nameMyFunction. *

      *
    • *
    • *

      * Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

      *
    • *
    • *

      * Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD. *

      *
    • *
    • *

      * Partial ARN123456789012:function:MyFunction. *

      *
    • *
    *

    * The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 * characters in length. *

    * * @return The name or ARN of the Lambda function.

    *

    * Name formats *

    *
      *
    • *

      * Function nameMyFunction. *

      *
    • *
    • *

      * Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

      *
    • *
    • *

      * Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD * . *

      *
    • *
    • *

      * Partial ARN123456789012:function:MyFunction. *

      *
    • *
    *

    * The length constraint applies only to the full ARN. If you specify only the function name, it's limited * to 64 characters in length. */ public final String functionName() { return functionName; } /** *

    * When true, the event source mapping is active. When false, Lambda pauses polling and invocation. *

    *

    * Default: True *

    * * @return When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

    *

    * Default: True */ public final Boolean enabled() { return enabled; } /** *

    * The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your * function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit * for synchronous invocation (6 MB). *

    *
      *
    • *

      * Amazon Kinesis – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon DynamoDB Streams – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max * is 10. *

      *
    • *
    • *

      * Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000. *

      *
    • *
    • *

      * Self-managed Apache Kafka – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000. *

      *
    • *
    • *

      * DocumentDB – Default 100. Max 10,000. *

      *
    • *
    * * @return The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your * function. Lambda passes all of the records in the batch to the function in a single call, up to the * payload limit for synchronous invocation (6 MB).

    *
      *
    • *

      * Amazon Kinesis – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon DynamoDB Streams – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues * the max is 10. *

      *
    • *
    • *

      * Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000. *

      *
    • *
    • *

      * Self-managed Apache Kafka – Default 100. Max 10,000. *

      *
    • *
    • *

      * Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000. *

      *
    • *
    • *

      * DocumentDB – Default 100. Max 10,000. *

      *
    • */ public final Integer batchSize() { return batchSize; } /** *

      * An object that defines the filter criteria that determine whether Lambda should process an event. For more * information, see Lambda * event filtering. *

      * * @return An object that defines the filter criteria that determine whether Lambda should process an event. For * more information, see Lambda event * filtering. */ public final FilterCriteria filterCriteria() { return filterCriteria; } /** *

      * The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You * can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in * increments of seconds. *

      *

      * For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, * Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note * that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot * revert back to the 500 ms default batching window after you have changed it. To restore the default batching * window, you must create a new event source mapping. *

      *

      * Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to a * value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. *

      * * @return The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the * function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to * 300 seconds in increments of seconds.

      *

      * For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon * MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is * 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments * of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To * restore the default batching window, you must create a new event source mapping. *

      *

      * Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize * to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. */ public final Integer maximumBatchingWindowInSeconds() { return maximumBatchingWindowInSeconds; } /** *

      * (Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently. *

      * * @return (Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently. */ public final Integer parallelizationFactor() { return parallelizationFactor; } /** *

      * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream * event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon * MSK, and self-managed Apache Kafka. *

      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #startingPosition} * will return {@link EventSourcePosition#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #startingPositionAsString}. *

      * * @return The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB * Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon * DocumentDB, Amazon MSK, and self-managed Apache Kafka. * @see EventSourcePosition */ public final EventSourcePosition startingPosition() { return EventSourcePosition.fromValue(startingPosition); } /** *

      * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream * event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon * MSK, and self-managed Apache Kafka. *

      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #startingPosition} * will return {@link EventSourcePosition#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #startingPositionAsString}. *

      * * @return The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB * Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon * DocumentDB, Amazon MSK, and self-managed Apache Kafka. * @see EventSourcePosition */ public final String startingPositionAsString() { return startingPosition; } /** *

      * With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. * StartingPositionTimestamp cannot be in the future. *

      * * @return With StartingPosition set to AT_TIMESTAMP, the time from which to start * reading. StartingPositionTimestamp cannot be in the future. */ public final Instant startingPositionTimestamp() { return startingPositionTimestamp; } /** *

      * (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that specifies the * destination of an event after Lambda processes it. *

      * * @return (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that * specifies the destination of an event after Lambda processes it. */ public final DestinationConfig destinationConfig() { return destinationConfig; } /** *

      * (Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is infinite * (-1). *

      * * @return (Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is * infinite (-1). */ public final Integer maximumRecordAgeInSeconds() { return maximumRecordAgeInSeconds; } /** *

      * (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. *

      * * @return (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. */ public final Boolean bisectBatchOnFunctionError() { return bisectBatchOnFunctionError; } /** *

      * (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is * infinite (-1). When set to infinite (-1), failed records are retried until the record expires. *

      * * @return (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default * value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires. */ public final Integer maximumRetryAttempts() { return maximumRetryAttempts; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

      * A list of tags to apply to the event source mapping. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

      * * @return A list of tags to apply to the event source mapping. */ public final Map tags() { return tags; } /** *

      * (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis * Streams event sources. A value of 0 seconds indicates no tumbling window. *

      * * @return (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and * Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window. */ public final Integer tumblingWindowInSeconds() { return tumblingWindowInSeconds; } /** * For responses, this returns true if the service returned a value for the Topics property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasTopics() { return topics != null && !(topics instanceof SdkAutoConstructList); } /** *

      * The name of the Kafka topic. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTopics} method. *

      * * @return The name of the Kafka topic. */ public final List topics() { return topics; } /** * For responses, this returns true if the service returned a value for the Queues property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasQueues() { return queues != null && !(queues instanceof SdkAutoConstructList); } /** *

      * (MQ) The name of the Amazon MQ broker destination queue to consume. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasQueues} method. *

      * * @return (MQ) The name of the Amazon MQ broker destination queue to consume. */ public final List queues() { return queues; } /** * For responses, this returns true if the service returned a value for the SourceAccessConfigurations property. * This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasSourceAccessConfigurations() { return sourceAccessConfigurations != null && !(sourceAccessConfigurations instanceof SdkAutoConstructList); } /** *

      * An array of authentication protocols or VPC components required to secure your event source. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSourceAccessConfigurations} method. *

      * * @return An array of authentication protocols or VPC components required to secure your event source. */ public final List sourceAccessConfigurations() { return sourceAccessConfigurations; } /** *

      * The self-managed Apache Kafka cluster to receive records from. *

      * * @return The self-managed Apache Kafka cluster to receive records from. */ public final SelfManagedEventSource selfManagedEventSource() { return selfManagedEventSource; } /** *

      * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFunctionResponseTypes} method. *

      * * @return (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. */ public final List functionResponseTypes() { return FunctionResponseTypeListCopier.copyStringToEnum(functionResponseTypes); } /** * For responses, this returns true if the service returned a value for the FunctionResponseTypes property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasFunctionResponseTypes() { return functionResponseTypes != null && !(functionResponseTypes instanceof SdkAutoConstructList); } /** *

      * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFunctionResponseTypes} method. *

      * * @return (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. */ public final List functionResponseTypesAsStrings() { return functionResponseTypes; } /** *

      * Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. *

      * * @return Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event * source. */ public final AmazonManagedKafkaEventSourceConfig amazonManagedKafkaEventSourceConfig() { return amazonManagedKafkaEventSourceConfig; } /** *

      * Specific configuration settings for a self-managed Apache Kafka event source. *

      * * @return Specific configuration settings for a self-managed Apache Kafka event source. */ public final SelfManagedKafkaEventSourceConfig selfManagedKafkaEventSourceConfig() { return selfManagedKafkaEventSourceConfig; } /** *

      * (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum * concurrency for Amazon SQS event sources. *

      * * @return (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring * maximum concurrency for Amazon SQS event sources. */ public final ScalingConfig scalingConfig() { return scalingConfig; } /** *

      * Specific configuration settings for a DocumentDB event source. *

      * * @return Specific configuration settings for a DocumentDB event source. */ public final DocumentDBEventSourceConfig documentDBEventSourceConfig() { return documentDBEventSourceConfig; } /** *

      * The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter * criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to encrypt * data using your own customer managed key. *

      * * @return The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your * function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this * property to encrypt data using your own customer managed key. */ public final String kmsKeyArn() { return kmsKeyArn; } /** *

      * The metrics configuration for your event source. For more information, see Event source mapping metrics. *

      * * @return The metrics configuration for your event source. For more information, see Event source mapping metrics. */ public final EventSourceMappingMetricsConfig metricsConfig() { return metricsConfig; } /** *

      * (Amazon MSK and self-managed Apache Kafka only) The Provisioned Mode configuration for the event source. For more * information, see Provisioned Mode. *

      * * @return (Amazon MSK and self-managed Apache Kafka only) The Provisioned Mode configuration for the event source. * For more information, see Provisioned Mode. */ public final ProvisionedPollerConfig provisionedPollerConfig() { return provisionedPollerConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(eventSourceArn()); hashCode = 31 * hashCode + Objects.hashCode(functionName()); hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(batchSize()); hashCode = 31 * hashCode + Objects.hashCode(filterCriteria()); hashCode = 31 * hashCode + Objects.hashCode(maximumBatchingWindowInSeconds()); hashCode = 31 * hashCode + Objects.hashCode(parallelizationFactor()); hashCode = 31 * hashCode + Objects.hashCode(startingPositionAsString()); hashCode = 31 * hashCode + Objects.hashCode(startingPositionTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(destinationConfig()); hashCode = 31 * hashCode + Objects.hashCode(maximumRecordAgeInSeconds()); hashCode = 31 * hashCode + Objects.hashCode(bisectBatchOnFunctionError()); hashCode = 31 * hashCode + Objects.hashCode(maximumRetryAttempts()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(tumblingWindowInSeconds()); hashCode = 31 * hashCode + Objects.hashCode(hasTopics() ? topics() : null); hashCode = 31 * hashCode + Objects.hashCode(hasQueues() ? queues() : null); hashCode = 31 * hashCode + Objects.hashCode(hasSourceAccessConfigurations() ? sourceAccessConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(selfManagedEventSource()); hashCode = 31 * hashCode + Objects.hashCode(hasFunctionResponseTypes() ? functionResponseTypesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(amazonManagedKafkaEventSourceConfig()); hashCode = 31 * hashCode + Objects.hashCode(selfManagedKafkaEventSourceConfig()); hashCode = 31 * hashCode + Objects.hashCode(scalingConfig()); hashCode = 31 * hashCode + Objects.hashCode(documentDBEventSourceConfig()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn()); hashCode = 31 * hashCode + Objects.hashCode(metricsConfig()); hashCode = 31 * hashCode + Objects.hashCode(provisionedPollerConfig()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateEventSourceMappingRequest)) { return false; } CreateEventSourceMappingRequest other = (CreateEventSourceMappingRequest) obj; return Objects.equals(eventSourceArn(), other.eventSourceArn()) && Objects.equals(functionName(), other.functionName()) && Objects.equals(enabled(), other.enabled()) && Objects.equals(batchSize(), other.batchSize()) && Objects.equals(filterCriteria(), other.filterCriteria()) && Objects.equals(maximumBatchingWindowInSeconds(), other.maximumBatchingWindowInSeconds()) && Objects.equals(parallelizationFactor(), other.parallelizationFactor()) && Objects.equals(startingPositionAsString(), other.startingPositionAsString()) && Objects.equals(startingPositionTimestamp(), other.startingPositionTimestamp()) && Objects.equals(destinationConfig(), other.destinationConfig()) && Objects.equals(maximumRecordAgeInSeconds(), other.maximumRecordAgeInSeconds()) && Objects.equals(bisectBatchOnFunctionError(), other.bisectBatchOnFunctionError()) && Objects.equals(maximumRetryAttempts(), other.maximumRetryAttempts()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(tumblingWindowInSeconds(), other.tumblingWindowInSeconds()) && hasTopics() == other.hasTopics() && Objects.equals(topics(), other.topics()) && hasQueues() == other.hasQueues() && Objects.equals(queues(), other.queues()) && hasSourceAccessConfigurations() == other.hasSourceAccessConfigurations() && Objects.equals(sourceAccessConfigurations(), other.sourceAccessConfigurations()) && Objects.equals(selfManagedEventSource(), other.selfManagedEventSource()) && hasFunctionResponseTypes() == other.hasFunctionResponseTypes() && Objects.equals(functionResponseTypesAsStrings(), other.functionResponseTypesAsStrings()) && Objects.equals(amazonManagedKafkaEventSourceConfig(), other.amazonManagedKafkaEventSourceConfig()) && Objects.equals(selfManagedKafkaEventSourceConfig(), other.selfManagedKafkaEventSourceConfig()) && Objects.equals(scalingConfig(), other.scalingConfig()) && Objects.equals(documentDBEventSourceConfig(), other.documentDBEventSourceConfig()) && Objects.equals(kmsKeyArn(), other.kmsKeyArn()) && Objects.equals(metricsConfig(), other.metricsConfig()) && Objects.equals(provisionedPollerConfig(), other.provisionedPollerConfig()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateEventSourceMappingRequest").add("EventSourceArn", eventSourceArn()) .add("FunctionName", functionName()).add("Enabled", enabled()).add("BatchSize", batchSize()) .add("FilterCriteria", filterCriteria()).add("MaximumBatchingWindowInSeconds", maximumBatchingWindowInSeconds()) .add("ParallelizationFactor", parallelizationFactor()).add("StartingPosition", startingPositionAsString()) .add("StartingPositionTimestamp", startingPositionTimestamp()).add("DestinationConfig", destinationConfig()) .add("MaximumRecordAgeInSeconds", maximumRecordAgeInSeconds()) .add("BisectBatchOnFunctionError", bisectBatchOnFunctionError()) .add("MaximumRetryAttempts", maximumRetryAttempts()).add("Tags", hasTags() ? tags() : null) .add("TumblingWindowInSeconds", tumblingWindowInSeconds()).add("Topics", hasTopics() ? topics() : null) .add("Queues", hasQueues() ? queues() : null) .add("SourceAccessConfigurations", hasSourceAccessConfigurations() ? sourceAccessConfigurations() : null) .add("SelfManagedEventSource", selfManagedEventSource()) .add("FunctionResponseTypes", hasFunctionResponseTypes() ? functionResponseTypesAsStrings() : null) .add("AmazonManagedKafkaEventSourceConfig", amazonManagedKafkaEventSourceConfig()) .add("SelfManagedKafkaEventSourceConfig", selfManagedKafkaEventSourceConfig()) .add("ScalingConfig", scalingConfig()).add("DocumentDBEventSourceConfig", documentDBEventSourceConfig()) .add("KMSKeyArn", kmsKeyArn()).add("MetricsConfig", metricsConfig()) .add("ProvisionedPollerConfig", provisionedPollerConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EventSourceArn": return Optional.ofNullable(clazz.cast(eventSourceArn())); case "FunctionName": return Optional.ofNullable(clazz.cast(functionName())); case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "BatchSize": return Optional.ofNullable(clazz.cast(batchSize())); case "FilterCriteria": return Optional.ofNullable(clazz.cast(filterCriteria())); case "MaximumBatchingWindowInSeconds": return Optional.ofNullable(clazz.cast(maximumBatchingWindowInSeconds())); case "ParallelizationFactor": return Optional.ofNullable(clazz.cast(parallelizationFactor())); case "StartingPosition": return Optional.ofNullable(clazz.cast(startingPositionAsString())); case "StartingPositionTimestamp": return Optional.ofNullable(clazz.cast(startingPositionTimestamp())); case "DestinationConfig": return Optional.ofNullable(clazz.cast(destinationConfig())); case "MaximumRecordAgeInSeconds": return Optional.ofNullable(clazz.cast(maximumRecordAgeInSeconds())); case "BisectBatchOnFunctionError": return Optional.ofNullable(clazz.cast(bisectBatchOnFunctionError())); case "MaximumRetryAttempts": return Optional.ofNullable(clazz.cast(maximumRetryAttempts())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "TumblingWindowInSeconds": return Optional.ofNullable(clazz.cast(tumblingWindowInSeconds())); case "Topics": return Optional.ofNullable(clazz.cast(topics())); case "Queues": return Optional.ofNullable(clazz.cast(queues())); case "SourceAccessConfigurations": return Optional.ofNullable(clazz.cast(sourceAccessConfigurations())); case "SelfManagedEventSource": return Optional.ofNullable(clazz.cast(selfManagedEventSource())); case "FunctionResponseTypes": return Optional.ofNullable(clazz.cast(functionResponseTypesAsStrings())); case "AmazonManagedKafkaEventSourceConfig": return Optional.ofNullable(clazz.cast(amazonManagedKafkaEventSourceConfig())); case "SelfManagedKafkaEventSourceConfig": return Optional.ofNullable(clazz.cast(selfManagedKafkaEventSourceConfig())); case "ScalingConfig": return Optional.ofNullable(clazz.cast(scalingConfig())); case "DocumentDBEventSourceConfig": return Optional.ofNullable(clazz.cast(documentDBEventSourceConfig())); case "KMSKeyArn": return Optional.ofNullable(clazz.cast(kmsKeyArn())); case "MetricsConfig": return Optional.ofNullable(clazz.cast(metricsConfig())); case "ProvisionedPollerConfig": return Optional.ofNullable(clazz.cast(provisionedPollerConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((CreateEventSourceMappingRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends LambdaRequest.Builder, SdkPojo, CopyableBuilder { /** *

      * The Amazon Resource Name (ARN) of the event source. *

      *
        *
      • *

        * Amazon Kinesis – The ARN of the data stream or a stream consumer. *

        *
      • *
      • *

        * Amazon DynamoDB Streams – The ARN of the stream. *

        *
      • *
      • *

        * Amazon Simple Queue Service – The ARN of the queue. *

        *
      • *
      • *

        * Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection * (for cross-account event * source mappings). *

        *
      • *
      • *

        * Amazon MQ – The ARN of the broker. *

        *
      • *
      • *

        * Amazon DocumentDB – The ARN of the DocumentDB change stream. *

        *
      • *
      * * @param eventSourceArn * The Amazon Resource Name (ARN) of the event source.

      *
        *
      • *

        * Amazon Kinesis – The ARN of the data stream or a stream consumer. *

        *
      • *
      • *

        * Amazon DynamoDB Streams – The ARN of the stream. *

        *
      • *
      • *

        * Amazon Simple Queue Service – The ARN of the queue. *

        *
      • *
      • *

        * Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC * connection (for cross-account event * source mappings). *

        *
      • *
      • *

        * Amazon MQ – The ARN of the broker. *

        *
      • *
      • *

        * Amazon DocumentDB – The ARN of the DocumentDB change stream. *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventSourceArn(String eventSourceArn); /** *

        * The name or ARN of the Lambda function. *

        *

        * Name formats *

        *
          *
        • *

          * Function nameMyFunction. *

          *
        • *
        • *

          * Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

          *
        • *
        • *

          * Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD. *

          *
        • *
        • *

          * Partial ARN123456789012:function:MyFunction. *

          *
        • *
        *

        * The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 * characters in length. *

        * * @param functionName * The name or ARN of the Lambda function.

        *

        * Name formats *

        *
          *
        • *

          * Function nameMyFunction. *

          *
        • *
        • *

          * Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

          *
        • *
        • *

          * Version or Alias ARN – * arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD. *

          *
        • *
        • *

          * Partial ARN123456789012:function:MyFunction. *

          *
        • *
        *

        * The length constraint applies only to the full ARN. If you specify only the function name, it's * limited to 64 characters in length. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionName(String functionName); /** *

        * When true, the event source mapping is active. When false, Lambda pauses polling and invocation. *

        *

        * Default: True *

        * * @param enabled * When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

        *

        * Default: True * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); /** *

        * The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your * function. Lambda passes all of the records in the batch to the function in a single call, up to the payload * limit for synchronous invocation (6 MB). *

        *
          *
        • *

          * Amazon Kinesis – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon DynamoDB Streams – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the * max is 10. *

          *
        • *
        • *

          * Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000. *

          *
        • *
        • *

          * Self-managed Apache Kafka – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000. *

          *
        • *
        • *

          * DocumentDB – Default 100. Max 10,000. *

          *
        • *
        * * @param batchSize * The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to * your function. Lambda passes all of the records in the batch to the function in a single call, up to * the payload limit for synchronous invocation (6 MB).

        *
          *
        • *

          * Amazon Kinesis – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon DynamoDB Streams – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO * queues the max is 10. *

          *
        • *
        • *

          * Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000. *

          *
        • *
        • *

          * Self-managed Apache Kafka – Default 100. Max 10,000. *

          *
        • *
        • *

          * Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000. *

          *
        • *
        • *

          * DocumentDB – Default 100. Max 10,000. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder batchSize(Integer batchSize); /** *

          * An object that defines the filter criteria that determine whether Lambda should process an event. For more * information, see Lambda * event filtering. *

          * * @param filterCriteria * An object that defines the filter criteria that determine whether Lambda should process an event. For * more information, see Lambda event * filtering. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filterCriteria(FilterCriteria filterCriteria); /** *

          * An object that defines the filter criteria that determine whether Lambda should process an event. For more * information, see Lambda * event filtering. *

          * This is a convenience method that creates an instance of the {@link FilterCriteria.Builder} avoiding the need * to create one manually via {@link FilterCriteria#builder()}. * *

          * When the {@link Consumer} completes, {@link FilterCriteria.Builder#build()} is called immediately and its * result is passed to {@link #filterCriteria(FilterCriteria)}. * * @param filterCriteria * a consumer that will call methods on {@link FilterCriteria.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #filterCriteria(FilterCriteria) */ default Builder filterCriteria(Consumer filterCriteria) { return filterCriteria(FilterCriteria.builder().applyMutation(filterCriteria).build()); } /** *

          * The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. * You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in * increments of seconds. *

          *

          * For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon * MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 * ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of * seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore * the default batching window, you must create a new event source mapping. *

          *

          * Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to * a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. *

          * * @param maximumBatchingWindowInSeconds * The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the * function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to * 300 seconds in increments of seconds.

          *

          * For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For * Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching * window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in * increments of seconds, you cannot revert back to the 500 ms default batching window after you have * changed it. To restore the default batching window, you must create a new event source mapping. *

          *

          * Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set * BatchSize to a value greater than 10, you must set * MaximumBatchingWindowInSeconds to at least 1. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumBatchingWindowInSeconds(Integer maximumBatchingWindowInSeconds); /** *

          * (Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently. *

          * * @param parallelizationFactor * (Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parallelizationFactor(Integer parallelizationFactor); /** *

          * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream * event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, * Amazon MSK, and self-managed Apache Kafka. *

          * * @param startingPosition * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB * Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon * DocumentDB, Amazon MSK, and self-managed Apache Kafka. * @see EventSourcePosition * @return Returns a reference to this object so that method calls can be chained together. * @see EventSourcePosition */ Builder startingPosition(String startingPosition); /** *

          * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream * event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, * Amazon MSK, and self-managed Apache Kafka. *

          * * @param startingPosition * The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB * Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon * DocumentDB, Amazon MSK, and self-managed Apache Kafka. * @see EventSourcePosition * @return Returns a reference to this object so that method calls can be chained together. * @see EventSourcePosition */ Builder startingPosition(EventSourcePosition startingPosition); /** *

          * With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. * StartingPositionTimestamp cannot be in the future. *

          * * @param startingPositionTimestamp * With StartingPosition set to AT_TIMESTAMP, the time from which to start * reading. StartingPositionTimestamp cannot be in the future. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startingPositionTimestamp(Instant startingPositionTimestamp); /** *

          * (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that specifies * the destination of an event after Lambda processes it. *

          * * @param destinationConfig * (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that * specifies the destination of an event after Lambda processes it. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationConfig(DestinationConfig destinationConfig); /** *

          * (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only) A configuration object that specifies * the destination of an event after Lambda processes it. *

          * This is a convenience method that creates an instance of the {@link DestinationConfig.Builder} avoiding the * need to create one manually via {@link DestinationConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link DestinationConfig.Builder#build()} is called immediately and its * result is passed to {@link #destinationConfig(DestinationConfig)}. * * @param destinationConfig * a consumer that will call methods on {@link DestinationConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destinationConfig(DestinationConfig) */ default Builder destinationConfig(Consumer destinationConfig) { return destinationConfig(DestinationConfig.builder().applyMutation(destinationConfig).build()); } /** *

          * (Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is * infinite (-1). *

          * * @param maximumRecordAgeInSeconds * (Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is * infinite (-1). * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumRecordAgeInSeconds(Integer maximumRecordAgeInSeconds); /** *

          * (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. *

          * * @param bisectBatchOnFunctionError * (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and * retry. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bisectBatchOnFunctionError(Boolean bisectBatchOnFunctionError); /** *

          * (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value * is infinite (-1). When set to infinite (-1), failed records are retried until the record expires. *

          * * @param maximumRetryAttempts * (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default * value is infinite (-1). When set to infinite (-1), failed records are retried until the record * expires. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maximumRetryAttempts(Integer maximumRetryAttempts); /** *

          * A list of tags to apply to the event source mapping. *

          * * @param tags * A list of tags to apply to the event source mapping. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

          * (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis * Streams event sources. A value of 0 seconds indicates no tumbling window. *

          * * @param tumblingWindowInSeconds * (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and * Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tumblingWindowInSeconds(Integer tumblingWindowInSeconds); /** *

          * The name of the Kafka topic. *

          * * @param topics * The name of the Kafka topic. * @return Returns a reference to this object so that method calls can be chained together. */ Builder topics(Collection topics); /** *

          * The name of the Kafka topic. *

          * * @param topics * The name of the Kafka topic. * @return Returns a reference to this object so that method calls can be chained together. */ Builder topics(String... topics); /** *

          * (MQ) The name of the Amazon MQ broker destination queue to consume. *

          * * @param queues * (MQ) The name of the Amazon MQ broker destination queue to consume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder queues(Collection queues); /** *

          * (MQ) The name of the Amazon MQ broker destination queue to consume. *

          * * @param queues * (MQ) The name of the Amazon MQ broker destination queue to consume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder queues(String... queues); /** *

          * An array of authentication protocols or VPC components required to secure your event source. *

          * * @param sourceAccessConfigurations * An array of authentication protocols or VPC components required to secure your event source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceAccessConfigurations(Collection sourceAccessConfigurations); /** *

          * An array of authentication protocols or VPC components required to secure your event source. *

          * * @param sourceAccessConfigurations * An array of authentication protocols or VPC components required to secure your event source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceAccessConfigurations(SourceAccessConfiguration... sourceAccessConfigurations); /** *

          * An array of authentication protocols or VPC components required to secure your event source. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.lambda.model.SourceAccessConfiguration.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.lambda.model.SourceAccessConfiguration#builder()}. * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.lambda.model.SourceAccessConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #sourceAccessConfigurations(List)}. * * @param sourceAccessConfigurations * a consumer that will call methods on * {@link software.amazon.awssdk.services.lambda.model.SourceAccessConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sourceAccessConfigurations(java.util.Collection) */ Builder sourceAccessConfigurations(Consumer... sourceAccessConfigurations); /** *

          * The self-managed Apache Kafka cluster to receive records from. *

          * * @param selfManagedEventSource * The self-managed Apache Kafka cluster to receive records from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selfManagedEventSource(SelfManagedEventSource selfManagedEventSource); /** *

          * The self-managed Apache Kafka cluster to receive records from. *

          * This is a convenience method that creates an instance of the {@link SelfManagedEventSource.Builder} avoiding * the need to create one manually via {@link SelfManagedEventSource#builder()}. * *

          * When the {@link Consumer} completes, {@link SelfManagedEventSource.Builder#build()} is called immediately and * its result is passed to {@link #selfManagedEventSource(SelfManagedEventSource)}. * * @param selfManagedEventSource * a consumer that will call methods on {@link SelfManagedEventSource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #selfManagedEventSource(SelfManagedEventSource) */ default Builder selfManagedEventSource(Consumer selfManagedEventSource) { return selfManagedEventSource(SelfManagedEventSource.builder().applyMutation(selfManagedEventSource).build()); } /** *

          * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

          * * @param functionResponseTypes * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionResponseTypesWithStrings(Collection functionResponseTypes); /** *

          * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

          * * @param functionResponseTypes * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionResponseTypesWithStrings(String... functionResponseTypes); /** *

          * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

          * * @param functionResponseTypes * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionResponseTypes(Collection functionResponseTypes); /** *

          * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event source * mapping. *

          * * @param functionResponseTypes * (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type enums applied to the event * source mapping. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionResponseTypes(FunctionResponseType... functionResponseTypes); /** *

          * Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. *

          * * @param amazonManagedKafkaEventSourceConfig * Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event * source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfig amazonManagedKafkaEventSourceConfig); /** *

          * Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. *

          * This is a convenience method that creates an instance of the * {@link AmazonManagedKafkaEventSourceConfig.Builder} avoiding the need to create one manually via * {@link AmazonManagedKafkaEventSourceConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link AmazonManagedKafkaEventSourceConfig.Builder#build()} is called * immediately and its result is passed to * {@link #amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfig)}. * * @param amazonManagedKafkaEventSourceConfig * a consumer that will call methods on {@link AmazonManagedKafkaEventSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfig) */ default Builder amazonManagedKafkaEventSourceConfig( Consumer amazonManagedKafkaEventSourceConfig) { return amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfig.builder() .applyMutation(amazonManagedKafkaEventSourceConfig).build()); } /** *

          * Specific configuration settings for a self-managed Apache Kafka event source. *

          * * @param selfManagedKafkaEventSourceConfig * Specific configuration settings for a self-managed Apache Kafka event source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfig selfManagedKafkaEventSourceConfig); /** *

          * Specific configuration settings for a self-managed Apache Kafka event source. *

          * This is a convenience method that creates an instance of the * {@link SelfManagedKafkaEventSourceConfig.Builder} avoiding the need to create one manually via * {@link SelfManagedKafkaEventSourceConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link SelfManagedKafkaEventSourceConfig.Builder#build()} is called * immediately and its result is passed to * {@link #selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfig)}. * * @param selfManagedKafkaEventSourceConfig * a consumer that will call methods on {@link SelfManagedKafkaEventSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfig) */ default Builder selfManagedKafkaEventSourceConfig( Consumer selfManagedKafkaEventSourceConfig) { return selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfig.builder() .applyMutation(selfManagedKafkaEventSourceConfig).build()); } /** *

          * (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring * maximum concurrency for Amazon SQS event sources. *

          * * @param scalingConfig * (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalingConfig(ScalingConfig scalingConfig); /** *

          * (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring * maximum concurrency for Amazon SQS event sources. *

          * This is a convenience method that creates an instance of the {@link ScalingConfig.Builder} avoiding the need * to create one manually via {@link ScalingConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link ScalingConfig.Builder#build()} is called immediately and its * result is passed to {@link #scalingConfig(ScalingConfig)}. * * @param scalingConfig * a consumer that will call methods on {@link ScalingConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #scalingConfig(ScalingConfig) */ default Builder scalingConfig(Consumer scalingConfig) { return scalingConfig(ScalingConfig.builder().applyMutation(scalingConfig).build()); } /** *

          * Specific configuration settings for a DocumentDB event source. *

          * * @param documentDBEventSourceConfig * Specific configuration settings for a DocumentDB event source. * @return Returns a reference to this object so that method calls can be chained together. */ Builder documentDBEventSourceConfig(DocumentDBEventSourceConfig documentDBEventSourceConfig); /** *

          * Specific configuration settings for a DocumentDB event source. *

          * This is a convenience method that creates an instance of the {@link DocumentDBEventSourceConfig.Builder} * avoiding the need to create one manually via {@link DocumentDBEventSourceConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link DocumentDBEventSourceConfig.Builder#build()} is called * immediately and its result is passed to {@link #documentDBEventSourceConfig(DocumentDBEventSourceConfig)}. * * @param documentDBEventSourceConfig * a consumer that will call methods on {@link DocumentDBEventSourceConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #documentDBEventSourceConfig(DocumentDBEventSourceConfig) */ default Builder documentDBEventSourceConfig(Consumer documentDBEventSourceConfig) { return documentDBEventSourceConfig(DocumentDBEventSourceConfig.builder().applyMutation(documentDBEventSourceConfig) .build()); } /** *

          * The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's * filter * criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to * encrypt data using your own customer managed key. *

          * * @param kmsKeyArn * The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your * function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this * property to encrypt data using your own customer managed key. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyArn(String kmsKeyArn); /** *

          * The metrics configuration for your event source. For more information, see Event source mapping metrics. *

          * * @param metricsConfig * The metrics configuration for your event source. For more information, see Event source mapping metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metricsConfig(EventSourceMappingMetricsConfig metricsConfig); /** *

          * The metrics configuration for your event source. For more information, see Event source mapping metrics. *

          * This is a convenience method that creates an instance of the {@link EventSourceMappingMetricsConfig.Builder} * avoiding the need to create one manually via {@link EventSourceMappingMetricsConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link EventSourceMappingMetricsConfig.Builder#build()} is called * immediately and its result is passed to {@link #metricsConfig(EventSourceMappingMetricsConfig)}. * * @param metricsConfig * a consumer that will call methods on {@link EventSourceMappingMetricsConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #metricsConfig(EventSourceMappingMetricsConfig) */ default Builder metricsConfig(Consumer metricsConfig) { return metricsConfig(EventSourceMappingMetricsConfig.builder().applyMutation(metricsConfig).build()); } /** *

          * (Amazon MSK and self-managed Apache Kafka only) The Provisioned Mode configuration for the event source. For * more information, see Provisioned Mode. *

          * * @param provisionedPollerConfig * (Amazon MSK and self-managed Apache Kafka only) The Provisioned Mode configuration for the event * source. For more information, see Provisioned Mode. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig); /** *

          * (Amazon MSK and self-managed Apache Kafka only) The Provisioned Mode configuration for the event source. For * more information, see Provisioned Mode. *

          * This is a convenience method that creates an instance of the {@link ProvisionedPollerConfig.Builder} avoiding * the need to create one manually via {@link ProvisionedPollerConfig#builder()}. * *

          * When the {@link Consumer} completes, {@link ProvisionedPollerConfig.Builder#build()} is called immediately * and its result is passed to {@link #provisionedPollerConfig(ProvisionedPollerConfig)}. * * @param provisionedPollerConfig * a consumer that will call methods on {@link ProvisionedPollerConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #provisionedPollerConfig(ProvisionedPollerConfig) */ default Builder provisionedPollerConfig(Consumer provisionedPollerConfig) { return provisionedPollerConfig(ProvisionedPollerConfig.builder().applyMutation(provisionedPollerConfig).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends LambdaRequest.BuilderImpl implements Builder { private String eventSourceArn; private String functionName; private Boolean enabled; private Integer batchSize; private FilterCriteria filterCriteria; private Integer maximumBatchingWindowInSeconds; private Integer parallelizationFactor; private String startingPosition; private Instant startingPositionTimestamp; private DestinationConfig destinationConfig; private Integer maximumRecordAgeInSeconds; private Boolean bisectBatchOnFunctionError; private Integer maximumRetryAttempts; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private Integer tumblingWindowInSeconds; private List topics = DefaultSdkAutoConstructList.getInstance(); private List queues = DefaultSdkAutoConstructList.getInstance(); private List sourceAccessConfigurations = DefaultSdkAutoConstructList.getInstance(); private SelfManagedEventSource selfManagedEventSource; private List functionResponseTypes = DefaultSdkAutoConstructList.getInstance(); private AmazonManagedKafkaEventSourceConfig amazonManagedKafkaEventSourceConfig; private SelfManagedKafkaEventSourceConfig selfManagedKafkaEventSourceConfig; private ScalingConfig scalingConfig; private DocumentDBEventSourceConfig documentDBEventSourceConfig; private String kmsKeyArn; private EventSourceMappingMetricsConfig metricsConfig; private ProvisionedPollerConfig provisionedPollerConfig; private BuilderImpl() { } private BuilderImpl(CreateEventSourceMappingRequest model) { super(model); eventSourceArn(model.eventSourceArn); functionName(model.functionName); enabled(model.enabled); batchSize(model.batchSize); filterCriteria(model.filterCriteria); maximumBatchingWindowInSeconds(model.maximumBatchingWindowInSeconds); parallelizationFactor(model.parallelizationFactor); startingPosition(model.startingPosition); startingPositionTimestamp(model.startingPositionTimestamp); destinationConfig(model.destinationConfig); maximumRecordAgeInSeconds(model.maximumRecordAgeInSeconds); bisectBatchOnFunctionError(model.bisectBatchOnFunctionError); maximumRetryAttempts(model.maximumRetryAttempts); tags(model.tags); tumblingWindowInSeconds(model.tumblingWindowInSeconds); topics(model.topics); queues(model.queues); sourceAccessConfigurations(model.sourceAccessConfigurations); selfManagedEventSource(model.selfManagedEventSource); functionResponseTypesWithStrings(model.functionResponseTypes); amazonManagedKafkaEventSourceConfig(model.amazonManagedKafkaEventSourceConfig); selfManagedKafkaEventSourceConfig(model.selfManagedKafkaEventSourceConfig); scalingConfig(model.scalingConfig); documentDBEventSourceConfig(model.documentDBEventSourceConfig); kmsKeyArn(model.kmsKeyArn); metricsConfig(model.metricsConfig); provisionedPollerConfig(model.provisionedPollerConfig); } public final String getEventSourceArn() { return eventSourceArn; } public final void setEventSourceArn(String eventSourceArn) { this.eventSourceArn = eventSourceArn; } @Override public final Builder eventSourceArn(String eventSourceArn) { this.eventSourceArn = eventSourceArn; return this; } public final String getFunctionName() { return functionName; } public final void setFunctionName(String functionName) { this.functionName = functionName; } @Override public final Builder functionName(String functionName) { this.functionName = functionName; return this; } public final Boolean getEnabled() { return enabled; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final Integer getBatchSize() { return batchSize; } public final void setBatchSize(Integer batchSize) { this.batchSize = batchSize; } @Override public final Builder batchSize(Integer batchSize) { this.batchSize = batchSize; return this; } public final FilterCriteria.Builder getFilterCriteria() { return filterCriteria != null ? filterCriteria.toBuilder() : null; } public final void setFilterCriteria(FilterCriteria.BuilderImpl filterCriteria) { this.filterCriteria = filterCriteria != null ? filterCriteria.build() : null; } @Override public final Builder filterCriteria(FilterCriteria filterCriteria) { this.filterCriteria = filterCriteria; return this; } public final Integer getMaximumBatchingWindowInSeconds() { return maximumBatchingWindowInSeconds; } public final void setMaximumBatchingWindowInSeconds(Integer maximumBatchingWindowInSeconds) { this.maximumBatchingWindowInSeconds = maximumBatchingWindowInSeconds; } @Override public final Builder maximumBatchingWindowInSeconds(Integer maximumBatchingWindowInSeconds) { this.maximumBatchingWindowInSeconds = maximumBatchingWindowInSeconds; return this; } public final Integer getParallelizationFactor() { return parallelizationFactor; } public final void setParallelizationFactor(Integer parallelizationFactor) { this.parallelizationFactor = parallelizationFactor; } @Override public final Builder parallelizationFactor(Integer parallelizationFactor) { this.parallelizationFactor = parallelizationFactor; return this; } public final String getStartingPosition() { return startingPosition; } public final void setStartingPosition(String startingPosition) { this.startingPosition = startingPosition; } @Override public final Builder startingPosition(String startingPosition) { this.startingPosition = startingPosition; return this; } @Override public final Builder startingPosition(EventSourcePosition startingPosition) { this.startingPosition(startingPosition == null ? null : startingPosition.toString()); return this; } public final Instant getStartingPositionTimestamp() { return startingPositionTimestamp; } public final void setStartingPositionTimestamp(Instant startingPositionTimestamp) { this.startingPositionTimestamp = startingPositionTimestamp; } @Override public final Builder startingPositionTimestamp(Instant startingPositionTimestamp) { this.startingPositionTimestamp = startingPositionTimestamp; return this; } public final DestinationConfig.Builder getDestinationConfig() { return destinationConfig != null ? destinationConfig.toBuilder() : null; } public final void setDestinationConfig(DestinationConfig.BuilderImpl destinationConfig) { this.destinationConfig = destinationConfig != null ? destinationConfig.build() : null; } @Override public final Builder destinationConfig(DestinationConfig destinationConfig) { this.destinationConfig = destinationConfig; return this; } public final Integer getMaximumRecordAgeInSeconds() { return maximumRecordAgeInSeconds; } public final void setMaximumRecordAgeInSeconds(Integer maximumRecordAgeInSeconds) { this.maximumRecordAgeInSeconds = maximumRecordAgeInSeconds; } @Override public final Builder maximumRecordAgeInSeconds(Integer maximumRecordAgeInSeconds) { this.maximumRecordAgeInSeconds = maximumRecordAgeInSeconds; return this; } public final Boolean getBisectBatchOnFunctionError() { return bisectBatchOnFunctionError; } public final void setBisectBatchOnFunctionError(Boolean bisectBatchOnFunctionError) { this.bisectBatchOnFunctionError = bisectBatchOnFunctionError; } @Override public final Builder bisectBatchOnFunctionError(Boolean bisectBatchOnFunctionError) { this.bisectBatchOnFunctionError = bisectBatchOnFunctionError; return this; } public final Integer getMaximumRetryAttempts() { return maximumRetryAttempts; } public final void setMaximumRetryAttempts(Integer maximumRetryAttempts) { this.maximumRetryAttempts = maximumRetryAttempts; } @Override public final Builder maximumRetryAttempts(Integer maximumRetryAttempts) { this.maximumRetryAttempts = maximumRetryAttempts; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagsCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagsCopier.copy(tags); return this; } public final Integer getTumblingWindowInSeconds() { return tumblingWindowInSeconds; } public final void setTumblingWindowInSeconds(Integer tumblingWindowInSeconds) { this.tumblingWindowInSeconds = tumblingWindowInSeconds; } @Override public final Builder tumblingWindowInSeconds(Integer tumblingWindowInSeconds) { this.tumblingWindowInSeconds = tumblingWindowInSeconds; return this; } public final Collection getTopics() { if (topics instanceof SdkAutoConstructList) { return null; } return topics; } public final void setTopics(Collection topics) { this.topics = TopicsCopier.copy(topics); } @Override public final Builder topics(Collection topics) { this.topics = TopicsCopier.copy(topics); return this; } @Override @SafeVarargs public final Builder topics(String... topics) { topics(Arrays.asList(topics)); return this; } public final Collection getQueues() { if (queues instanceof SdkAutoConstructList) { return null; } return queues; } public final void setQueues(Collection queues) { this.queues = QueuesCopier.copy(queues); } @Override public final Builder queues(Collection queues) { this.queues = QueuesCopier.copy(queues); return this; } @Override @SafeVarargs public final Builder queues(String... queues) { queues(Arrays.asList(queues)); return this; } public final List getSourceAccessConfigurations() { List result = SourceAccessConfigurationsCopier .copyToBuilder(this.sourceAccessConfigurations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSourceAccessConfigurations( Collection sourceAccessConfigurations) { this.sourceAccessConfigurations = SourceAccessConfigurationsCopier.copyFromBuilder(sourceAccessConfigurations); } @Override public final Builder sourceAccessConfigurations(Collection sourceAccessConfigurations) { this.sourceAccessConfigurations = SourceAccessConfigurationsCopier.copy(sourceAccessConfigurations); return this; } @Override @SafeVarargs public final Builder sourceAccessConfigurations(SourceAccessConfiguration... sourceAccessConfigurations) { sourceAccessConfigurations(Arrays.asList(sourceAccessConfigurations)); return this; } @Override @SafeVarargs public final Builder sourceAccessConfigurations(Consumer... sourceAccessConfigurations) { sourceAccessConfigurations(Stream.of(sourceAccessConfigurations) .map(c -> SourceAccessConfiguration.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final SelfManagedEventSource.Builder getSelfManagedEventSource() { return selfManagedEventSource != null ? selfManagedEventSource.toBuilder() : null; } public final void setSelfManagedEventSource(SelfManagedEventSource.BuilderImpl selfManagedEventSource) { this.selfManagedEventSource = selfManagedEventSource != null ? selfManagedEventSource.build() : null; } @Override public final Builder selfManagedEventSource(SelfManagedEventSource selfManagedEventSource) { this.selfManagedEventSource = selfManagedEventSource; return this; } public final Collection getFunctionResponseTypes() { if (functionResponseTypes instanceof SdkAutoConstructList) { return null; } return functionResponseTypes; } public final void setFunctionResponseTypes(Collection functionResponseTypes) { this.functionResponseTypes = FunctionResponseTypeListCopier.copy(functionResponseTypes); } @Override public final Builder functionResponseTypesWithStrings(Collection functionResponseTypes) { this.functionResponseTypes = FunctionResponseTypeListCopier.copy(functionResponseTypes); return this; } @Override @SafeVarargs public final Builder functionResponseTypesWithStrings(String... functionResponseTypes) { functionResponseTypesWithStrings(Arrays.asList(functionResponseTypes)); return this; } @Override public final Builder functionResponseTypes(Collection functionResponseTypes) { this.functionResponseTypes = FunctionResponseTypeListCopier.copyEnumToString(functionResponseTypes); return this; } @Override @SafeVarargs public final Builder functionResponseTypes(FunctionResponseType... functionResponseTypes) { functionResponseTypes(Arrays.asList(functionResponseTypes)); return this; } public final AmazonManagedKafkaEventSourceConfig.Builder getAmazonManagedKafkaEventSourceConfig() { return amazonManagedKafkaEventSourceConfig != null ? amazonManagedKafkaEventSourceConfig.toBuilder() : null; } public final void setAmazonManagedKafkaEventSourceConfig( AmazonManagedKafkaEventSourceConfig.BuilderImpl amazonManagedKafkaEventSourceConfig) { this.amazonManagedKafkaEventSourceConfig = amazonManagedKafkaEventSourceConfig != null ? amazonManagedKafkaEventSourceConfig .build() : null; } @Override public final Builder amazonManagedKafkaEventSourceConfig( AmazonManagedKafkaEventSourceConfig amazonManagedKafkaEventSourceConfig) { this.amazonManagedKafkaEventSourceConfig = amazonManagedKafkaEventSourceConfig; return this; } public final SelfManagedKafkaEventSourceConfig.Builder getSelfManagedKafkaEventSourceConfig() { return selfManagedKafkaEventSourceConfig != null ? selfManagedKafkaEventSourceConfig.toBuilder() : null; } public final void setSelfManagedKafkaEventSourceConfig( SelfManagedKafkaEventSourceConfig.BuilderImpl selfManagedKafkaEventSourceConfig) { this.selfManagedKafkaEventSourceConfig = selfManagedKafkaEventSourceConfig != null ? selfManagedKafkaEventSourceConfig .build() : null; } @Override public final Builder selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfig selfManagedKafkaEventSourceConfig) { this.selfManagedKafkaEventSourceConfig = selfManagedKafkaEventSourceConfig; return this; } public final ScalingConfig.Builder getScalingConfig() { return scalingConfig != null ? scalingConfig.toBuilder() : null; } public final void setScalingConfig(ScalingConfig.BuilderImpl scalingConfig) { this.scalingConfig = scalingConfig != null ? scalingConfig.build() : null; } @Override public final Builder scalingConfig(ScalingConfig scalingConfig) { this.scalingConfig = scalingConfig; return this; } public final DocumentDBEventSourceConfig.Builder getDocumentDBEventSourceConfig() { return documentDBEventSourceConfig != null ? documentDBEventSourceConfig.toBuilder() : null; } public final void setDocumentDBEventSourceConfig(DocumentDBEventSourceConfig.BuilderImpl documentDBEventSourceConfig) { this.documentDBEventSourceConfig = documentDBEventSourceConfig != null ? documentDBEventSourceConfig.build() : null; } @Override public final Builder documentDBEventSourceConfig(DocumentDBEventSourceConfig documentDBEventSourceConfig) { this.documentDBEventSourceConfig = documentDBEventSourceConfig; return this; } public final String getKmsKeyArn() { return kmsKeyArn; } public final void setKmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; } @Override public final Builder kmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; return this; } public final EventSourceMappingMetricsConfig.Builder getMetricsConfig() { return metricsConfig != null ? metricsConfig.toBuilder() : null; } public final void setMetricsConfig(EventSourceMappingMetricsConfig.BuilderImpl metricsConfig) { this.metricsConfig = metricsConfig != null ? metricsConfig.build() : null; } @Override public final Builder metricsConfig(EventSourceMappingMetricsConfig metricsConfig) { this.metricsConfig = metricsConfig; return this; } public final ProvisionedPollerConfig.Builder getProvisionedPollerConfig() { return provisionedPollerConfig != null ? provisionedPollerConfig.toBuilder() : null; } public final void setProvisionedPollerConfig(ProvisionedPollerConfig.BuilderImpl provisionedPollerConfig) { this.provisionedPollerConfig = provisionedPollerConfig != null ? provisionedPollerConfig.build() : null; } @Override public final Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) { this.provisionedPollerConfig = provisionedPollerConfig; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateEventSourceMappingRequest build() { return new CreateEventSourceMappingRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy