commonMain.aws.sdk.kotlin.services.deadline.model.JobSummary.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// 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
/**
* A summary of job details.
*/
public class JobSummary 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 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.
*/
public val lifecycleStatus: aws.sdk.kotlin.services.deadline.model.JobLifecycleStatus = requireNotNull(builder.lifecycleStatus) { "A non-null value must be provided for lifecycleStatus" }
/**
* The life cycle status message.
*/
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 for a job.
*/
public val maxRetriesPerTask: kotlin.Int? = builder.maxRetriesPerTask
/**
* The job name.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* 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 task status to start with on the job.
*/
public val targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.JobTargetTaskRunStatus? = builder.targetTaskRunStatus
/**
* The task run status for the job.
* + `PENDING`–pending and waiting for resources.
* + `READY`–ready to be processed.
* + `ASSIGNED`–assigned and will run next on a worker.
* + `SCHEDULED`–scheduled to be 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? = 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.JobSummary = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("JobSummary(")
append("createdAt=$createdAt,")
append("createdBy=$createdBy,")
append("endedAt=$endedAt,")
append("jobId=$jobId,")
append("lifecycleStatus=$lifecycleStatus,")
append("lifecycleStatusMessage=$lifecycleStatusMessage,")
append("maxFailedTasksCount=$maxFailedTasksCount,")
append("maxRetriesPerTask=$maxRetriesPerTask,")
append("name=$name,")
append("priority=$priority,")
append("startedAt=$startedAt,")
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 + (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 + (priority)
result = 31 * result + (startedAt?.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 JobSummary
if (createdAt != other.createdAt) return false
if (createdBy != other.createdBy) 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 (priority != other.priority) return false
if (startedAt != other.startedAt) 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.JobSummary = 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 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.
*/
public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.JobLifecycleStatus? = null
/**
* The life cycle status message.
*/
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 for a job.
*/
public var maxRetriesPerTask: kotlin.Int? = null
/**
* The job name.
*/
public var name: kotlin.String? = 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 task status to start with on the job.
*/
public var targetTaskRunStatus: aws.sdk.kotlin.services.deadline.model.JobTargetTaskRunStatus? = null
/**
* The task run status for the job.
* + `PENDING`–pending and waiting for resources.
* + `READY`–ready to be processed.
* + `ASSIGNED`–assigned and will run next on a worker.
* + `SCHEDULED`–scheduled to be 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.JobSummary) : this() {
this.createdAt = x.createdAt
this.createdBy = x.createdBy
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.priority = x.priority
this.startedAt = x.startedAt
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.JobSummary = JobSummary(this)
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
}
}
}