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

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

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Details about an instance refresh rollback.
 */
public class RollbackDetails private constructor(builder: Builder) {
    /**
     * Indicates the value of `InstancesToUpdate` at the time the rollback started.
     */
    public val instancesToUpdateOnRollback: kotlin.Int? = builder.instancesToUpdateOnRollback
    /**
     * Indicates the value of `PercentageComplete` at the time the rollback started.
     */
    public val percentageCompleteOnRollback: kotlin.Int? = builder.percentageCompleteOnRollback
    /**
     * Reports progress on replacing instances in an Auto Scaling group that has a warm pool. This includes separate details for instances in the warm pool and instances in the Auto Scaling group (the live pool).
     */
    public val progressDetailsOnRollback: aws.sdk.kotlin.services.autoscaling.model.InstanceRefreshProgressDetails? = builder.progressDetailsOnRollback
    /**
     * The reason for this instance refresh rollback (for example, whether a manual or automatic rollback was initiated).
     */
    public val rollbackReason: kotlin.String? = builder.rollbackReason
    /**
     * The date and time at which the rollback began.
     */
    public val rollbackStartTime: aws.smithy.kotlin.runtime.time.Instant? = builder.rollbackStartTime

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

    override fun toString(): kotlin.String = buildString {
        append("RollbackDetails(")
        append("instancesToUpdateOnRollback=$instancesToUpdateOnRollback,")
        append("percentageCompleteOnRollback=$percentageCompleteOnRollback,")
        append("progressDetailsOnRollback=$progressDetailsOnRollback,")
        append("rollbackReason=$rollbackReason,")
        append("rollbackStartTime=$rollbackStartTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = instancesToUpdateOnRollback ?: 0
        result = 31 * result + (percentageCompleteOnRollback ?: 0)
        result = 31 * result + (progressDetailsOnRollback?.hashCode() ?: 0)
        result = 31 * result + (rollbackReason?.hashCode() ?: 0)
        result = 31 * result + (rollbackStartTime?.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 RollbackDetails

        if (instancesToUpdateOnRollback != other.instancesToUpdateOnRollback) return false
        if (percentageCompleteOnRollback != other.percentageCompleteOnRollback) return false
        if (progressDetailsOnRollback != other.progressDetailsOnRollback) return false
        if (rollbackReason != other.rollbackReason) return false
        if (rollbackStartTime != other.rollbackStartTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Indicates the value of `InstancesToUpdate` at the time the rollback started.
         */
        public var instancesToUpdateOnRollback: kotlin.Int? = null
        /**
         * Indicates the value of `PercentageComplete` at the time the rollback started.
         */
        public var percentageCompleteOnRollback: kotlin.Int? = null
        /**
         * Reports progress on replacing instances in an Auto Scaling group that has a warm pool. This includes separate details for instances in the warm pool and instances in the Auto Scaling group (the live pool).
         */
        public var progressDetailsOnRollback: aws.sdk.kotlin.services.autoscaling.model.InstanceRefreshProgressDetails? = null
        /**
         * The reason for this instance refresh rollback (for example, whether a manual or automatic rollback was initiated).
         */
        public var rollbackReason: kotlin.String? = null
        /**
         * The date and time at which the rollback began.
         */
        public var rollbackStartTime: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.autoscaling.model.RollbackDetails) : this() {
            this.instancesToUpdateOnRollback = x.instancesToUpdateOnRollback
            this.percentageCompleteOnRollback = x.percentageCompleteOnRollback
            this.progressDetailsOnRollback = x.progressDetailsOnRollback
            this.rollbackReason = x.rollbackReason
            this.rollbackStartTime = x.rollbackStartTime
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy