org.mongodb.awscdk.resources.mongodbatlas.Compute Maven / Gradle / Ivy
Show all versions of awscdk-resources-mongodbatlas Show documentation
package org.mongodb.awscdk.resources.mongodbatlas;
/**
* Automatic Compute Scaling.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.101.0 (build b95fe5d)", date = "2024-07-30T09:54:28.996Z")
@software.amazon.jsii.Jsii(module = org.mongodb.awscdk.resources.mongodbatlas.$Module.class, fqn = "awscdk-resources-mongodbatlas.Compute")
@software.amazon.jsii.Jsii.Proxy(Compute.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface Compute extends software.amazon.jsii.JsiiSerializable {
/**
* Flag that indicates whether someone enabled instance size auto-scaling.
*
* Set to true to enable instance size auto-scaling. If enabled, you must specify a value for replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize.
* Set to false to disable instance size automatic scaling.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getEnabled() {
return null;
}
/**
* Maximum instance size to which your cluster can automatically scale.
*
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMaxInstanceSize() {
return null;
}
/**
* Minimum instance size to which your cluster can automatically scale.
*
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMinInstanceSize() {
return null;
}
/**
* Flag that indicates whether the instance size may scale down.
*
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true. If you enable this option, specify a value for replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getScaleDownEnabled() {
return null;
}
/**
* @return a {@link Builder} of {@link Compute}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link Compute}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean enabled;
java.lang.String maxInstanceSize;
java.lang.String minInstanceSize;
java.lang.Boolean scaleDownEnabled;
/**
* Sets the value of {@link Compute#getEnabled}
* @param enabled Flag that indicates whether someone enabled instance size auto-scaling.
* Set to true to enable instance size auto-scaling. If enabled, you must specify a value for replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize.
* Set to false to disable instance size automatic scaling.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder enabled(java.lang.Boolean enabled) {
this.enabled = enabled;
return this;
}
/**
* Sets the value of {@link Compute#getMaxInstanceSize}
* @param maxInstanceSize Maximum instance size to which your cluster can automatically scale.
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder maxInstanceSize(java.lang.String maxInstanceSize) {
this.maxInstanceSize = maxInstanceSize;
return this;
}
/**
* Sets the value of {@link Compute#getMinInstanceSize}
* @param minInstanceSize Minimum instance size to which your cluster can automatically scale.
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder minInstanceSize(java.lang.String minInstanceSize) {
this.minInstanceSize = minInstanceSize;
return this;
}
/**
* Sets the value of {@link Compute#getScaleDownEnabled}
* @param scaleDownEnabled Flag that indicates whether the instance size may scale down.
* MongoDB Cloud requires this parameter if "replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled" : true. If you enable this option, specify a value for replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder scaleDownEnabled(java.lang.Boolean scaleDownEnabled) {
this.scaleDownEnabled = scaleDownEnabled;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link Compute}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public Compute build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link Compute}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements Compute {
private final java.lang.Boolean enabled;
private final java.lang.String maxInstanceSize;
private final java.lang.String minInstanceSize;
private final java.lang.Boolean scaleDownEnabled;
/**
* 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.enabled = software.amazon.jsii.Kernel.get(this, "enabled", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.maxInstanceSize = software.amazon.jsii.Kernel.get(this, "maxInstanceSize", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.minInstanceSize = software.amazon.jsii.Kernel.get(this, "minInstanceSize", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.scaleDownEnabled = software.amazon.jsii.Kernel.get(this, "scaleDownEnabled", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.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.enabled = builder.enabled;
this.maxInstanceSize = builder.maxInstanceSize;
this.minInstanceSize = builder.minInstanceSize;
this.scaleDownEnabled = builder.scaleDownEnabled;
}
@Override
public final java.lang.Boolean getEnabled() {
return this.enabled;
}
@Override
public final java.lang.String getMaxInstanceSize() {
return this.maxInstanceSize;
}
@Override
public final java.lang.String getMinInstanceSize() {
return this.minInstanceSize;
}
@Override
public final java.lang.Boolean getScaleDownEnabled() {
return this.scaleDownEnabled;
}
@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.getEnabled() != null) {
data.set("enabled", om.valueToTree(this.getEnabled()));
}
if (this.getMaxInstanceSize() != null) {
data.set("maxInstanceSize", om.valueToTree(this.getMaxInstanceSize()));
}
if (this.getMinInstanceSize() != null) {
data.set("minInstanceSize", om.valueToTree(this.getMinInstanceSize()));
}
if (this.getScaleDownEnabled() != null) {
data.set("scaleDownEnabled", om.valueToTree(this.getScaleDownEnabled()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-resources-mongodbatlas.Compute"));
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;
Compute.Jsii$Proxy that = (Compute.Jsii$Proxy) o;
if (this.enabled != null ? !this.enabled.equals(that.enabled) : that.enabled != null) return false;
if (this.maxInstanceSize != null ? !this.maxInstanceSize.equals(that.maxInstanceSize) : that.maxInstanceSize != null) return false;
if (this.minInstanceSize != null ? !this.minInstanceSize.equals(that.minInstanceSize) : that.minInstanceSize != null) return false;
return this.scaleDownEnabled != null ? this.scaleDownEnabled.equals(that.scaleDownEnabled) : that.scaleDownEnabled == null;
}
@Override
public final int hashCode() {
int result = this.enabled != null ? this.enabled.hashCode() : 0;
result = 31 * result + (this.maxInstanceSize != null ? this.maxInstanceSize.hashCode() : 0);
result = 31 * result + (this.minInstanceSize != null ? this.minInstanceSize.hashCode() : 0);
result = 31 * result + (this.scaleDownEnabled != null ? this.scaleDownEnabled.hashCode() : 0);
return result;
}
}
}