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

commonMain.aws.sdk.kotlin.services.codedeploy.model.AlarmConfiguration.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codedeploy.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about alarms associated with a deployment or deployment group.
 */
public class AlarmConfiguration private constructor(builder: Builder) {
    /**
     * A list of alarms configured for the deployment or deployment group. A maximum of 10 alarms can be added.
     */
    public val alarms: List? = builder.alarms
    /**
     * Indicates whether the alarm configuration is enabled.
     */
    public val enabled: kotlin.Boolean = builder.enabled
    /**
     * Indicates whether a deployment should continue if information about the current state of alarms cannot be retrieved from Amazon CloudWatch. The default value is false.
     * + `true`: The deployment proceeds even if alarm status information can't be retrieved from Amazon CloudWatch.
     * + `false`: The deployment stops if alarm status information can't be retrieved from Amazon CloudWatch.
     */
    public val ignorePollAlarmFailure: kotlin.Boolean = builder.ignorePollAlarmFailure

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

    override fun toString(): kotlin.String = buildString {
        append("AlarmConfiguration(")
        append("alarms=$alarms,")
        append("enabled=$enabled,")
        append("ignorePollAlarmFailure=$ignorePollAlarmFailure")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = alarms?.hashCode() ?: 0
        result = 31 * result + (enabled.hashCode())
        result = 31 * result + (ignorePollAlarmFailure.hashCode())
        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 AlarmConfiguration

        if (alarms != other.alarms) return false
        if (enabled != other.enabled) return false
        if (ignorePollAlarmFailure != other.ignorePollAlarmFailure) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of alarms configured for the deployment or deployment group. A maximum of 10 alarms can be added.
         */
        public var alarms: List? = null
        /**
         * Indicates whether the alarm configuration is enabled.
         */
        public var enabled: kotlin.Boolean = false
        /**
         * Indicates whether a deployment should continue if information about the current state of alarms cannot be retrieved from Amazon CloudWatch. The default value is false.
         * + `true`: The deployment proceeds even if alarm status information can't be retrieved from Amazon CloudWatch.
         * + `false`: The deployment stops if alarm status information can't be retrieved from Amazon CloudWatch.
         */
        public var ignorePollAlarmFailure: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codedeploy.model.AlarmConfiguration) : this() {
            this.alarms = x.alarms
            this.enabled = x.enabled
            this.ignorePollAlarmFailure = x.ignorePollAlarmFailure
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy