commonMain.aws.sdk.kotlin.services.deadline.model.WorkerSessionSummary.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
/**
* Summarizes the session for a particular worker.
*/
public class WorkerSessionSummary private constructor(builder: Builder) {
/**
* The date and time the resource ended running.
*/
public val endedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.endedAt
/**
* The job ID for the job associated with the worker's session.
*/
public val jobId: kotlin.String = requireNotNull(builder.jobId) { "A non-null value must be provided for jobId" }
/**
* The life cycle status for the worker's session.
*/
public val lifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleStatus = requireNotNull(builder.lifecycleStatus) { "A non-null value must be provided for lifecycleStatus" }
/**
* The queue ID for the queue associated to the worker.
*/
public val queueId: kotlin.String = requireNotNull(builder.queueId) { "A non-null value must be provided for queueId" }
/**
* The session ID for the session action.
*/
public val sessionId: kotlin.String = requireNotNull(builder.sessionId) { "A non-null value must be provided for sessionId" }
/**
* The date and time the resource started running.
*/
public val startedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.startedAt) { "A non-null value must be provided for startedAt" }
/**
* The life cycle status
*/
public val targetLifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleTargetStatus? = builder.targetLifecycleStatus
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.deadline.model.WorkerSessionSummary = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("WorkerSessionSummary(")
append("endedAt=$endedAt,")
append("jobId=$jobId,")
append("lifecycleStatus=$lifecycleStatus,")
append("queueId=$queueId,")
append("sessionId=$sessionId,")
append("startedAt=$startedAt,")
append("targetLifecycleStatus=$targetLifecycleStatus")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = endedAt?.hashCode() ?: 0
result = 31 * result + (jobId.hashCode())
result = 31 * result + (lifecycleStatus.hashCode())
result = 31 * result + (queueId.hashCode())
result = 31 * result + (sessionId.hashCode())
result = 31 * result + (startedAt.hashCode())
result = 31 * result + (targetLifecycleStatus?.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 WorkerSessionSummary
if (endedAt != other.endedAt) return false
if (jobId != other.jobId) return false
if (lifecycleStatus != other.lifecycleStatus) return false
if (queueId != other.queueId) return false
if (sessionId != other.sessionId) return false
if (startedAt != other.startedAt) return false
if (targetLifecycleStatus != other.targetLifecycleStatus) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.WorkerSessionSummary = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The date and time the resource ended running.
*/
public var endedAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The job ID for the job associated with the worker's session.
*/
public var jobId: kotlin.String? = null
/**
* The life cycle status for the worker's session.
*/
public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleStatus? = null
/**
* The queue ID for the queue associated to the worker.
*/
public var queueId: kotlin.String? = null
/**
* The session ID for the session action.
*/
public var sessionId: kotlin.String? = null
/**
* The date and time the resource started running.
*/
public var startedAt: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The life cycle status
*/
public var targetLifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleTargetStatus? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.deadline.model.WorkerSessionSummary) : this() {
this.endedAt = x.endedAt
this.jobId = x.jobId
this.lifecycleStatus = x.lifecycleStatus
this.queueId = x.queueId
this.sessionId = x.sessionId
this.startedAt = x.startedAt
this.targetLifecycleStatus = x.targetLifecycleStatus
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.deadline.model.WorkerSessionSummary = WorkerSessionSummary(this)
internal fun correctErrors(): Builder {
if (jobId == null) jobId = ""
if (lifecycleStatus == null) lifecycleStatus = SessionLifecycleStatus.SdkUnknown("no value provided")
if (queueId == null) queueId = ""
if (sessionId == null) sessionId = ""
if (startedAt == null) startedAt = Instant.fromEpochSeconds(0)
return this
}
}
}