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

commonMain.aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetector.kt Maven / Gradle / Ivy

There is a newer version: 1.3.35
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.cloudwatch.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An anomaly detection model associated with a particular CloudWatch metric, statistic, or metric math expression. You can use the model to display a band of expected, normal values when the metric is graphed.
 *
 * If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account.
 */
public class AnomalyDetector private constructor(builder: Builder) {
    /**
     * The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.
     */
    public val configuration: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration? = builder.configuration
    /**
     * The metric dimensions associated with the anomaly detection model.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.Dimensions property.")
    public val dimensions: List? = builder.dimensions
    /**
     * This object includes parameters that you can use to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the `PeriodicSpikes` parameter.
     */
    public val metricCharacteristics: aws.sdk.kotlin.services.cloudwatch.model.MetricCharacteristics? = builder.metricCharacteristics
    /**
     * The CloudWatch metric math expression for this anomaly detector.
     */
    public val metricMathAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector? = builder.metricMathAnomalyDetector
    /**
     * The name of the metric associated with the anomaly detection model.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.MetricName property.")
    public val metricName: kotlin.String? = builder.metricName
    /**
     * The namespace of the metric associated with the anomaly detection model.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.Namespace property.")
    public val namespace: kotlin.String? = builder.namespace
    /**
     * The CloudWatch metric and statistic for this anomaly detector.
     */
    public val singleMetricAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector? = builder.singleMetricAnomalyDetector
    /**
     * The statistic associated with the anomaly detection model.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.Stat property.")
    public val stat: kotlin.String? = builder.stat
    /**
     * The current status of the anomaly detector's training.
     */
    public val stateValue: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorStateValue? = builder.stateValue

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetector = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("AnomalyDetector(")
        append("configuration=$configuration,")
        append("dimensions=$dimensions,")
        append("metricCharacteristics=$metricCharacteristics,")
        append("metricMathAnomalyDetector=$metricMathAnomalyDetector,")
        append("metricName=$metricName,")
        append("namespace=$namespace,")
        append("singleMetricAnomalyDetector=$singleMetricAnomalyDetector,")
        append("stat=$stat,")
        append("stateValue=$stateValue")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configuration?.hashCode() ?: 0
        result = 31 * result + (dimensions?.hashCode() ?: 0)
        result = 31 * result + (metricCharacteristics?.hashCode() ?: 0)
        result = 31 * result + (metricMathAnomalyDetector?.hashCode() ?: 0)
        result = 31 * result + (metricName?.hashCode() ?: 0)
        result = 31 * result + (namespace?.hashCode() ?: 0)
        result = 31 * result + (singleMetricAnomalyDetector?.hashCode() ?: 0)
        result = 31 * result + (stat?.hashCode() ?: 0)
        result = 31 * result + (stateValue?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as AnomalyDetector

        if (configuration != other.configuration) return false
        if (dimensions != other.dimensions) return false
        if (metricCharacteristics != other.metricCharacteristics) return false
        if (metricMathAnomalyDetector != other.metricMathAnomalyDetector) return false
        if (metricName != other.metricName) return false
        if (namespace != other.namespace) return false
        if (singleMetricAnomalyDetector != other.singleMetricAnomalyDetector) return false
        if (stat != other.stat) return false
        if (stateValue != other.stateValue) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetector = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.
         */
        public var configuration: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration? = null
        /**
         * The metric dimensions associated with the anomaly detection model.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.Dimensions property.")
        public var dimensions: List? = null
        /**
         * This object includes parameters that you can use to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models. Currently, it includes the `PeriodicSpikes` parameter.
         */
        public var metricCharacteristics: aws.sdk.kotlin.services.cloudwatch.model.MetricCharacteristics? = null
        /**
         * The CloudWatch metric math expression for this anomaly detector.
         */
        public var metricMathAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector? = null
        /**
         * The name of the metric associated with the anomaly detection model.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.MetricName property.")
        public var metricName: kotlin.String? = null
        /**
         * The namespace of the metric associated with the anomaly detection model.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.Namespace property.")
        public var namespace: kotlin.String? = null
        /**
         * The CloudWatch metric and statistic for this anomaly detector.
         */
        public var singleMetricAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector? = null
        /**
         * The statistic associated with the anomaly detection model.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.Stat property.")
        public var stat: kotlin.String? = null
        /**
         * The current status of the anomaly detector's training.
         */
        public var stateValue: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorStateValue? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetector) : this() {
            this.configuration = x.configuration
            this.dimensions = x.dimensions
            this.metricCharacteristics = x.metricCharacteristics
            this.metricMathAnomalyDetector = x.metricMathAnomalyDetector
            this.metricName = x.metricName
            this.namespace = x.namespace
            this.singleMetricAnomalyDetector = x.singleMetricAnomalyDetector
            this.stat = x.stat
            this.stateValue = x.stateValue
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetector = AnomalyDetector(this)

        /**
         * construct an [aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration] inside the given [block]
         */
        public fun configuration(block: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration.Builder.() -> kotlin.Unit) {
            this.configuration = aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.cloudwatch.model.MetricCharacteristics] inside the given [block]
         */
        public fun metricCharacteristics(block: aws.sdk.kotlin.services.cloudwatch.model.MetricCharacteristics.Builder.() -> kotlin.Unit) {
            this.metricCharacteristics = aws.sdk.kotlin.services.cloudwatch.model.MetricCharacteristics.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector] inside the given [block]
         */
        public fun metricMathAnomalyDetector(block: aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector.Builder.() -> kotlin.Unit) {
            this.metricMathAnomalyDetector = aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector] inside the given [block]
         */
        public fun singleMetricAnomalyDetector(block: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector.Builder.() -> kotlin.Unit) {
            this.singleMetricAnomalyDetector = aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy