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

commonMain.aws.sdk.kotlin.services.applicationdiscoveryservice.model.ReservedInstanceOptions.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.applicationdiscoveryservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Used to provide Reserved Instance preferences for the recommendation.
 */
public class ReservedInstanceOptions private constructor(builder: Builder) {
    /**
     * The flexibility to change the instance types needed for your Reserved Instance.
     */
    public val offeringClass: aws.sdk.kotlin.services.applicationdiscoveryservice.model.OfferingClass = requireNotNull(builder.offeringClass) { "A non-null value must be provided for offeringClass" }
    /**
     * The payment plan to use for your Reserved Instance.
     */
    public val purchasingOption: aws.sdk.kotlin.services.applicationdiscoveryservice.model.PurchasingOption = requireNotNull(builder.purchasingOption) { "A non-null value must be provided for purchasingOption" }
    /**
     * The preferred duration of the Reserved Instance term.
     */
    public val termLength: aws.sdk.kotlin.services.applicationdiscoveryservice.model.TermLength = requireNotNull(builder.termLength) { "A non-null value must be provided for termLength" }

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

    override fun toString(): kotlin.String = buildString {
        append("ReservedInstanceOptions(")
        append("offeringClass=$offeringClass,")
        append("purchasingOption=$purchasingOption,")
        append("termLength=$termLength")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = offeringClass.hashCode()
        result = 31 * result + (purchasingOption.hashCode())
        result = 31 * result + (termLength.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 ReservedInstanceOptions

        if (offeringClass != other.offeringClass) return false
        if (purchasingOption != other.purchasingOption) return false
        if (termLength != other.termLength) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The flexibility to change the instance types needed for your Reserved Instance.
         */
        public var offeringClass: aws.sdk.kotlin.services.applicationdiscoveryservice.model.OfferingClass? = null
        /**
         * The payment plan to use for your Reserved Instance.
         */
        public var purchasingOption: aws.sdk.kotlin.services.applicationdiscoveryservice.model.PurchasingOption? = null
        /**
         * The preferred duration of the Reserved Instance term.
         */
        public var termLength: aws.sdk.kotlin.services.applicationdiscoveryservice.model.TermLength? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationdiscoveryservice.model.ReservedInstanceOptions) : this() {
            this.offeringClass = x.offeringClass
            this.purchasingOption = x.purchasingOption
            this.termLength = x.termLength
        }

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

        internal fun correctErrors(): Builder {
            if (offeringClass == null) offeringClass = OfferingClass.SdkUnknown("no value provided")
            if (purchasingOption == null) purchasingOption = PurchasingOption.SdkUnknown("no value provided")
            if (termLength == null) termLength = TermLength.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy