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

commonMain.aws.sdk.kotlin.services.eks.model.EksAnywhereSubscriptionTerm.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.eks.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object representing the term duration and term unit type of your subscription. This determines the term length of your subscription. Valid values are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month or 36 month subscription.
 */
public class EksAnywhereSubscriptionTerm private constructor(builder: Builder) {
    /**
     * The duration of the subscription term. Valid values are 12 and 36, indicating a 12 month or 36 month subscription.
     */
    public val duration: kotlin.Int = builder.duration
    /**
     * The term unit of the subscription. Valid value is `MONTHS`.
     */
    public val unit: aws.sdk.kotlin.services.eks.model.EksAnywhereSubscriptionTermUnit? = builder.unit

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

    override fun toString(): kotlin.String = buildString {
        append("EksAnywhereSubscriptionTerm(")
        append("duration=$duration,")
        append("unit=$unit")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = duration
        result = 31 * result + (unit?.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 EksAnywhereSubscriptionTerm

        if (duration != other.duration) return false
        if (unit != other.unit) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The duration of the subscription term. Valid values are 12 and 36, indicating a 12 month or 36 month subscription.
         */
        public var duration: kotlin.Int = 0
        /**
         * The term unit of the subscription. Valid value is `MONTHS`.
         */
        public var unit: aws.sdk.kotlin.services.eks.model.EksAnywhereSubscriptionTermUnit? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.eks.model.EksAnywhereSubscriptionTerm) : this() {
            this.duration = x.duration
            this.unit = x.unit
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy