software.amazon.awscdk.services.ses.actions.Bounce Maven / Gradle / Ivy
Show all versions of ses-actions Show documentation
package software.amazon.awscdk.services.ses.actions;
/**
* Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon SNS.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.ses.actions.*;
* import software.amazon.awscdk.services.sns.*;
* BounceTemplate bounceTemplate;
* Topic topic;
* Bounce bounce = Bounce.Builder.create()
* .sender("sender")
* .template(bounceTemplate)
* // the properties below are optional
* .topic(topic)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.74.0 (build 6d08790)", date = "2023-02-21T19:24:07.409Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ses.actions.$Module.class, fqn = "@aws-cdk/aws-ses-actions.Bounce")
public class Bounce extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.ses.IReceiptRuleAction {
protected Bounce(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Bounce(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Bounce(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ses.actions.BounceProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* Returns the receipt rule action specification.
*
* @param _rule This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ses.ReceiptRuleActionConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ses.IReceiptRule _rule) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ses.ReceiptRuleActionConfig.class), new Object[] { java.util.Objects.requireNonNull(_rule, "_rule is required") });
}
/**
* A fluent builder for {@link software.amazon.awscdk.services.ses.actions.Bounce}.
*/
@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}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create() {
return new Builder();
}
private final software.amazon.awscdk.services.ses.actions.BounceProps.Builder props;
private Builder() {
this.props = new software.amazon.awscdk.services.ses.actions.BounceProps.Builder();
}
/**
* The email address of the sender of the bounced email.
*
* This is the address
* from which the bounce message will be sent.
*
* @return {@code this}
* @param sender The email address of the sender of the bounced email. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder sender(final java.lang.String sender) {
this.props.sender(sender);
return this;
}
/**
* The template containing the message, reply code and status code.
*
* @return {@code this}
* @param template The template containing the message, reply code and status code. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder template(final software.amazon.awscdk.services.ses.actions.BounceTemplate template) {
this.props.template(template);
return this;
}
/**
* The SNS topic to notify when the bounce action is taken.
*
* Default: no notification
*
* @return {@code this}
* @param topic The SNS topic to notify when the bounce action is taken. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder topic(final software.amazon.awscdk.services.sns.ITopic topic) {
this.props.topic(topic);
return this;
}
/**
* @returns a newly built instance of {@link software.amazon.awscdk.services.ses.actions.Bounce}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public software.amazon.awscdk.services.ses.actions.Bounce build() {
return new software.amazon.awscdk.services.ses.actions.Bounce(
this.props.build()
);
}
}
}