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

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

The 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

public class GetJobResponse private constructor(builder: Builder) {
    /**
     * The attachments for the job.
     */
    public val attachments: aws.sdk.kotlin.services.deadline.model.Attachments? = builder.attachments
    /**
     * 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 description of the job.
     *
     * This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The date and time the resource ended running.
     */
    public val endedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.endedAt
    /**
     * The job ID.
     */
    public val jobId: kotlin.String = requireNotNull(builder.jobId) { "A non-null value must be provided for jobId" }
    /**
     * The life cycle status for the job.
     */
    public val lifecycleStatus: aws.sdk.kotlin.services.deadline.model.JobLifecycleStatus = requireNotNull(builder.lifecycleStatus) { "A non-null value must be provided for lifecycleStatus" }
    /**
     * A message that communicates the status of the life cycle for the job.
     */
    public val lifecycleStatusMessage: kotlin.String = requireNotNull(builder.lifecycleStatusMessage) { "A non-null value must be provided for lifecycleStatusMessage" }
    /**
     * The number of task failures before the job stops running and is marked as `FAILED`.
     */
    public val maxFailedTasksCount: kotlin.Int? = builder.maxFailedTasksCount
    /**
     * The maximum number of retries per failed tasks.
     */
    public val maxRetriesPerTask: kotlin.Int? = builder.maxRetriesPerTask
    /**
     * The name of the job.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The parameters for the job.
     */
    public val parameters: Map? = builder.parameters
    /**
     * The job priority.
     */
    public val priority: kotlin.Int = requireNotNull(builder.priority) { "A non-null value must be provided for priority" }
    /**
     * The date and time the resource started running.
     */
    public val startedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.startedAt
    /**
     * The storage profile ID associated with the job.
     */
    public val storageProfileId: kotlin.String? = builder.storageProfileId
    /**
     * The task status with which the job started.
     */
    public val targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.JobTargetTaskRunStatus? = builder.targetTaskRunStatus
    /**
     * The task run status for the job.
     */
    public val taskRunStatus: aws.sdk.kotlin.services.deadline.model.TaskRunStatus? = builder.taskRunStatus
    /**
     * The number of tasks running on the job.
     */
    public val taskRunStatusCounts: Map? = builder.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.GetJobResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GetJobResponse(")
        append("attachments=$attachments,")
        append("createdAt=$createdAt,")
        append("createdBy=$createdBy,")
        append("description=*** Sensitive Data Redacted ***,")
        append("endedAt=$endedAt,")
        append("jobId=$jobId,")
        append("lifecycleStatus=$lifecycleStatus,")
        append("lifecycleStatusMessage=$lifecycleStatusMessage,")
        append("maxFailedTasksCount=$maxFailedTasksCount,")
        append("maxRetriesPerTask=$maxRetriesPerTask,")
        append("name=$name,")
        append("parameters=*** Sensitive Data Redacted ***,")
        append("priority=$priority,")
        append("startedAt=$startedAt,")
        append("storageProfileId=$storageProfileId,")
        append("targetTaskRunStatus=$targetTaskRunStatus,")
        append("taskRunStatus=$taskRunStatus,")
        append("taskRunStatusCounts=$taskRunStatusCounts,")
        append("updatedAt=$updatedAt,")
        append("updatedBy=$updatedBy")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = attachments?.hashCode() ?: 0
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (createdBy.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (endedAt?.hashCode() ?: 0)
        result = 31 * result + (jobId.hashCode())
        result = 31 * result + (lifecycleStatus.hashCode())
        result = 31 * result + (lifecycleStatusMessage.hashCode())
        result = 31 * result + (maxFailedTasksCount ?: 0)
        result = 31 * result + (maxRetriesPerTask ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (priority)
        result = 31 * result + (startedAt?.hashCode() ?: 0)
        result = 31 * result + (storageProfileId?.hashCode() ?: 0)
        result = 31 * result + (targetTaskRunStatus?.hashCode() ?: 0)
        result = 31 * result + (taskRunStatus?.hashCode() ?: 0)
        result = 31 * result + (taskRunStatusCounts?.hashCode() ?: 0)
        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 GetJobResponse

        if (attachments != other.attachments) return false
        if (createdAt != other.createdAt) return false
        if (createdBy != other.createdBy) return false
        if (description != other.description) return false
        if (endedAt != other.endedAt) return false
        if (jobId != other.jobId) return false
        if (lifecycleStatus != other.lifecycleStatus) return false
        if (lifecycleStatusMessage != other.lifecycleStatusMessage) return false
        if (maxFailedTasksCount != other.maxFailedTasksCount) return false
        if (maxRetriesPerTask != other.maxRetriesPerTask) return false
        if (name != other.name) return false
        if (parameters != other.parameters) return false
        if (priority != other.priority) return false
        if (startedAt != other.startedAt) return false
        if (storageProfileId != other.storageProfileId) 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.GetJobResponse = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The attachments for the job.
         */
        public var attachments: aws.sdk.kotlin.services.deadline.model.Attachments? = null
        /**
         * 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 description of the job.
         *
         * This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.
         */
        public var description: kotlin.String? = null
        /**
         * The date and time the resource ended running.
         */
        public var endedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The job ID.
         */
        public var jobId: kotlin.String? = null
        /**
         * The life cycle status for the job.
         */
        public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.JobLifecycleStatus? = null
        /**
         * A message that communicates the status of the life cycle for the job.
         */
        public var lifecycleStatusMessage: kotlin.String? = null
        /**
         * The number of task failures before the job stops running and is marked as `FAILED`.
         */
        public var maxFailedTasksCount: kotlin.Int? = null
        /**
         * The maximum number of retries per failed tasks.
         */
        public var maxRetriesPerTask: kotlin.Int? = null
        /**
         * The name of the job.
         */
        public var name: kotlin.String? = null
        /**
         * The parameters for the job.
         */
        public var parameters: Map? = null
        /**
         * The job priority.
         */
        public var priority: kotlin.Int? = null
        /**
         * The date and time the resource started running.
         */
        public var startedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The storage profile ID associated with the job.
         */
        public var storageProfileId: kotlin.String? = null
        /**
         * The task status with which the job started.
         */
        public var targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.JobTargetTaskRunStatus? = null
        /**
         * The task run status for the job.
         */
        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.GetJobResponse) : this() {
            this.attachments = x.attachments
            this.createdAt = x.createdAt
            this.createdBy = x.createdBy
            this.description = x.description
            this.endedAt = x.endedAt
            this.jobId = x.jobId
            this.lifecycleStatus = x.lifecycleStatus
            this.lifecycleStatusMessage = x.lifecycleStatusMessage
            this.maxFailedTasksCount = x.maxFailedTasksCount
            this.maxRetriesPerTask = x.maxRetriesPerTask
            this.name = x.name
            this.parameters = x.parameters
            this.priority = x.priority
            this.startedAt = x.startedAt
            this.storageProfileId = x.storageProfileId
            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.GetJobResponse = GetJobResponse(this)

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

        internal fun correctErrors(): Builder {
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (createdBy == null) createdBy = ""
            if (jobId == null) jobId = ""
            if (lifecycleStatus == null) lifecycleStatus = JobLifecycleStatus.SdkUnknown("no value provided")
            if (lifecycleStatusMessage == null) lifecycleStatusMessage = ""
            if (name == null) name = ""
            if (priority == null) priority = 0
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy