software.amazon.awscdk.services.ses.actions.BounceTemplateProps Maven / Gradle / Ivy
Show all versions of ses-actions Show documentation
package software.amazon.awscdk.services.ses.actions;
/**
* Construction properties for a BounceTemplate.
*
* 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.*;
* BounceTemplateProps bounceTemplateProps = BounceTemplateProps.builder()
* .message("message")
* .smtpReplyCode("smtpReplyCode")
* // the properties below are optional
* .statusCode("statusCode")
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.71.0 (build f1f58ae)", date = "2022-11-18T02:14:11.675Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ses.actions.$Module.class, fqn = "@aws-cdk/aws-ses-actions.BounceTemplateProps")
@software.amazon.jsii.Jsii.Proxy(BounceTemplateProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface BounceTemplateProps extends software.amazon.jsii.JsiiSerializable {
/**
* Human-readable text to include in the bounce message.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getMessage();
/**
* The SMTP reply code, as defined by RFC 5321.
*
* @see https://tools.ietf.org/html/rfc5321
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getSmtpReplyCode();
/**
* The SMTP enhanced status code, as defined by RFC 3463.
*
* @see https://tools.ietf.org/html/rfc3463
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getStatusCode() {
return null;
}
/**
* @return a {@link Builder} of {@link BounceTemplateProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link BounceTemplateProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String message;
java.lang.String smtpReplyCode;
java.lang.String statusCode;
/**
* Sets the value of {@link BounceTemplateProps#getMessage}
* @param message Human-readable text to include in the bounce message. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder message(java.lang.String message) {
this.message = message;
return this;
}
/**
* Sets the value of {@link BounceTemplateProps#getSmtpReplyCode}
* @param smtpReplyCode The SMTP reply code, as defined by RFC 5321. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder smtpReplyCode(java.lang.String smtpReplyCode) {
this.smtpReplyCode = smtpReplyCode;
return this;
}
/**
* Sets the value of {@link BounceTemplateProps#getStatusCode}
* @param statusCode The SMTP enhanced status code, as defined by RFC 3463.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder statusCode(java.lang.String statusCode) {
this.statusCode = statusCode;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link BounceTemplateProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public BounceTemplateProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link BounceTemplateProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BounceTemplateProps {
private final java.lang.String message;
private final java.lang.String smtpReplyCode;
private final java.lang.String statusCode;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.message = software.amazon.jsii.Kernel.get(this, "message", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.smtpReplyCode = software.amazon.jsii.Kernel.get(this, "smtpReplyCode", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.statusCode = software.amazon.jsii.Kernel.get(this, "statusCode", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.message = java.util.Objects.requireNonNull(builder.message, "message is required");
this.smtpReplyCode = java.util.Objects.requireNonNull(builder.smtpReplyCode, "smtpReplyCode is required");
this.statusCode = builder.statusCode;
}
@Override
public final java.lang.String getMessage() {
return this.message;
}
@Override
public final java.lang.String getSmtpReplyCode() {
return this.smtpReplyCode;
}
@Override
public final java.lang.String getStatusCode() {
return this.statusCode;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("message", om.valueToTree(this.getMessage()));
data.set("smtpReplyCode", om.valueToTree(this.getSmtpReplyCode()));
if (this.getStatusCode() != null) {
data.set("statusCode", om.valueToTree(this.getStatusCode()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-ses-actions.BounceTemplateProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BounceTemplateProps.Jsii$Proxy that = (BounceTemplateProps.Jsii$Proxy) o;
if (!message.equals(that.message)) return false;
if (!smtpReplyCode.equals(that.smtpReplyCode)) return false;
return this.statusCode != null ? this.statusCode.equals(that.statusCode) : that.statusCode == null;
}
@Override
public final int hashCode() {
int result = this.message.hashCode();
result = 31 * result + (this.smtpReplyCode.hashCode());
result = 31 * result + (this.statusCode != null ? this.statusCode.hashCode() : 0);
return result;
}
}
}