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

commonMain.aws.sdk.kotlin.services.lightsail.model.TestAlarmRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lightsail.model

import aws.smithy.kotlin.runtime.SdkDsl

public class TestAlarmRequest private constructor(builder: Builder) {
    /**
     * The name of the alarm to test.
     */
    public val alarmName: kotlin.String? = builder.alarmName
    /**
     * The alarm state to test.
     *
     * An alarm has the following possible states that can be tested:
     * + `ALARM` - The metric is outside of the defined threshold.
     * + `INSUFFICIENT_DATA` - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.
     * + `OK` - The metric is within the defined threshold.
     */
    public val state: aws.sdk.kotlin.services.lightsail.model.AlarmState? = builder.state

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

    override fun toString(): kotlin.String = buildString {
        append("TestAlarmRequest(")
        append("alarmName=$alarmName,")
        append("state=$state")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = alarmName?.hashCode() ?: 0
        result = 31 * result + (state?.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 TestAlarmRequest

        if (alarmName != other.alarmName) return false
        if (state != other.state) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the alarm to test.
         */
        public var alarmName: kotlin.String? = null
        /**
         * The alarm state to test.
         *
         * An alarm has the following possible states that can be tested:
         * + `ALARM` - The metric is outside of the defined threshold.
         * + `INSUFFICIENT_DATA` - The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state.
         * + `OK` - The metric is within the defined threshold.
         */
        public var state: aws.sdk.kotlin.services.lightsail.model.AlarmState? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lightsail.model.TestAlarmRequest) : this() {
            this.alarmName = x.alarmName
            this.state = x.state
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy