org.mongodb.awscdk.resources.mongodbatlas.CfnX509AuthenticationDatabaseUserProps Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* Generates one X.509 certificate for the specified MongoDB user. Atlas manages the certificate and MongoDB user that belong to one project. To use this resource, the requesting API Key must have the Project Atlas Admin role. This resource doesn't require the API Key to have an Access List.
*
* To get MongoDB Cloud to generate a managed certificate for a database user, set "x509Type" : "MANAGED"
on the desired MongoDB Database User.
*
* If you are managing your own Certificate Authority (CA) in Self-Managed X.509 mode, you must generate certificates for database users using your own CA.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:28.995Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.CfnX509AuthenticationDatabaseUserProps")
@software.amazon.jsii.Jsii.Proxy(CfnX509AuthenticationDatabaseUserProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface CfnX509AuthenticationDatabaseUserProps extends software.amazon.jsii.JsiiSerializable {
/**
* CustomerX509 represents Customer-managed X.509 configuration for an Atlas project.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.mongodb.awscdk.resources.mongodbatlas.CustomerX509 getCustomerX509() {
return null;
}
/**
* Profile used to provide credentials information, (a secret with the cfn/atlas/profile/{Profile}, is required), if not provided default is used.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getProfile() {
return null;
}
/**
* The unique identifier for the project .
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getProjectId() {
return null;
}
/**
* Username of the database user to create a certificate for.
*/
@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 CfnX509AuthenticationDatabaseUserProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CfnX509AuthenticationDatabaseUserProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
org.mongodb.awscdk.resources.mongodbatlas.CustomerX509 customerX509;
java.lang.String profile;
java.lang.String projectId;
java.lang.String userName;
/**
* Sets the value of {@link CfnX509AuthenticationDatabaseUserProps#getCustomerX509}
* @param customerX509 CustomerX509 represents Customer-managed X.509 configuration for an Atlas project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder customerX509(org.mongodb.awscdk.resources.mongodbatlas.CustomerX509 customerX509) {
this.customerX509 = customerX509;
return this;
}
/**
* Sets the value of {@link CfnX509AuthenticationDatabaseUserProps#getProfile}
* @param profile Profile used to provide credentials information, (a secret with the cfn/atlas/profile/{Profile}, is required), if not provided default is used.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder profile(java.lang.String profile) {
this.profile = profile;
return this;
}
/**
* Sets the value of {@link CfnX509AuthenticationDatabaseUserProps#getProjectId}
* @param projectId The unique identifier for the project .
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder projectId(java.lang.String projectId) {
this.projectId = projectId;
return this;
}
/**
* Sets the value of {@link CfnX509AuthenticationDatabaseUserProps#getUserName}
* @param userName Username of the database user to create a certificate for.
* @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 CfnX509AuthenticationDatabaseUserProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public CfnX509AuthenticationDatabaseUserProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CfnX509AuthenticationDatabaseUserProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CfnX509AuthenticationDatabaseUserProps {
private final org.mongodb.awscdk.resources.mongodbatlas.CustomerX509 customerX509;
private final java.lang.String profile;
private final java.lang.String projectId;
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.customerX509 = software.amazon.jsii.Kernel.get(this, "customerX509", software.amazon.jsii.NativeType.forClass(org.mongodb.awscdk.resources.mongodbatlas.CustomerX509.class));
this.profile = software.amazon.jsii.Kernel.get(this, "profile", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.projectId = software.amazon.jsii.Kernel.get(this, "projectId", 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.customerX509 = builder.customerX509;
this.profile = builder.profile;
this.projectId = builder.projectId;
this.userName = builder.userName;
}
@Override
public final org.mongodb.awscdk.resources.mongodbatlas.CustomerX509 getCustomerX509() {
return this.customerX509;
}
@Override
public final java.lang.String getProfile() {
return this.profile;
}
@Override
public final java.lang.String getProjectId() {
return this.projectId;
}
@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.getCustomerX509() != null) {
data.set("customerX509", om.valueToTree(this.getCustomerX509()));
}
if (this.getProfile() != null) {
data.set("profile", om.valueToTree(this.getProfile()));
}
if (this.getProjectId() != null) {
data.set("projectId", om.valueToTree(this.getProjectId()));
}
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.CfnX509AuthenticationDatabaseUserProps"));
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;
CfnX509AuthenticationDatabaseUserProps.Jsii$Proxy that = (CfnX509AuthenticationDatabaseUserProps.Jsii$Proxy) o;
if (this.customerX509 != null ? !this.customerX509.equals(that.customerX509) : that.customerX509 != null) return false;
if (this.profile != null ? !this.profile.equals(that.profile) : that.profile != null) return false;
if (this.projectId != null ? !this.projectId.equals(that.projectId) : that.projectId != null) return false;
return this.userName != null ? this.userName.equals(that.userName) : that.userName == null;
}
@Override
public final int hashCode() {
int result = this.customerX509 != null ? this.customerX509.hashCode() : 0;
result = 31 * result + (this.profile != null ? this.profile.hashCode() : 0);
result = 31 * result + (this.projectId != null ? this.projectId.hashCode() : 0);
result = 31 * result + (this.userName != null ? this.userName.hashCode() : 0);
return result;
}
}
}