com.pepperize.cdk.autoscaling_gitlab_runner.GlobalConfiguration Maven / Gradle / Ivy
Show all versions of cdk-autoscaling-gitlab-runner Show documentation
package com.pepperize.cdk.autoscaling_gitlab_runner;
/**
* You can change the behavior of GitLab Runner and of individual registered runners.
*
* This imitates the structure of Gitlab Runner advanced configuration that originally is set with config.toml file.
*
* @see https://docs.gitlab.com/runner/configuration/advanced-configuration.html
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-01T02:44:42.323Z")
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.autoscaling_gitlab_runner.$Module.class, fqn = "@pepperize/cdk-autoscaling-gitlab-runner.GlobalConfiguration")
@software.amazon.jsii.Jsii.Proxy(GlobalConfiguration.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface GlobalConfiguration extends software.amazon.jsii.JsiiSerializable {
/**
* The check_interval option defines how often the runner should check GitLab for new jobs| in seconds.
*
* Default: 0
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getCheckInterval() {
return null;
}
/**
* The limit of the jobs that can be run concurrently across all runners (concurrent).
*
* Default: 10
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getConcurrent() {
return null;
}
/**
* The log format.
*
* Default: "runner"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getLogFormat() {
return null;
}
/**
* The log_level.
*
* Default: "info"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getLogLevel() {
return null;
}
/**
* @return a {@link Builder} of {@link GlobalConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GlobalConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Number checkInterval;
java.lang.Number concurrent;
java.lang.String logFormat;
java.lang.String logLevel;
/**
* Sets the value of {@link GlobalConfiguration#getCheckInterval}
* @param checkInterval The check_interval option defines how often the runner should check GitLab for new jobs| in seconds.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder checkInterval(java.lang.Number checkInterval) {
this.checkInterval = checkInterval;
return this;
}
/**
* Sets the value of {@link GlobalConfiguration#getConcurrent}
* @param concurrent The limit of the jobs that can be run concurrently across all runners (concurrent).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder concurrent(java.lang.Number concurrent) {
this.concurrent = concurrent;
return this;
}
/**
* Sets the value of {@link GlobalConfiguration#getLogFormat}
* @param logFormat The log format.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logFormat(java.lang.String logFormat) {
this.logFormat = logFormat;
return this;
}
/**
* Sets the value of {@link GlobalConfiguration#getLogLevel}
* @param logLevel The log_level.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logLevel(java.lang.String logLevel) {
this.logLevel = logLevel;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GlobalConfiguration}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public GlobalConfiguration build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link GlobalConfiguration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements GlobalConfiguration {
private final java.lang.Number checkInterval;
private final java.lang.Number concurrent;
private final java.lang.String logFormat;
private final java.lang.String logLevel;
/**
* 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.checkInterval = software.amazon.jsii.Kernel.get(this, "checkInterval", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.concurrent = software.amazon.jsii.Kernel.get(this, "concurrent", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.logFormat = software.amazon.jsii.Kernel.get(this, "logFormat", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.logLevel = software.amazon.jsii.Kernel.get(this, "logLevel", 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.checkInterval = builder.checkInterval;
this.concurrent = builder.concurrent;
this.logFormat = builder.logFormat;
this.logLevel = builder.logLevel;
}
@Override
public final java.lang.Number getCheckInterval() {
return this.checkInterval;
}
@Override
public final java.lang.Number getConcurrent() {
return this.concurrent;
}
@Override
public final java.lang.String getLogFormat() {
return this.logFormat;
}
@Override
public final java.lang.String getLogLevel() {
return this.logLevel;
}
@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.getCheckInterval() != null) {
data.set("checkInterval", om.valueToTree(this.getCheckInterval()));
}
if (this.getConcurrent() != null) {
data.set("concurrent", om.valueToTree(this.getConcurrent()));
}
if (this.getLogFormat() != null) {
data.set("logFormat", om.valueToTree(this.getLogFormat()));
}
if (this.getLogLevel() != null) {
data.set("logLevel", om.valueToTree(this.getLogLevel()));
}
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.GlobalConfiguration"));
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;
GlobalConfiguration.Jsii$Proxy that = (GlobalConfiguration.Jsii$Proxy) o;
if (this.checkInterval != null ? !this.checkInterval.equals(that.checkInterval) : that.checkInterval != null) return false;
if (this.concurrent != null ? !this.concurrent.equals(that.concurrent) : that.concurrent != null) return false;
if (this.logFormat != null ? !this.logFormat.equals(that.logFormat) : that.logFormat != null) return false;
return this.logLevel != null ? this.logLevel.equals(that.logLevel) : that.logLevel == null;
}
@Override
public final int hashCode() {
int result = this.checkInterval != null ? this.checkInterval.hashCode() : 0;
result = 31 * result + (this.concurrent != null ? this.concurrent.hashCode() : 0);
result = 31 * result + (this.logFormat != null ? this.logFormat.hashCode() : 0);
result = 31 * result + (this.logLevel != null ? this.logLevel.hashCode() : 0);
return result;
}
}
}