com.pepperize.cdk.autoscaling_gitlab_runner.MachineConfiguration Maven / Gradle / Ivy
Show all versions of cdk-autoscaling-gitlab-runner Show documentation
package com.pepperize.cdk.autoscaling_gitlab_runner;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-01T02:44:42.324Z")
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.autoscaling_gitlab_runner.$Module.class, fqn = "@pepperize/cdk-autoscaling-gitlab-runner.MachineConfiguration")
@software.amazon.jsii.Jsii.Proxy(MachineConfiguration.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface MachineConfiguration extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getAutoscaling() {
return null;
}
/**
* Number of machines that need to be created and waiting in Idle state.
*
* Default: 0
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getIdleCount() {
return null;
}
/**
* Time (in seconds) for machine to be in Idle state before it is removed.
*
* Default: 300
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getIdleTime() {
return null;
}
/**
* Docker Machine driver.
*
* Default: "amazonec2"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMachineDriver() {
return null;
}
/**
* Default: "gitlab-runner"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getMachineName() {
return null;
}
/**
* Docker Machine options passed to the Docker Machine driver.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions getMachineOptions() {
return null;
}
/**
* Maximum job (build) count before machine is removed.
*
* Default: 20
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxBuilds() {
return null;
}
/**
* @return a {@link Builder} of {@link MachineConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link MachineConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List autoscaling;
java.lang.Number idleCount;
java.lang.Number idleTime;
java.lang.String machineDriver;
java.lang.String machineName;
com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions machineOptions;
java.lang.Number maxBuilds;
/**
* Sets the value of {@link MachineConfiguration#getAutoscaling}
* @param autoscaling the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@SuppressWarnings("unchecked")
public Builder autoscaling(java.util.List extends com.pepperize.cdk.autoscaling_gitlab_runner.AutoscalingConfiguration> autoscaling) {
this.autoscaling = (java.util.List)autoscaling;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getIdleCount}
* @param idleCount Number of machines that need to be created and waiting in Idle state.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder idleCount(java.lang.Number idleCount) {
this.idleCount = idleCount;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getIdleTime}
* @param idleTime Time (in seconds) for machine to be in Idle state before it is removed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder idleTime(java.lang.Number idleTime) {
this.idleTime = idleTime;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getMachineDriver}
* @param machineDriver Docker Machine driver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder machineDriver(java.lang.String machineDriver) {
this.machineDriver = machineDriver;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getMachineName}
* @param machineName the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder machineName(java.lang.String machineName) {
this.machineName = machineName;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getMachineOptions}
* @param machineOptions Docker Machine options passed to the Docker Machine driver.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder machineOptions(com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions machineOptions) {
this.machineOptions = machineOptions;
return this;
}
/**
* Sets the value of {@link MachineConfiguration#getMaxBuilds}
* @param maxBuilds Maximum job (build) count before machine is removed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder maxBuilds(java.lang.Number maxBuilds) {
this.maxBuilds = maxBuilds;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link MachineConfiguration}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public MachineConfiguration build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link MachineConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements MachineConfiguration {
private final java.util.List autoscaling;
private final java.lang.Number idleCount;
private final java.lang.Number idleTime;
private final java.lang.String machineDriver;
private final java.lang.String machineName;
private final com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions machineOptions;
private final java.lang.Number maxBuilds;
/**
* 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.autoscaling = software.amazon.jsii.Kernel.get(this, "autoscaling", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(com.pepperize.cdk.autoscaling_gitlab_runner.AutoscalingConfiguration.class)));
this.idleCount = software.amazon.jsii.Kernel.get(this, "idleCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.idleTime = software.amazon.jsii.Kernel.get(this, "idleTime", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.machineDriver = software.amazon.jsii.Kernel.get(this, "machineDriver", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.machineName = software.amazon.jsii.Kernel.get(this, "machineName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.machineOptions = software.amazon.jsii.Kernel.get(this, "machineOptions", software.amazon.jsii.NativeType.forClass(com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions.class));
this.maxBuilds = software.amazon.jsii.Kernel.get(this, "maxBuilds", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.autoscaling = (java.util.List)builder.autoscaling;
this.idleCount = builder.idleCount;
this.idleTime = builder.idleTime;
this.machineDriver = builder.machineDriver;
this.machineName = builder.machineName;
this.machineOptions = builder.machineOptions;
this.maxBuilds = builder.maxBuilds;
}
@Override
public final java.util.List getAutoscaling() {
return this.autoscaling;
}
@Override
public final java.lang.Number getIdleCount() {
return this.idleCount;
}
@Override
public final java.lang.Number getIdleTime() {
return this.idleTime;
}
@Override
public final java.lang.String getMachineDriver() {
return this.machineDriver;
}
@Override
public final java.lang.String getMachineName() {
return this.machineName;
}
@Override
public final com.pepperize.cdk.autoscaling_gitlab_runner.MachineOptions getMachineOptions() {
return this.machineOptions;
}
@Override
public final java.lang.Number getMaxBuilds() {
return this.maxBuilds;
}
@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.getAutoscaling() != null) {
data.set("autoscaling", om.valueToTree(this.getAutoscaling()));
}
if (this.getIdleCount() != null) {
data.set("idleCount", om.valueToTree(this.getIdleCount()));
}
if (this.getIdleTime() != null) {
data.set("idleTime", om.valueToTree(this.getIdleTime()));
}
if (this.getMachineDriver() != null) {
data.set("machineDriver", om.valueToTree(this.getMachineDriver()));
}
if (this.getMachineName() != null) {
data.set("machineName", om.valueToTree(this.getMachineName()));
}
if (this.getMachineOptions() != null) {
data.set("machineOptions", om.valueToTree(this.getMachineOptions()));
}
if (this.getMaxBuilds() != null) {
data.set("maxBuilds", om.valueToTree(this.getMaxBuilds()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@pepperize/cdk-autoscaling-gitlab-runner.MachineConfiguration"));
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;
MachineConfiguration.Jsii$Proxy that = (MachineConfiguration.Jsii$Proxy) o;
if (this.autoscaling != null ? !this.autoscaling.equals(that.autoscaling) : that.autoscaling != null) return false;
if (this.idleCount != null ? !this.idleCount.equals(that.idleCount) : that.idleCount != null) return false;
if (this.idleTime != null ? !this.idleTime.equals(that.idleTime) : that.idleTime != null) return false;
if (this.machineDriver != null ? !this.machineDriver.equals(that.machineDriver) : that.machineDriver != null) return false;
if (this.machineName != null ? !this.machineName.equals(that.machineName) : that.machineName != null) return false;
if (this.machineOptions != null ? !this.machineOptions.equals(that.machineOptions) : that.machineOptions != null) return false;
return this.maxBuilds != null ? this.maxBuilds.equals(that.maxBuilds) : that.maxBuilds == null;
}
@Override
public final int hashCode() {
int result = this.autoscaling != null ? this.autoscaling.hashCode() : 0;
result = 31 * result + (this.idleCount != null ? this.idleCount.hashCode() : 0);
result = 31 * result + (this.idleTime != null ? this.idleTime.hashCode() : 0);
result = 31 * result + (this.machineDriver != null ? this.machineDriver.hashCode() : 0);
result = 31 * result + (this.machineName != null ? this.machineName.hashCode() : 0);
result = 31 * result + (this.machineOptions != null ? this.machineOptions.hashCode() : 0);
result = 31 * result + (this.maxBuilds != null ? this.maxBuilds.hashCode() : 0);
return result;
}
}
}