com.github.eladb.watchful.WatchEcsServiceOptions Maven / Gradle / Ivy
Show all versions of cdk-watchful Show documentation
package com.github.eladb.watchful;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.13.0 (build 385c325)", date = "2020-10-05T09:37:29.736Z")
@software.amazon.jsii.Jsii(module = com.github.eladb.watchful.$Module.class, fqn = "cdk-watchful.WatchEcsServiceOptions")
@software.amazon.jsii.Jsii.Proxy(WatchEcsServiceOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface WatchEcsServiceOptions extends software.amazon.jsii.JsiiSerializable {
/**
* Threshold for the Cpu Maximum utilization.
*
* Default: 80
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getCpuMaximumThresholdPercent() {
return null;
}
/**
* Threshold for the Memory Maximum utilization.
*
* Default: - 0.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getMemoryMaximumThresholdPercent() {
return null;
}
/**
* Threshold for the Number of Requests.
*
* Default: - 0.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getRequestsThreshold() {
return null;
}
/**
* Threshold for the Target Response Time.
*
* Default: - 0.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Number getTargetResponseTimeThreshold() {
return null;
}
/**
* @return a {@link Builder} of {@link WatchEcsServiceOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link WatchEcsServiceOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.Number cpuMaximumThresholdPercent;
private java.lang.Number memoryMaximumThresholdPercent;
private java.lang.Number requestsThreshold;
private java.lang.Number targetResponseTimeThreshold;
/**
* Sets the value of {@link WatchEcsServiceOptions#getCpuMaximumThresholdPercent}
* @param cpuMaximumThresholdPercent Threshold for the Cpu Maximum utilization.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cpuMaximumThresholdPercent(java.lang.Number cpuMaximumThresholdPercent) {
this.cpuMaximumThresholdPercent = cpuMaximumThresholdPercent;
return this;
}
/**
* Sets the value of {@link WatchEcsServiceOptions#getMemoryMaximumThresholdPercent}
* @param memoryMaximumThresholdPercent Threshold for the Memory Maximum utilization.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memoryMaximumThresholdPercent(java.lang.Number memoryMaximumThresholdPercent) {
this.memoryMaximumThresholdPercent = memoryMaximumThresholdPercent;
return this;
}
/**
* Sets the value of {@link WatchEcsServiceOptions#getRequestsThreshold}
* @param requestsThreshold Threshold for the Number of Requests.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder requestsThreshold(java.lang.Number requestsThreshold) {
this.requestsThreshold = requestsThreshold;
return this;
}
/**
* Sets the value of {@link WatchEcsServiceOptions#getTargetResponseTimeThreshold}
* @param targetResponseTimeThreshold Threshold for the Target Response Time.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder targetResponseTimeThreshold(java.lang.Number targetResponseTimeThreshold) {
this.targetResponseTimeThreshold = targetResponseTimeThreshold;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link WatchEcsServiceOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public WatchEcsServiceOptions build() {
return new Jsii$Proxy(cpuMaximumThresholdPercent, memoryMaximumThresholdPercent, requestsThreshold, targetResponseTimeThreshold);
}
}
/**
* An implementation for {@link WatchEcsServiceOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements WatchEcsServiceOptions {
private final java.lang.Number cpuMaximumThresholdPercent;
private final java.lang.Number memoryMaximumThresholdPercent;
private final java.lang.Number requestsThreshold;
private final java.lang.Number targetResponseTimeThreshold;
/**
* 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.cpuMaximumThresholdPercent = this.jsiiGet("cpuMaximumThresholdPercent", java.lang.Number.class);
this.memoryMaximumThresholdPercent = this.jsiiGet("memoryMaximumThresholdPercent", java.lang.Number.class);
this.requestsThreshold = this.jsiiGet("requestsThreshold", java.lang.Number.class);
this.targetResponseTimeThreshold = this.jsiiGet("targetResponseTimeThreshold", java.lang.Number.class);
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
private Jsii$Proxy(final java.lang.Number cpuMaximumThresholdPercent, final java.lang.Number memoryMaximumThresholdPercent, final java.lang.Number requestsThreshold, final java.lang.Number targetResponseTimeThreshold) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.cpuMaximumThresholdPercent = cpuMaximumThresholdPercent;
this.memoryMaximumThresholdPercent = memoryMaximumThresholdPercent;
this.requestsThreshold = requestsThreshold;
this.targetResponseTimeThreshold = targetResponseTimeThreshold;
}
@Override
public java.lang.Number getCpuMaximumThresholdPercent() {
return this.cpuMaximumThresholdPercent;
}
@Override
public java.lang.Number getMemoryMaximumThresholdPercent() {
return this.memoryMaximumThresholdPercent;
}
@Override
public java.lang.Number getRequestsThreshold() {
return this.requestsThreshold;
}
@Override
public java.lang.Number getTargetResponseTimeThreshold() {
return this.targetResponseTimeThreshold;
}
@Override
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.getCpuMaximumThresholdPercent() != null) {
data.set("cpuMaximumThresholdPercent", om.valueToTree(this.getCpuMaximumThresholdPercent()));
}
if (this.getMemoryMaximumThresholdPercent() != null) {
data.set("memoryMaximumThresholdPercent", om.valueToTree(this.getMemoryMaximumThresholdPercent()));
}
if (this.getRequestsThreshold() != null) {
data.set("requestsThreshold", om.valueToTree(this.getRequestsThreshold()));
}
if (this.getTargetResponseTimeThreshold() != null) {
data.set("targetResponseTimeThreshold", om.valueToTree(this.getTargetResponseTimeThreshold()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-watchful.WatchEcsServiceOptions"));
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 boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
WatchEcsServiceOptions.Jsii$Proxy that = (WatchEcsServiceOptions.Jsii$Proxy) o;
if (this.cpuMaximumThresholdPercent != null ? !this.cpuMaximumThresholdPercent.equals(that.cpuMaximumThresholdPercent) : that.cpuMaximumThresholdPercent != null) return false;
if (this.memoryMaximumThresholdPercent != null ? !this.memoryMaximumThresholdPercent.equals(that.memoryMaximumThresholdPercent) : that.memoryMaximumThresholdPercent != null) return false;
if (this.requestsThreshold != null ? !this.requestsThreshold.equals(that.requestsThreshold) : that.requestsThreshold != null) return false;
return this.targetResponseTimeThreshold != null ? this.targetResponseTimeThreshold.equals(that.targetResponseTimeThreshold) : that.targetResponseTimeThreshold == null;
}
@Override
public int hashCode() {
int result = this.cpuMaximumThresholdPercent != null ? this.cpuMaximumThresholdPercent.hashCode() : 0;
result = 31 * result + (this.memoryMaximumThresholdPercent != null ? this.memoryMaximumThresholdPercent.hashCode() : 0);
result = 31 * result + (this.requestsThreshold != null ? this.requestsThreshold.hashCode() : 0);
result = 31 * result + (this.targetResponseTimeThreshold != null ? this.targetResponseTimeThreshold.hashCode() : 0);
return result;
}
}
}