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

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

There is a newer version: 1.3.35
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

/**
 * Describes a warm pool configuration.
 */
public class WarmPoolConfiguration private constructor(builder: Builder) {
    /**
     * The instance reuse policy.
     */
    public val instanceReusePolicy: aws.sdk.kotlin.services.autoscaling.model.InstanceReusePolicy? = builder.instanceReusePolicy
    /**
     * The maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group.
     */
    public val maxGroupPreparedCapacity: kotlin.Int? = builder.maxGroupPreparedCapacity
    /**
     * The minimum number of instances to maintain in the warm pool.
     */
    public val minSize: kotlin.Int? = builder.minSize
    /**
     * The instance state to transition to after the lifecycle actions are complete.
     */
    public val poolState: aws.sdk.kotlin.services.autoscaling.model.WarmPoolState? = builder.poolState
    /**
     * The status of a warm pool that is marked for deletion.
     */
    public val status: aws.sdk.kotlin.services.autoscaling.model.WarmPoolStatus? = builder.status

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

    override fun toString(): kotlin.String = buildString {
        append("WarmPoolConfiguration(")
        append("instanceReusePolicy=$instanceReusePolicy,")
        append("maxGroupPreparedCapacity=$maxGroupPreparedCapacity,")
        append("minSize=$minSize,")
        append("poolState=$poolState,")
        append("status=$status")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = instanceReusePolicy?.hashCode() ?: 0
        result = 31 * result + (maxGroupPreparedCapacity ?: 0)
        result = 31 * result + (minSize ?: 0)
        result = 31 * result + (poolState?.hashCode() ?: 0)
        result = 31 * result + (status?.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 WarmPoolConfiguration

        if (instanceReusePolicy != other.instanceReusePolicy) return false
        if (maxGroupPreparedCapacity != other.maxGroupPreparedCapacity) return false
        if (minSize != other.minSize) return false
        if (poolState != other.poolState) return false
        if (status != other.status) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The instance reuse policy.
         */
        public var instanceReusePolicy: aws.sdk.kotlin.services.autoscaling.model.InstanceReusePolicy? = null
        /**
         * The maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group.
         */
        public var maxGroupPreparedCapacity: kotlin.Int? = null
        /**
         * The minimum number of instances to maintain in the warm pool.
         */
        public var minSize: kotlin.Int? = null
        /**
         * The instance state to transition to after the lifecycle actions are complete.
         */
        public var poolState: aws.sdk.kotlin.services.autoscaling.model.WarmPoolState? = null
        /**
         * The status of a warm pool that is marked for deletion.
         */
        public var status: aws.sdk.kotlin.services.autoscaling.model.WarmPoolStatus? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.WarmPoolConfiguration) : this() {
            this.instanceReusePolicy = x.instanceReusePolicy
            this.maxGroupPreparedCapacity = x.maxGroupPreparedCapacity
            this.minSize = x.minSize
            this.poolState = x.poolState
            this.status = x.status
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy