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

commonMain.aws.sdk.kotlin.services.applicationautoscaling.model.Alarm.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationautoscaling.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents a CloudWatch alarm associated with a scaling policy.
 */
public class Alarm private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the alarm.
     */
    public val alarmArn: kotlin.String = requireNotNull(builder.alarmArn) { "A non-null value must be provided for alarmArn" }
    /**
     * The name of the alarm.
     */
    public val alarmName: kotlin.String = requireNotNull(builder.alarmName) { "A non-null value must be provided for alarmName" }

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the alarm.
         */
        public var alarmArn: kotlin.String? = null
        /**
         * The name of the alarm.
         */
        public var alarmName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationautoscaling.model.Alarm) : this() {
            this.alarmArn = x.alarmArn
            this.alarmName = x.alarmName
        }

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

        internal fun correctErrors(): Builder {
            if (alarmArn == null) alarmArn = ""
            if (alarmName == null) alarmName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy