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

commonMain.aws.sdk.kotlin.services.deadline.model.StepSummary.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.deadline.model

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

/**
 * The details for a step.
 */
public class StepSummary private constructor(builder: Builder) {
    /**
     * The date and time the resource was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * The user or system that created this resource.
     */
    public val createdBy: kotlin.String = requireNotNull(builder.createdBy) { "A non-null value must be provided for createdBy" }
    /**
     * The number of dependencies for the step.
     */
    public val dependencyCounts: aws.sdk.kotlin.services.deadline.model.DependencyCounts? = builder.dependencyCounts
    /**
     * The date and time the resource ended running.
     */
    public val endedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.endedAt
    /**
     * The life cycle status.
     */
    public val lifecycleStatus: aws.sdk.kotlin.services.deadline.model.StepLifecycleStatus = requireNotNull(builder.lifecycleStatus) { "A non-null value must be provided for lifecycleStatus" }
    /**
     * A message that describes the lifecycle of the step.
     */
    public val lifecycleStatusMessage: kotlin.String? = builder.lifecycleStatusMessage
    /**
     * The name of the step.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The date and time the resource started running.
     */
    public val startedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.startedAt
    /**
     * The step ID.
     */
    public val stepId: kotlin.String = requireNotNull(builder.stepId) { "A non-null value must be provided for stepId" }
    /**
     * The task status to start with on the job.
     */
    public val targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.StepTargetTaskRunStatus? = builder.targetTaskRunStatus
    /**
     * The task run status for the job.
     * + `PENDING`–pending and waiting for resources.
     * + `READY`–ready to process.
     * + `ASSIGNED`–assigned and will run next on a worker.
     * + `SCHEDULED`–scheduled to run on a worker.
     * + `INTERRUPTING`–being interrupted.
     * + `RUNNING`–running on a worker.
     * + `SUSPENDED`–the task is suspended.
     * + `CANCELED`–the task has been canceled.
     * + `FAILED`–the task has failed.
     * + `SUCCEEDED`–the task has succeeded.
     */
    public val taskRunStatus: aws.sdk.kotlin.services.deadline.model.TaskRunStatus = requireNotNull(builder.taskRunStatus) { "A non-null value must be provided for taskRunStatus" }
    /**
     * The number of tasks running on the job.
     */
    public val taskRunStatusCounts: Map = requireNotNull(builder.taskRunStatusCounts) { "A non-null value must be provided for taskRunStatusCounts" }
    /**
     * The date and time the resource was updated.
     */
    public val updatedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.updatedAt
    /**
     * The user or system that updated this resource.
     */
    public val updatedBy: kotlin.String? = builder.updatedBy

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

    override fun toString(): kotlin.String = buildString {
        append("StepSummary(")
        append("createdAt=$createdAt,")
        append("createdBy=$createdBy,")
        append("dependencyCounts=$dependencyCounts,")
        append("endedAt=$endedAt,")
        append("lifecycleStatus=$lifecycleStatus,")
        append("lifecycleStatusMessage=$lifecycleStatusMessage,")
        append("name=$name,")
        append("startedAt=$startedAt,")
        append("stepId=$stepId,")
        append("targetTaskRunStatus=$targetTaskRunStatus,")
        append("taskRunStatus=$taskRunStatus,")
        append("taskRunStatusCounts=$taskRunStatusCounts,")
        append("updatedAt=$updatedAt,")
        append("updatedBy=$updatedBy")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = createdAt.hashCode()
        result = 31 * result + (createdBy.hashCode())
        result = 31 * result + (dependencyCounts?.hashCode() ?: 0)
        result = 31 * result + (endedAt?.hashCode() ?: 0)
        result = 31 * result + (lifecycleStatus.hashCode())
        result = 31 * result + (lifecycleStatusMessage?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (startedAt?.hashCode() ?: 0)
        result = 31 * result + (stepId.hashCode())
        result = 31 * result + (targetTaskRunStatus?.hashCode() ?: 0)
        result = 31 * result + (taskRunStatus.hashCode())
        result = 31 * result + (taskRunStatusCounts.hashCode())
        result = 31 * result + (updatedAt?.hashCode() ?: 0)
        result = 31 * result + (updatedBy?.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 StepSummary

        if (createdAt != other.createdAt) return false
        if (createdBy != other.createdBy) return false
        if (dependencyCounts != other.dependencyCounts) return false
        if (endedAt != other.endedAt) return false
        if (lifecycleStatus != other.lifecycleStatus) return false
        if (lifecycleStatusMessage != other.lifecycleStatusMessage) return false
        if (name != other.name) return false
        if (startedAt != other.startedAt) return false
        if (stepId != other.stepId) return false
        if (targetTaskRunStatus != other.targetTaskRunStatus) return false
        if (taskRunStatus != other.taskRunStatus) return false
        if (taskRunStatusCounts != other.taskRunStatusCounts) return false
        if (updatedAt != other.updatedAt) return false
        if (updatedBy != other.updatedBy) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The date and time the resource was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The user or system that created this resource.
         */
        public var createdBy: kotlin.String? = null
        /**
         * The number of dependencies for the step.
         */
        public var dependencyCounts: aws.sdk.kotlin.services.deadline.model.DependencyCounts? = null
        /**
         * The date and time the resource ended running.
         */
        public var endedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The life cycle status.
         */
        public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.StepLifecycleStatus? = null
        /**
         * A message that describes the lifecycle of the step.
         */
        public var lifecycleStatusMessage: kotlin.String? = null
        /**
         * The name of the step.
         */
        public var name: kotlin.String? = null
        /**
         * The date and time the resource started running.
         */
        public var startedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The step ID.
         */
        public var stepId: kotlin.String? = null
        /**
         * The task status to start with on the job.
         */
        public var targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.StepTargetTaskRunStatus? = null
        /**
         * The task run status for the job.
         * + `PENDING`–pending and waiting for resources.
         * + `READY`–ready to process.
         * + `ASSIGNED`–assigned and will run next on a worker.
         * + `SCHEDULED`–scheduled to run on a worker.
         * + `INTERRUPTING`–being interrupted.
         * + `RUNNING`–running on a worker.
         * + `SUSPENDED`–the task is suspended.
         * + `CANCELED`–the task has been canceled.
         * + `FAILED`–the task has failed.
         * + `SUCCEEDED`–the task has succeeded.
         */
        public var taskRunStatus: aws.sdk.kotlin.services.deadline.model.TaskRunStatus? = null
        /**
         * The number of tasks running on the job.
         */
        public var taskRunStatusCounts: Map? = null
        /**
         * The date and time the resource was updated.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The user or system that updated this resource.
         */
        public var updatedBy: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.deadline.model.StepSummary) : this() {
            this.createdAt = x.createdAt
            this.createdBy = x.createdBy
            this.dependencyCounts = x.dependencyCounts
            this.endedAt = x.endedAt
            this.lifecycleStatus = x.lifecycleStatus
            this.lifecycleStatusMessage = x.lifecycleStatusMessage
            this.name = x.name
            this.startedAt = x.startedAt
            this.stepId = x.stepId
            this.targetTaskRunStatus = x.targetTaskRunStatus
            this.taskRunStatus = x.taskRunStatus
            this.taskRunStatusCounts = x.taskRunStatusCounts
            this.updatedAt = x.updatedAt
            this.updatedBy = x.updatedBy
        }

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

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

        internal fun correctErrors(): Builder {
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (createdBy == null) createdBy = ""
            if (lifecycleStatus == null) lifecycleStatus = StepLifecycleStatus.SdkUnknown("no value provided")
            if (name == null) name = ""
            if (stepId == null) stepId = ""
            if (taskRunStatus == null) taskRunStatus = TaskRunStatus.SdkUnknown("no value provided")
            if (taskRunStatusCounts == null) taskRunStatusCounts = emptyMap()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy