software.amazon.awscdk.services.sns.subscriptions.SqsSubscription Maven / Gradle / Ivy
Show all versions of sns-subscriptions Show documentation
package software.amazon.awscdk.services.sns.subscriptions;
/**
* Use an SQS queue as a subscription target.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.30.0 (build adae23f)", date = "2021-06-24T10:28:28.856Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.sns.subscriptions.$Module.class, fqn = "@aws-cdk/aws-sns-subscriptions.SqsSubscription")
public class SqsSubscription extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.sns.ITopicSubscription {
protected SqsSubscription(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SqsSubscription(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param queue This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public SqsSubscription(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.IQueue queue, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sns.subscriptions.SqsSubscriptionProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(queue, "queue is required"), props });
}
/**
* @param queue This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public SqsSubscription(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.IQueue queue) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(queue, "queue is required") });
}
/**
* Returns a configuration for an SQS queue to subscribe to an SNS topic.
*
* @param topic This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sns.TopicSubscriptionConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sns.ITopic topic) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sns.TopicSubscriptionConfig.class), new Object[] { java.util.Objects.requireNonNull(topic, "topic is required") });
}
/**
* A fluent builder for {@link software.amazon.awscdk.services.sns.subscriptions.SqsSubscription}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param queue This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.amazon.awscdk.services.sqs.IQueue queue) {
return new Builder(queue);
}
private final software.amazon.awscdk.services.sqs.IQueue queue;
private software.amazon.awscdk.services.sns.subscriptions.SqsSubscriptionProps.Builder props;
private Builder(final software.amazon.awscdk.services.sqs.IQueue queue) {
this.queue = queue;
}
/**
* Queue to be used as dead letter queue.
*
* If not passed no dead letter queue is enabled.
*
* Default: - No dead letter queue enabled.
*
* @return {@code this}
* @param deadLetterQueue Queue to be used as dead letter queue. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder deadLetterQueue(final software.amazon.awscdk.services.sqs.IQueue deadLetterQueue) {
this.props().deadLetterQueue(deadLetterQueue);
return this;
}
/**
* The filter policy.
*
* Default: - all messages are delivered
*
* @return {@code this}
* @param filterPolicy The filter policy. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder filterPolicy(final java.util.Map filterPolicy) {
this.props().filterPolicy(filterPolicy);
return this;
}
/**
* The message to the queue is the same as it was sent to the topic.
*
* If false, the message will be wrapped in an SNS envelope.
*
* Default: false
*
* @return {@code this}
* @param rawMessageDelivery The message to the queue is the same as it was sent to the topic. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder rawMessageDelivery(final java.lang.Boolean rawMessageDelivery) {
this.props().rawMessageDelivery(rawMessageDelivery);
return this;
}
/**
* @returns a newly built instance of {@link software.amazon.awscdk.services.sns.subscriptions.SqsSubscription}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.awscdk.services.sns.subscriptions.SqsSubscription build() {
return new software.amazon.awscdk.services.sns.subscriptions.SqsSubscription(
this.queue,
this.props != null ? this.props.build() : null
);
}
private software.amazon.awscdk.services.sns.subscriptions.SqsSubscriptionProps.Builder props() {
if (this.props == null) {
this.props = new software.amazon.awscdk.services.sns.subscriptions.SqsSubscriptionProps.Builder();
}
return this.props;
}
}
}