com.pepperize.cdk.ses_smtp_credentials.SesSmtpCredentialsProps Maven / Gradle / Ivy
Show all versions of cdk-ses-smtp-credentials Show documentation
package com.pepperize.cdk.ses_smtp_credentials;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-06-03T22:44:36.951Z")
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.ses_smtp_credentials.$Module.class, fqn = "@pepperize/cdk-ses-smtp-credentials.SesSmtpCredentialsProps")
@software.amazon.jsii.Jsii.Proxy(SesSmtpCredentialsProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface SesSmtpCredentialsProps extends software.amazon.jsii.JsiiSerializable {
/**
* Optional, an SecretsManager secret to write the AWS SES Smtp credentials to.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.secretsmanager.ISecret getSecret() {
return null;
}
/**
* The user for which to create an AWS Access Key and to generate the smtp password.
*
* If omitted a user will be created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.IUser getUser() {
return null;
}
/**
* Optional, a username to create a new user if no existing user is given.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getUserName() {
return null;
}
/**
* @return a {@link Builder} of {@link SesSmtpCredentialsProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SesSmtpCredentialsProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.secretsmanager.ISecret secret;
software.amazon.awscdk.services.iam.IUser user;
java.lang.String userName;
/**
* Sets the value of {@link SesSmtpCredentialsProps#getSecret}
* @param secret Optional, an SecretsManager secret to write the AWS SES Smtp credentials to.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder secret(software.amazon.awscdk.services.secretsmanager.ISecret secret) {
this.secret = secret;
return this;
}
/**
* Sets the value of {@link SesSmtpCredentialsProps#getUser}
* @param user The user for which to create an AWS Access Key and to generate the smtp password.
* If omitted a user will be created.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder user(software.amazon.awscdk.services.iam.IUser user) {
this.user = user;
return this;
}
/**
* Sets the value of {@link SesSmtpCredentialsProps#getUserName}
* @param userName Optional, a username to create a new user if no existing user is given.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder userName(java.lang.String userName) {
this.userName = userName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SesSmtpCredentialsProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public SesSmtpCredentialsProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SesSmtpCredentialsProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SesSmtpCredentialsProps {
private final software.amazon.awscdk.services.secretsmanager.ISecret secret;
private final software.amazon.awscdk.services.iam.IUser user;
private final java.lang.String userName;
/**
* 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.secret = software.amazon.jsii.Kernel.get(this, "secret", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.secretsmanager.ISecret.class));
this.user = software.amazon.jsii.Kernel.get(this, "user", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IUser.class));
this.userName = software.amazon.jsii.Kernel.get(this, "userName", 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.secret = builder.secret;
this.user = builder.user;
this.userName = builder.userName;
}
@Override
public final software.amazon.awscdk.services.secretsmanager.ISecret getSecret() {
return this.secret;
}
@Override
public final software.amazon.awscdk.services.iam.IUser getUser() {
return this.user;
}
@Override
public final java.lang.String getUserName() {
return this.userName;
}
@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();
if (this.getSecret() != null) {
data.set("secret", om.valueToTree(this.getSecret()));
}
if (this.getUser() != null) {
data.set("user", om.valueToTree(this.getUser()));
}
if (this.getUserName() != null) {
data.set("userName", om.valueToTree(this.getUserName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@pepperize/cdk-ses-smtp-credentials.SesSmtpCredentialsProps"));
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;
SesSmtpCredentialsProps.Jsii$Proxy that = (SesSmtpCredentialsProps.Jsii$Proxy) o;
if (this.secret != null ? !this.secret.equals(that.secret) : that.secret != null) return false;
if (this.user != null ? !this.user.equals(that.user) : that.user != null) return false;
return this.userName != null ? this.userName.equals(that.userName) : that.userName == null;
}
@Override
public final int hashCode() {
int result = this.secret != null ? this.secret.hashCode() : 0;
result = 31 * result + (this.user != null ? this.user.hashCode() : 0);
result = 31 * result + (this.userName != null ? this.userName.hashCode() : 0);
return result;
}
}
}