All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cdklabs.cdkmonitoringconstructs.BaseFargateServiceAlarms Maven / Gradle / Ivy

There is a newer version: 9.1.0
Show newest version
package io.github.cdklabs.cdkmonitoringconstructs;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-24T17:32:51.830Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkmonitoringconstructs.$Module.class, fqn = "cdk-monitoring-constructs.BaseFargateServiceAlarms")
@software.amazon.jsii.Jsii.Proxy(BaseFargateServiceAlarms.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface BaseFargateServiceAlarms extends software.amazon.jsii.JsiiSerializable {

    /**
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.util.Map getAddCpuUsageAlarm() {
        return null;
    }

    /**
     * (experimental) Container Insights needs to be enabled for the cluster for this alarm.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.util.Map getAddEphermalStorageUsageAlarm() {
        return null;
    }

    /**
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.util.Map getAddMemoryUsageAlarm() {
        return null;
    }

    /**
     * (experimental) Container Insights needs to be enabled for the cluster for this alarm.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.util.Map getAddRunningTaskCountAlarm() {
        return null;
    }

    /**
     * (experimental) Maximum number of tasks, as specified in your auto scaling config.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.lang.Number getMaxAutoScalingTaskCount() {
        return null;
    }

    /**
     * (experimental) Minimum number of tasks, as specified in your auto scaling config.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.lang.Number getMinAutoScalingTaskCount() {
        return null;
    }

    /**
     * @return a {@link Builder} of {@link BaseFargateServiceAlarms}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    static Builder builder() {
        return new Builder();
    }
    /**
     * A builder for {@link BaseFargateServiceAlarms}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public static final class Builder implements software.amazon.jsii.Builder {
        java.util.Map addCpuUsageAlarm;
        java.util.Map addEphermalStorageUsageAlarm;
        java.util.Map addMemoryUsageAlarm;
        java.util.Map addRunningTaskCountAlarm;
        java.lang.Number maxAutoScalingTaskCount;
        java.lang.Number minAutoScalingTaskCount;

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getAddCpuUsageAlarm}
         * @param addCpuUsageAlarm the value to be set.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @SuppressWarnings("unchecked")
        public Builder addCpuUsageAlarm(java.util.Map addCpuUsageAlarm) {
            this.addCpuUsageAlarm = (java.util.Map)addCpuUsageAlarm;
            return this;
        }

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getAddEphermalStorageUsageAlarm}
         * @param addEphermalStorageUsageAlarm Container Insights needs to be enabled for the cluster for this alarm.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @SuppressWarnings("unchecked")
        public Builder addEphermalStorageUsageAlarm(java.util.Map addEphermalStorageUsageAlarm) {
            this.addEphermalStorageUsageAlarm = (java.util.Map)addEphermalStorageUsageAlarm;
            return this;
        }

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getAddMemoryUsageAlarm}
         * @param addMemoryUsageAlarm the value to be set.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @SuppressWarnings("unchecked")
        public Builder addMemoryUsageAlarm(java.util.Map addMemoryUsageAlarm) {
            this.addMemoryUsageAlarm = (java.util.Map)addMemoryUsageAlarm;
            return this;
        }

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getAddRunningTaskCountAlarm}
         * @param addRunningTaskCountAlarm Container Insights needs to be enabled for the cluster for this alarm.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @SuppressWarnings("unchecked")
        public Builder addRunningTaskCountAlarm(java.util.Map addRunningTaskCountAlarm) {
            this.addRunningTaskCountAlarm = (java.util.Map)addRunningTaskCountAlarm;
            return this;
        }

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getMaxAutoScalingTaskCount}
         * @param maxAutoScalingTaskCount Maximum number of tasks, as specified in your auto scaling config.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public Builder maxAutoScalingTaskCount(java.lang.Number maxAutoScalingTaskCount) {
            this.maxAutoScalingTaskCount = maxAutoScalingTaskCount;
            return this;
        }

        /**
         * Sets the value of {@link BaseFargateServiceAlarms#getMinAutoScalingTaskCount}
         * @param minAutoScalingTaskCount Minimum number of tasks, as specified in your auto scaling config.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public Builder minAutoScalingTaskCount(java.lang.Number minAutoScalingTaskCount) {
            this.minAutoScalingTaskCount = minAutoScalingTaskCount;
            return this;
        }

        /**
         * Builds the configured instance.
         * @return a new instance of {@link BaseFargateServiceAlarms}
         * @throws NullPointerException if any required attribute was not provided
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @Override
        public BaseFargateServiceAlarms build() {
            return new Jsii$Proxy(this);
        }
    }

    /**
     * An implementation for {@link BaseFargateServiceAlarms}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @software.amazon.jsii.Internal
    final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BaseFargateServiceAlarms {
        private final java.util.Map addCpuUsageAlarm;
        private final java.util.Map addEphermalStorageUsageAlarm;
        private final java.util.Map addMemoryUsageAlarm;
        private final java.util.Map addRunningTaskCountAlarm;
        private final java.lang.Number maxAutoScalingTaskCount;
        private final java.lang.Number minAutoScalingTaskCount;

        /**
         * 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.addCpuUsageAlarm = software.amazon.jsii.Kernel.get(this, "addCpuUsageAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.UsageThreshold.class)));
            this.addEphermalStorageUsageAlarm = software.amazon.jsii.Kernel.get(this, "addEphermalStorageUsageAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.UsageThreshold.class)));
            this.addMemoryUsageAlarm = software.amazon.jsii.Kernel.get(this, "addMemoryUsageAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.UsageThreshold.class)));
            this.addRunningTaskCountAlarm = software.amazon.jsii.Kernel.get(this, "addRunningTaskCountAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.RunningTaskCountThreshold.class)));
            this.maxAutoScalingTaskCount = software.amazon.jsii.Kernel.get(this, "maxAutoScalingTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
            this.minAutoScalingTaskCount = software.amazon.jsii.Kernel.get(this, "minAutoScalingTaskCount", 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.addCpuUsageAlarm = (java.util.Map)builder.addCpuUsageAlarm;
            this.addEphermalStorageUsageAlarm = (java.util.Map)builder.addEphermalStorageUsageAlarm;
            this.addMemoryUsageAlarm = (java.util.Map)builder.addMemoryUsageAlarm;
            this.addRunningTaskCountAlarm = (java.util.Map)builder.addRunningTaskCountAlarm;
            this.maxAutoScalingTaskCount = builder.maxAutoScalingTaskCount;
            this.minAutoScalingTaskCount = builder.minAutoScalingTaskCount;
        }

        @Override
        public final java.util.Map getAddCpuUsageAlarm() {
            return this.addCpuUsageAlarm;
        }

        @Override
        public final java.util.Map getAddEphermalStorageUsageAlarm() {
            return this.addEphermalStorageUsageAlarm;
        }

        @Override
        public final java.util.Map getAddMemoryUsageAlarm() {
            return this.addMemoryUsageAlarm;
        }

        @Override
        public final java.util.Map getAddRunningTaskCountAlarm() {
            return this.addRunningTaskCountAlarm;
        }

        @Override
        public final java.lang.Number getMaxAutoScalingTaskCount() {
            return this.maxAutoScalingTaskCount;
        }

        @Override
        public final java.lang.Number getMinAutoScalingTaskCount() {
            return this.minAutoScalingTaskCount;
        }

        @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.getAddCpuUsageAlarm() != null) {
                data.set("addCpuUsageAlarm", om.valueToTree(this.getAddCpuUsageAlarm()));
            }
            if (this.getAddEphermalStorageUsageAlarm() != null) {
                data.set("addEphermalStorageUsageAlarm", om.valueToTree(this.getAddEphermalStorageUsageAlarm()));
            }
            if (this.getAddMemoryUsageAlarm() != null) {
                data.set("addMemoryUsageAlarm", om.valueToTree(this.getAddMemoryUsageAlarm()));
            }
            if (this.getAddRunningTaskCountAlarm() != null) {
                data.set("addRunningTaskCountAlarm", om.valueToTree(this.getAddRunningTaskCountAlarm()));
            }
            if (this.getMaxAutoScalingTaskCount() != null) {
                data.set("maxAutoScalingTaskCount", om.valueToTree(this.getMaxAutoScalingTaskCount()));
            }
            if (this.getMinAutoScalingTaskCount() != null) {
                data.set("minAutoScalingTaskCount", om.valueToTree(this.getMinAutoScalingTaskCount()));
            }

            final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
            struct.set("fqn", om.valueToTree("cdk-monitoring-constructs.BaseFargateServiceAlarms"));
            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;

            BaseFargateServiceAlarms.Jsii$Proxy that = (BaseFargateServiceAlarms.Jsii$Proxy) o;

            if (this.addCpuUsageAlarm != null ? !this.addCpuUsageAlarm.equals(that.addCpuUsageAlarm) : that.addCpuUsageAlarm != null) return false;
            if (this.addEphermalStorageUsageAlarm != null ? !this.addEphermalStorageUsageAlarm.equals(that.addEphermalStorageUsageAlarm) : that.addEphermalStorageUsageAlarm != null) return false;
            if (this.addMemoryUsageAlarm != null ? !this.addMemoryUsageAlarm.equals(that.addMemoryUsageAlarm) : that.addMemoryUsageAlarm != null) return false;
            if (this.addRunningTaskCountAlarm != null ? !this.addRunningTaskCountAlarm.equals(that.addRunningTaskCountAlarm) : that.addRunningTaskCountAlarm != null) return false;
            if (this.maxAutoScalingTaskCount != null ? !this.maxAutoScalingTaskCount.equals(that.maxAutoScalingTaskCount) : that.maxAutoScalingTaskCount != null) return false;
            return this.minAutoScalingTaskCount != null ? this.minAutoScalingTaskCount.equals(that.minAutoScalingTaskCount) : that.minAutoScalingTaskCount == null;
        }

        @Override
        public final int hashCode() {
            int result = this.addCpuUsageAlarm != null ? this.addCpuUsageAlarm.hashCode() : 0;
            result = 31 * result + (this.addEphermalStorageUsageAlarm != null ? this.addEphermalStorageUsageAlarm.hashCode() : 0);
            result = 31 * result + (this.addMemoryUsageAlarm != null ? this.addMemoryUsageAlarm.hashCode() : 0);
            result = 31 * result + (this.addRunningTaskCountAlarm != null ? this.addRunningTaskCountAlarm.hashCode() : 0);
            result = 31 * result + (this.maxAutoScalingTaskCount != null ? this.maxAutoScalingTaskCount.hashCode() : 0);
            result = 31 * result + (this.minAutoScalingTaskCount != null ? this.minAutoScalingTaskCount.hashCode() : 0);
            return result;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy