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

commonMain.aws.sdk.kotlin.services.cloudwatch.model.PutAnomalyDetectorRequest.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

public class PutAnomalyDetectorRequest private constructor(builder: Builder) {
    /**
     * The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges.
     *
     * The configuration can also include the time zone to use for the metric.
     */
    public val configuration: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration? = builder.configuration
    /**
     * The metric dimensions to create the anomaly detection model for.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.")
    public val dimensions: List? = builder.dimensions
    /**
     * Use this object to include parameters 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 metric math anomaly detector to be created.
     *
     * When using `MetricMathAnomalyDetector`, you cannot include the following parameters in the same operation:
     * + `Dimensions`
     * + `MetricName`
     * + `Namespace`
     * + `Stat`
     * + the `SingleMetricAnomalyDetector` parameters of `PutAnomalyDetectorInput`
     *
     * Instead, specify the metric math anomaly detector attributes as part of the property `MetricMathAnomalyDetector`.
     */
    public val metricMathAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector? = builder.metricMathAnomalyDetector
    /**
     * The name of the metric to create the anomaly detection model for.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.")
    public val metricName: kotlin.String? = builder.metricName
    /**
     * The namespace of the metric to create the anomaly detection model for.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.")
    public val namespace: kotlin.String? = builder.namespace
    /**
     * A single metric anomaly detector to be created.
     *
     * When using `SingleMetricAnomalyDetector`, you cannot include the following parameters in the same operation:
     * + `Dimensions`
     * + `MetricName`
     * + `Namespace`
     * + `Stat`
     * + the `MetricMathAnomalyDetector` parameters of `PutAnomalyDetectorInput`
     *
     * Instead, specify the single metric anomaly detector attributes as part of the property `SingleMetricAnomalyDetector`.
     */
    public val singleMetricAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector? = builder.singleMetricAnomalyDetector
    /**
     * The statistic to use for the metric and the anomaly detection model.
     */
    @Deprecated("Use SingleMetricAnomalyDetector.")
    public val stat: kotlin.String? = builder.stat

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

    override fun toString(): kotlin.String = buildString {
        append("PutAnomalyDetectorRequest(")
        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(")")
    }

    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)
        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 PutAnomalyDetectorRequest

        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

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatch.model.PutAnomalyDetectorRequest = 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 when training and updating the model. You can specify as many as 10 time ranges.
         *
         * The configuration can also include the time zone to use for the metric.
         */
        public var configuration: aws.sdk.kotlin.services.cloudwatch.model.AnomalyDetectorConfiguration? = null
        /**
         * The metric dimensions to create the anomaly detection model for.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.")
        public var dimensions: List? = null
        /**
         * Use this object to include parameters 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 metric math anomaly detector to be created.
         *
         * When using `MetricMathAnomalyDetector`, you cannot include the following parameters in the same operation:
         * + `Dimensions`
         * + `MetricName`
         * + `Namespace`
         * + `Stat`
         * + the `SingleMetricAnomalyDetector` parameters of `PutAnomalyDetectorInput`
         *
         * Instead, specify the metric math anomaly detector attributes as part of the property `MetricMathAnomalyDetector`.
         */
        public var metricMathAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.MetricMathAnomalyDetector? = null
        /**
         * The name of the metric to create the anomaly detection model for.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.")
        public var metricName: kotlin.String? = null
        /**
         * The namespace of the metric to create the anomaly detection model for.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.")
        public var namespace: kotlin.String? = null
        /**
         * A single metric anomaly detector to be created.
         *
         * When using `SingleMetricAnomalyDetector`, you cannot include the following parameters in the same operation:
         * + `Dimensions`
         * + `MetricName`
         * + `Namespace`
         * + `Stat`
         * + the `MetricMathAnomalyDetector` parameters of `PutAnomalyDetectorInput`
         *
         * Instead, specify the single metric anomaly detector attributes as part of the property `SingleMetricAnomalyDetector`.
         */
        public var singleMetricAnomalyDetector: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector? = null
        /**
         * The statistic to use for the metric and the anomaly detection model.
         */
        @Deprecated("Use SingleMetricAnomalyDetector.")
        public var stat: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.PutAnomalyDetectorRequest) : 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
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.cloudwatch.model.PutAnomalyDetectorRequest = PutAnomalyDetectorRequest(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