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

commonMain.aws.sdk.kotlin.services.emr.model.OnDemandProvisioningSpecification.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.emr.model



/**
 * The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
 *
 * The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR version 5.12.1 and later.
 */
public class OnDemandProvisioningSpecification private constructor(builder: Builder) {
    /**
     * Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is `lowest-price` (the default), which launches the lowest price first.
     */
    public val allocationStrategy: aws.sdk.kotlin.services.emr.model.OnDemandProvisioningAllocationStrategy? = builder.allocationStrategy
    /**
     * The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
     */
    public val capacityReservationOptions: aws.sdk.kotlin.services.emr.model.OnDemandCapacityReservationOptions? = builder.capacityReservationOptions

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

    override fun toString(): kotlin.String = buildString {
        append("OnDemandProvisioningSpecification(")
        append("allocationStrategy=$allocationStrategy,")
        append("capacityReservationOptions=$capacityReservationOptions)")
    }

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

        if (allocationStrategy != other.allocationStrategy) return false
        if (capacityReservationOptions != other.capacityReservationOptions) return false

        return true
    }

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

    public class Builder {
        /**
         * Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is `lowest-price` (the default), which launches the lowest price first.
         */
        public var allocationStrategy: aws.sdk.kotlin.services.emr.model.OnDemandProvisioningAllocationStrategy? = null
        /**
         * The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
         */
        public var capacityReservationOptions: aws.sdk.kotlin.services.emr.model.OnDemandCapacityReservationOptions? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.emr.model.OnDemandProvisioningSpecification) : this() {
            this.allocationStrategy = x.allocationStrategy
            this.capacityReservationOptions = x.capacityReservationOptions
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy