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

commonMain.aws.sdk.kotlin.services.autoscaling.model.SetInstanceProtectionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.autoscaling.model

import aws.smithy.kotlin.runtime.SdkDsl

public class SetInstanceProtectionRequest private constructor(builder: Builder) {
    /**
     * The name of the Auto Scaling group.
     */
    public val autoScalingGroupName: kotlin.String? = builder.autoScalingGroupName
    /**
     * One or more instance IDs. You can specify up to 50 instances.
     */
    public val instanceIds: List? = builder.instanceIds
    /**
     * Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
     */
    public val protectedFromScaleIn: kotlin.Boolean? = builder.protectedFromScaleIn

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

    override fun toString(): kotlin.String = buildString {
        append("SetInstanceProtectionRequest(")
        append("autoScalingGroupName=$autoScalingGroupName,")
        append("instanceIds=$instanceIds,")
        append("protectedFromScaleIn=$protectedFromScaleIn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = autoScalingGroupName?.hashCode() ?: 0
        result = 31 * result + (instanceIds?.hashCode() ?: 0)
        result = 31 * result + (protectedFromScaleIn?.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 SetInstanceProtectionRequest

        if (autoScalingGroupName != other.autoScalingGroupName) return false
        if (instanceIds != other.instanceIds) return false
        if (protectedFromScaleIn != other.protectedFromScaleIn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the Auto Scaling group.
         */
        public var autoScalingGroupName: kotlin.String? = null
        /**
         * One or more instance IDs. You can specify up to 50 instances.
         */
        public var instanceIds: List? = null
        /**
         * Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
         */
        public var protectedFromScaleIn: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.SetInstanceProtectionRequest) : this() {
            this.autoScalingGroupName = x.autoScalingGroupName
            this.instanceIds = x.instanceIds
            this.protectedFromScaleIn = x.protectedFromScaleIn
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy