commonMain.aws.sdk.kotlin.services.deadline.model.AssignedSession.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
/**
* The assigned session for the worker.
*/
public class AssignedSession private constructor(builder: Builder) {
/**
* The job ID for the assigned session.
*/
public val jobId: kotlin.String = requireNotNull(builder.jobId) { "A non-null value must be provided for jobId" }
/**
* The log configuration for the worker's assigned session.
*/
public val logConfiguration: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = builder.logConfiguration
/**
* The queue ID of the assigned session.
*/
public val queueId: kotlin.String = requireNotNull(builder.queueId) { "A non-null value must be provided for queueId" }
/**
* The session actions to apply to the assigned session.
*/
public val sessionActions: List = requireNotNull(builder.sessionActions) { "A non-null value must be provided for sessionActions" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.deadline.model.AssignedSession = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AssignedSession(")
append("jobId=$jobId,")
append("logConfiguration=$logConfiguration,")
append("queueId=$queueId,")
append("sessionActions=$sessionActions")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = jobId.hashCode()
result = 31 * result + (logConfiguration?.hashCode() ?: 0)
result = 31 * result + (queueId.hashCode())
result = 31 * result + (sessionActions.hashCode())
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 AssignedSession
if (jobId != other.jobId) return false
if (logConfiguration != other.logConfiguration) return false
if (queueId != other.queueId) return false
if (sessionActions != other.sessionActions) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.AssignedSession = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The job ID for the assigned session.
*/
public var jobId: kotlin.String? = null
/**
* The log configuration for the worker's assigned session.
*/
public var logConfiguration: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = null
/**
* The queue ID of the assigned session.
*/
public var queueId: kotlin.String? = null
/**
* The session actions to apply to the assigned session.
*/
public var sessionActions: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.deadline.model.AssignedSession) : this() {
this.jobId = x.jobId
this.logConfiguration = x.logConfiguration
this.queueId = x.queueId
this.sessionActions = x.sessionActions
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.deadline.model.AssignedSession = AssignedSession(this)
/**
* construct an [aws.sdk.kotlin.services.deadline.model.LogConfiguration] inside the given [block]
*/
public fun logConfiguration(block: aws.sdk.kotlin.services.deadline.model.LogConfiguration.Builder.() -> kotlin.Unit) {
this.logConfiguration = aws.sdk.kotlin.services.deadline.model.LogConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (jobId == null) jobId = ""
if (queueId == null) queueId = ""
if (sessionActions == null) sessionActions = emptyList()
return this
}
}
}