software.amazon.awsconstructs.services.sqslambda.SqsToLambda Maven / Gradle / Ivy
Show all versions of sqslambda Show documentation
package software.amazon.awsconstructs.services.sqslambda;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.54.0 (build b1b977a)", date = "2022-02-28T16:38:46.371Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.sqslambda.$Module.class, fqn = "@aws-solutions-constructs/aws-sqs-lambda.SqsToLambda")
public class SqsToLambda extends software.amazon.awscdk.core.Construct {
protected SqsToLambda(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SqsToLambda(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope - represents the scope for all the resources. This parameter is required.
* @param id - this is a a scope-unique id. This parameter is required.
* @param props - user provided props for the construct. This parameter is required.
*/
public SqsToLambda(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awsconstructs.services.sqslambda.SqsToLambdaProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Function getLambdaFunction() {
return software.amazon.jsii.Kernel.get(this, "lambdaFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Function.class));
}
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.Queue getSqsQueue() {
return software.amazon.jsii.Kernel.get(this, "sqsQueue", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.Queue.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sqs.DeadLetterQueue getDeadLetterQueue() {
return software.amazon.jsii.Kernel.get(this, "deadLetterQueue", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.DeadLetterQueue.class));
}
/**
* A fluent builder for {@link software.amazon.awsconstructs.services.sqslambda.SqsToLambda}.
*/
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope - represents the scope for all the resources. This parameter is required.
* @param id - this is a a scope-unique id. This parameter is required.
*/
public static Builder create(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.amazon.awscdk.core.Construct scope;
private final java.lang.String id;
private final software.amazon.awsconstructs.services.sqslambda.SqsToLambdaProps.Builder props;
private Builder(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awsconstructs.services.sqslambda.SqsToLambdaProps.Builder();
}
/**
* Optional user provided properties for the dead letter queue.
*
* Default: - Default props are used
*
* @return {@code this}
* @param deadLetterQueueProps Optional user provided properties for the dead letter queue. This parameter is required.
*/
public Builder deadLetterQueueProps(final software.amazon.awscdk.services.sqs.QueueProps deadLetterQueueProps) {
this.props.deadLetterQueueProps(deadLetterQueueProps);
return this;
}
/**
* Whether to deploy a secondary queue to be used as a dead letter queue.
*
* Default: - true.
*
* @return {@code this}
* @param deployDeadLetterQueue Whether to deploy a secondary queue to be used as a dead letter queue. This parameter is required.
*/
public Builder deployDeadLetterQueue(final java.lang.Boolean deployDeadLetterQueue) {
this.props.deployDeadLetterQueue(deployDeadLetterQueue);
return this;
}
/**
* Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.
*
* Default: - None
*
* @return {@code this}
* @param existingLambdaObj Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error. This parameter is required.
*/
public Builder existingLambdaObj(final software.amazon.awscdk.services.lambda.Function existingLambdaObj) {
this.props.existingLambdaObj(existingLambdaObj);
return this;
}
/**
* Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
*
* Default: - Default props are used
*
* @return {@code this}
* @param existingQueueObj Existing instance of SQS queue object, Providing both this and queueProps will cause an error. This parameter is required.
*/
public Builder existingQueueObj(final software.amazon.awscdk.services.sqs.Queue existingQueueObj) {
this.props.existingQueueObj(existingQueueObj);
return this;
}
/**
* User provided props to override the default props for the Lambda function.
*
* Default: - Default properties are used.
*
* @return {@code this}
* @param lambdaFunctionProps User provided props to override the default props for the Lambda function. This parameter is required.
*/
public Builder lambdaFunctionProps(final software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps) {
this.props.lambdaFunctionProps(lambdaFunctionProps);
return this;
}
/**
* The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
*
* Default: - required field if deployDeadLetterQueue=true.
*
* @return {@code this}
* @param maxReceiveCount The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. This parameter is required.
*/
public Builder maxReceiveCount(final java.lang.Number maxReceiveCount) {
this.props.maxReceiveCount(maxReceiveCount);
return this;
}
/**
* Optional user provided properties.
*
* Default: - Default props are used
*
* @return {@code this}
* @param queueProps Optional user provided properties. This parameter is required.
*/
public Builder queueProps(final software.amazon.awscdk.services.sqs.QueueProps queueProps) {
this.props.queueProps(queueProps);
return this;
}
/**
* Optional user provided properties for the queue event source.
*
* Default: - Default props are used
*
* @return {@code this}
* @param sqsEventSourceProps Optional user provided properties for the queue event source. This parameter is required.
*/
public Builder sqsEventSourceProps(final software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps sqsEventSourceProps) {
this.props.sqsEventSourceProps(sqsEventSourceProps);
return this;
}
/**
* @returns a newly built instance of {@link software.amazon.awsconstructs.services.sqslambda.SqsToLambda}.
*/
@Override
public software.amazon.awsconstructs.services.sqslambda.SqsToLambda build() {
return new software.amazon.awsconstructs.services.sqslambda.SqsToLambda(
this.scope,
this.id,
this.props.build()
);
}
}
}