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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Describes an Availability Zone distribution.
 */
public class AvailabilityZoneDistribution private constructor(builder: Builder) {
    /**
     * If launches fail in an Availability Zone, the following strategies are available. The default is `balanced-best-effort`.
     * + `balanced-only` - If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution.
     * + `balanced-best-effort` - If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead.
     */
    public val capacityDistributionStrategy: aws.sdk.kotlin.services.autoscaling.model.CapacityDistributionStrategy? = builder.capacityDistributionStrategy

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

    override fun toString(): kotlin.String = buildString {
        append("AvailabilityZoneDistribution(")
        append("capacityDistributionStrategy=$capacityDistributionStrategy")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = capacityDistributionStrategy?.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 AvailabilityZoneDistribution

        if (capacityDistributionStrategy != other.capacityDistributionStrategy) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * If launches fail in an Availability Zone, the following strategies are available. The default is `balanced-best-effort`.
         * + `balanced-only` - If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution.
         * + `balanced-best-effort` - If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead.
         */
        public var capacityDistributionStrategy: aws.sdk.kotlin.services.autoscaling.model.CapacityDistributionStrategy? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.AvailabilityZoneDistribution) : this() {
            this.capacityDistributionStrategy = x.capacityDistributionStrategy
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy