org.mongodb.awscdk.resources.mongodbatlas.StreamsKafkaAuthentication Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* User credentials required to connect to a Kafka Cluster.
*
* Includes the authentication type, as well as the parameters for that authentication mode.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:29.064Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.StreamsKafkaAuthentication")
@software.amazon.jsii.Jsii.Proxy(StreamsKafkaAuthentication.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface StreamsKafkaAuthentication extends software.amazon.jsii.JsiiSerializable {
/**
* Style of authentication.
*
* Can be one of PLAIN, SCRAM-256, or SCRAM-512.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMechanism() {
return null;
}
/**
* Password of the account to connect to the Kafka cluster.
*
* Review AWS security best practices for CloudFormation to manage credentials.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getPassword() {
return null;
}
/**
* Username of the account to connect to the Kafka cluster.
*/
@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 StreamsKafkaAuthentication}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StreamsKafkaAuthentication}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String mechanism;
java.lang.String password;
java.lang.String username;
/**
* Sets the value of {@link StreamsKafkaAuthentication#getMechanism}
* @param mechanism Style of authentication.
* Can be one of PLAIN, SCRAM-256, or SCRAM-512.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder mechanism(java.lang.String mechanism) {
this.mechanism = mechanism;
return this;
}
/**
* Sets the value of {@link StreamsKafkaAuthentication#getPassword}
* @param password Password of the account to connect to the Kafka cluster.
* Review AWS security best practices for CloudFormation to manage credentials.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder password(java.lang.String password) {
this.password = password;
return this;
}
/**
* Sets the value of {@link StreamsKafkaAuthentication#getUsername}
* @param username Username of the account to connect to the Kafka cluster.
* @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 StreamsKafkaAuthentication}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public StreamsKafkaAuthentication build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link StreamsKafkaAuthentication}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StreamsKafkaAuthentication {
private final java.lang.String mechanism;
private final java.lang.String password;
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.mechanism = software.amazon.jsii.Kernel.get(this, "mechanism", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.password = software.amazon.jsii.Kernel.get(this, "password", software.amazon.jsii.NativeType.forClass(java.lang.String.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.mechanism = builder.mechanism;
this.password = builder.password;
this.username = builder.username;
}
@Override
public final java.lang.String getMechanism() {
return this.mechanism;
}
@Override
public final java.lang.String getPassword() {
return this.password;
}
@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.getMechanism() != null) {
data.set("mechanism", om.valueToTree(this.getMechanism()));
}
if (this.getPassword() != null) {
data.set("password", om.valueToTree(this.getPassword()));
}
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("awscdk-resources-mongodbatlas.StreamsKafkaAuthentication"));
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;
StreamsKafkaAuthentication.Jsii$Proxy that = (StreamsKafkaAuthentication.Jsii$Proxy) o;
if (this.mechanism != null ? !this.mechanism.equals(that.mechanism) : that.mechanism != null) return false;
if (this.password != null ? !this.password.equals(that.password) : that.password != null) return false;
return this.username != null ? this.username.equals(that.username) : that.username == null;
}
@Override
public final int hashCode() {
int result = this.mechanism != null ? this.mechanism.hashCode() : 0;
result = 31 * result + (this.password != null ? this.password.hashCode() : 0);
result = 31 * result + (this.username != null ? this.username.hashCode() : 0);
return result;
}
}
}