ca.wheatstalk.cdkecskeycloak.DatabaseInstanceProviderProps Maven / Gradle / Ivy
Show all versions of cdk-ecs-keycloak Show documentation
package ca.wheatstalk.cdkecskeycloak;
/**
* Basic props for creating a database instance.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.29.0 (build 41df200)", date = "2021-04-28T04:27:48.340Z")
@software.amazon.jsii.Jsii(module = ca.wheatstalk.cdkecskeycloak.$Module.class, fqn = "@wheatstalk/cdk-ecs-keycloak.DatabaseInstanceProviderProps")
@software.amazon.jsii.Jsii.Proxy(DatabaseInstanceProviderProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface DatabaseInstanceProviderProps extends software.amazon.jsii.JsiiSerializable {
/**
* Instance database engine.
*
* Default: - mysql 8.0
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.rds.IInstanceEngine getEngine() {
return null;
}
/**
* Instance type.
*
* Default: - t2.micro
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.InstanceType getInstanceType() {
return null;
}
/**
* Select subnets to register the database instance in.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetSelection getSubnets() {
return null;
}
/**
* @return a {@link Builder} of {@link DatabaseInstanceProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DatabaseInstanceProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
private software.amazon.awscdk.services.rds.IInstanceEngine engine;
private software.amazon.awscdk.services.ec2.InstanceType instanceType;
private software.amazon.awscdk.services.ec2.SubnetSelection subnets;
/**
* Sets the value of {@link DatabaseInstanceProviderProps#getEngine}
* @param engine Instance database engine.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder engine(software.amazon.awscdk.services.rds.IInstanceEngine engine) {
this.engine = engine;
return this;
}
/**
* Sets the value of {@link DatabaseInstanceProviderProps#getInstanceType}
* @param instanceType Instance type.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder instanceType(software.amazon.awscdk.services.ec2.InstanceType instanceType) {
this.instanceType = instanceType;
return this;
}
/**
* Sets the value of {@link DatabaseInstanceProviderProps#getSubnets}
* @param subnets Select subnets to register the database instance in.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder subnets(software.amazon.awscdk.services.ec2.SubnetSelection subnets) {
this.subnets = subnets;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DatabaseInstanceProviderProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public DatabaseInstanceProviderProps build() {
return new Jsii$Proxy(engine, instanceType, subnets);
}
}
/**
* An implementation for {@link DatabaseInstanceProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DatabaseInstanceProviderProps {
private final software.amazon.awscdk.services.rds.IInstanceEngine engine;
private final software.amazon.awscdk.services.ec2.InstanceType instanceType;
private final software.amazon.awscdk.services.ec2.SubnetSelection subnets;
/**
* 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.engine = software.amazon.jsii.Kernel.get(this, "engine", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.rds.IInstanceEngine.class));
this.instanceType = software.amazon.jsii.Kernel.get(this, "instanceType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.InstanceType.class));
this.subnets = software.amazon.jsii.Kernel.get(this, "subnets", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetSelection.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final software.amazon.awscdk.services.rds.IInstanceEngine engine, final software.amazon.awscdk.services.ec2.InstanceType instanceType, final software.amazon.awscdk.services.ec2.SubnetSelection subnets) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.engine = engine;
this.instanceType = instanceType;
this.subnets = subnets;
}
@Override
public final software.amazon.awscdk.services.rds.IInstanceEngine getEngine() {
return this.engine;
}
@Override
public final software.amazon.awscdk.services.ec2.InstanceType getInstanceType() {
return this.instanceType;
}
@Override
public final software.amazon.awscdk.services.ec2.SubnetSelection getSubnets() {
return this.subnets;
}
@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.getEngine() != null) {
data.set("engine", om.valueToTree(this.getEngine()));
}
if (this.getInstanceType() != null) {
data.set("instanceType", om.valueToTree(this.getInstanceType()));
}
if (this.getSubnets() != null) {
data.set("subnets", om.valueToTree(this.getSubnets()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@wheatstalk/cdk-ecs-keycloak.DatabaseInstanceProviderProps"));
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;
DatabaseInstanceProviderProps.Jsii$Proxy that = (DatabaseInstanceProviderProps.Jsii$Proxy) o;
if (this.engine != null ? !this.engine.equals(that.engine) : that.engine != null) return false;
if (this.instanceType != null ? !this.instanceType.equals(that.instanceType) : that.instanceType != null) return false;
return this.subnets != null ? this.subnets.equals(that.subnets) : that.subnets == null;
}
@Override
public final int hashCode() {
int result = this.engine != null ? this.engine.hashCode() : 0;
result = 31 * result + (this.instanceType != null ? this.instanceType.hashCode() : 0);
result = 31 * result + (this.subnets != null ? this.subnets.hashCode() : 0);
return result;
}
}
}