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

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

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

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



/**
 * An auto-termination policy for an Amazon EMR cluster. An auto-termination policy defines the amount of idle time in seconds after which a cluster automatically terminates. For alternative cluster termination options, see [Control cluster termination](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html).
 */
public class AutoTerminationPolicy private constructor(builder: Builder) {
    /**
     * Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
     */
    public val idleTimeout: kotlin.Long = builder.idleTimeout

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

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

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

        if (idleTimeout != other.idleTimeout) return false

        return true
    }

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

    public class Builder {
        /**
         * Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
         */
        public var idleTimeout: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.emr.model.AutoTerminationPolicy) : this() {
            this.idleTimeout = x.idleTimeout
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy