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

commonMain.aws.sdk.kotlin.services.cloudwatchlogs.model.UpdateAnomalyRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudwatchlogs.model

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdateAnomalyRequest private constructor(builder: Builder) {
    /**
     * The ARN of the anomaly detector that this operation is to act on.
     */
    public val anomalyDetectorArn: kotlin.String? = builder.anomalyDetectorArn
    /**
     * If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.
     */
    public val anomalyId: kotlin.String? = builder.anomalyId
    /**
     * If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.
     */
    public val patternId: kotlin.String? = builder.patternId
    /**
     * If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.
     */
    public val suppressionPeriod: aws.sdk.kotlin.services.cloudwatchlogs.model.SuppressionPeriod? = builder.suppressionPeriod
    /**
     * Use this to specify whether the suppression to be temporary or infinite. If you specify `LIMITED`, you must also specify a `suppressionPeriod`. If you specify `INFINITE`, any value for `suppressionPeriod` is ignored.
     */
    public val suppressionType: aws.sdk.kotlin.services.cloudwatchlogs.model.SuppressionType? = builder.suppressionType

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateAnomalyRequest(")
        append("anomalyDetectorArn=$anomalyDetectorArn,")
        append("anomalyId=$anomalyId,")
        append("patternId=$patternId,")
        append("suppressionPeriod=$suppressionPeriod,")
        append("suppressionType=$suppressionType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = anomalyDetectorArn?.hashCode() ?: 0
        result = 31 * result + (anomalyId?.hashCode() ?: 0)
        result = 31 * result + (patternId?.hashCode() ?: 0)
        result = 31 * result + (suppressionPeriod?.hashCode() ?: 0)
        result = 31 * result + (suppressionType?.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 UpdateAnomalyRequest

        if (anomalyDetectorArn != other.anomalyDetectorArn) return false
        if (anomalyId != other.anomalyId) return false
        if (patternId != other.patternId) return false
        if (suppressionPeriod != other.suppressionPeriod) return false
        if (suppressionType != other.suppressionType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ARN of the anomaly detector that this operation is to act on.
         */
        public var anomalyDetectorArn: kotlin.String? = null
        /**
         * If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.
         */
        public var anomalyId: kotlin.String? = null
        /**
         * If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.
         */
        public var patternId: kotlin.String? = null
        /**
         * If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.
         */
        public var suppressionPeriod: aws.sdk.kotlin.services.cloudwatchlogs.model.SuppressionPeriod? = null
        /**
         * Use this to specify whether the suppression to be temporary or infinite. If you specify `LIMITED`, you must also specify a `suppressionPeriod`. If you specify `INFINITE`, any value for `suppressionPeriod` is ignored.
         */
        public var suppressionType: aws.sdk.kotlin.services.cloudwatchlogs.model.SuppressionType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatchlogs.model.UpdateAnomalyRequest) : this() {
            this.anomalyDetectorArn = x.anomalyDetectorArn
            this.anomalyId = x.anomalyId
            this.patternId = x.patternId
            this.suppressionPeriod = x.suppressionPeriod
            this.suppressionType = x.suppressionType
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy