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

commonMain.aws.sdk.kotlin.services.outposts.model.GetCapacityTaskResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.outposts.model

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

public class GetCapacityTaskResponse private constructor(builder: Builder) {
    /**
     * ID of the capacity task.
     */
    public val capacityTaskId: kotlin.String? = builder.capacityTaskId
    /**
     * Status of the capacity task.
     *
     * A capacity task can have one of the following statuses:
     * + `REQUESTED` - The capacity task was created and is awaiting the next step by Amazon Web Services Outposts.
     * + `IN_PROGRESS` - The capacity task is running and cannot be cancelled.
     * + `WAITING_FOR_EVACUATION` - The capacity task requires capacity to run. You must stop the recommended EC2 running instances to free up capacity for the task to run.
     */
    public val capacityTaskStatus: aws.sdk.kotlin.services.outposts.model.CapacityTaskStatus? = builder.capacityTaskStatus
    /**
     * The date the capacity task ran successfully.
     */
    public val completionDate: aws.smithy.kotlin.runtime.time.Instant? = builder.completionDate
    /**
     * The date the capacity task was created.
     */
    public val creationDate: aws.smithy.kotlin.runtime.time.Instant? = builder.creationDate
    /**
     * Performs a dry run to determine if you are above or below instance capacity.
     */
    public val dryRun: kotlin.Boolean = builder.dryRun
    /**
     * Reason why the capacity task failed.
     */
    public val failed: aws.sdk.kotlin.services.outposts.model.CapacityTaskFailure? = builder.failed
    /**
     * Instances that the user specified they cannot stop in order to free up the capacity needed to run the capacity task.
     */
    public val instancesToExclude: aws.sdk.kotlin.services.outposts.model.InstancesToExclude? = builder.instancesToExclude
    /**
     * The date the capacity task was last modified.
     */
    public val lastModifiedDate: aws.smithy.kotlin.runtime.time.Instant? = builder.lastModifiedDate
    /**
     * ID of the Amazon Web Services Outposts order associated with the specified capacity task.
     */
    public val orderId: kotlin.String? = builder.orderId
    /**
     * ID of the Outpost associated with the specified capacity task.
     */
    public val outpostId: kotlin.String? = builder.outpostId
    /**
     * List of instance pools requested in the capacity task.
     */
    public val requestedInstancePools: List? = builder.requestedInstancePools
    /**
     * User-specified option in case an instance is blocking the capacity task from running. Shows one of the following options:
     * + `WAIT_FOR_EVACUATION` - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.
     * + `FAIL_TASK` - The capacity task fails.
     */
    public val taskActionOnBlockingInstances: aws.sdk.kotlin.services.outposts.model.TaskActionOnBlockingInstances? = builder.taskActionOnBlockingInstances

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

    override fun toString(): kotlin.String = buildString {
        append("GetCapacityTaskResponse(")
        append("capacityTaskId=$capacityTaskId,")
        append("capacityTaskStatus=$capacityTaskStatus,")
        append("completionDate=$completionDate,")
        append("creationDate=$creationDate,")
        append("dryRun=$dryRun,")
        append("failed=$failed,")
        append("instancesToExclude=$instancesToExclude,")
        append("lastModifiedDate=$lastModifiedDate,")
        append("orderId=$orderId,")
        append("outpostId=$outpostId,")
        append("requestedInstancePools=$requestedInstancePools,")
        append("taskActionOnBlockingInstances=$taskActionOnBlockingInstances")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = capacityTaskId?.hashCode() ?: 0
        result = 31 * result + (capacityTaskStatus?.hashCode() ?: 0)
        result = 31 * result + (completionDate?.hashCode() ?: 0)
        result = 31 * result + (creationDate?.hashCode() ?: 0)
        result = 31 * result + (dryRun.hashCode())
        result = 31 * result + (failed?.hashCode() ?: 0)
        result = 31 * result + (instancesToExclude?.hashCode() ?: 0)
        result = 31 * result + (lastModifiedDate?.hashCode() ?: 0)
        result = 31 * result + (orderId?.hashCode() ?: 0)
        result = 31 * result + (outpostId?.hashCode() ?: 0)
        result = 31 * result + (requestedInstancePools?.hashCode() ?: 0)
        result = 31 * result + (taskActionOnBlockingInstances?.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 GetCapacityTaskResponse

        if (capacityTaskId != other.capacityTaskId) return false
        if (capacityTaskStatus != other.capacityTaskStatus) return false
        if (completionDate != other.completionDate) return false
        if (creationDate != other.creationDate) return false
        if (dryRun != other.dryRun) return false
        if (failed != other.failed) return false
        if (instancesToExclude != other.instancesToExclude) return false
        if (lastModifiedDate != other.lastModifiedDate) return false
        if (orderId != other.orderId) return false
        if (outpostId != other.outpostId) return false
        if (requestedInstancePools != other.requestedInstancePools) return false
        if (taskActionOnBlockingInstances != other.taskActionOnBlockingInstances) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * ID of the capacity task.
         */
        public var capacityTaskId: kotlin.String? = null
        /**
         * Status of the capacity task.
         *
         * A capacity task can have one of the following statuses:
         * + `REQUESTED` - The capacity task was created and is awaiting the next step by Amazon Web Services Outposts.
         * + `IN_PROGRESS` - The capacity task is running and cannot be cancelled.
         * + `WAITING_FOR_EVACUATION` - The capacity task requires capacity to run. You must stop the recommended EC2 running instances to free up capacity for the task to run.
         */
        public var capacityTaskStatus: aws.sdk.kotlin.services.outposts.model.CapacityTaskStatus? = null
        /**
         * The date the capacity task ran successfully.
         */
        public var completionDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The date the capacity task was created.
         */
        public var creationDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Performs a dry run to determine if you are above or below instance capacity.
         */
        public var dryRun: kotlin.Boolean = false
        /**
         * Reason why the capacity task failed.
         */
        public var failed: aws.sdk.kotlin.services.outposts.model.CapacityTaskFailure? = null
        /**
         * Instances that the user specified they cannot stop in order to free up the capacity needed to run the capacity task.
         */
        public var instancesToExclude: aws.sdk.kotlin.services.outposts.model.InstancesToExclude? = null
        /**
         * The date the capacity task was last modified.
         */
        public var lastModifiedDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * ID of the Amazon Web Services Outposts order associated with the specified capacity task.
         */
        public var orderId: kotlin.String? = null
        /**
         * ID of the Outpost associated with the specified capacity task.
         */
        public var outpostId: kotlin.String? = null
        /**
         * List of instance pools requested in the capacity task.
         */
        public var requestedInstancePools: List? = null
        /**
         * User-specified option in case an instance is blocking the capacity task from running. Shows one of the following options:
         * + `WAIT_FOR_EVACUATION` - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.
         * + `FAIL_TASK` - The capacity task fails.
         */
        public var taskActionOnBlockingInstances: aws.sdk.kotlin.services.outposts.model.TaskActionOnBlockingInstances? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.outposts.model.GetCapacityTaskResponse) : this() {
            this.capacityTaskId = x.capacityTaskId
            this.capacityTaskStatus = x.capacityTaskStatus
            this.completionDate = x.completionDate
            this.creationDate = x.creationDate
            this.dryRun = x.dryRun
            this.failed = x.failed
            this.instancesToExclude = x.instancesToExclude
            this.lastModifiedDate = x.lastModifiedDate
            this.orderId = x.orderId
            this.outpostId = x.outpostId
            this.requestedInstancePools = x.requestedInstancePools
            this.taskActionOnBlockingInstances = x.taskActionOnBlockingInstances
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy