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

commonMain.aws.sdk.kotlin.services.deadline.model.GetSessionResponse.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 GetSessionResponse private constructor(builder: Builder) {
    /**
     * The date and time the resource ended running.
     */
    public val endedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.endedAt
    /**
     * The fleet ID for the session.
     */
    public val fleetId: kotlin.String = requireNotNull(builder.fleetId) { "A non-null value must be provided for fleetId" }
    /**
     * Provides the Amazon EC2 properties of the host.
     */
    public val hostProperties: aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse? = builder.hostProperties
    /**
     * The life cycle status of the session.
     */
    public val lifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleStatus = requireNotNull(builder.lifecycleStatus) { "A non-null value must be provided for lifecycleStatus" }
    /**
     * The session log.
     */
    public val log: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = builder.log
    /**
     * The session ID.
     */
    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 with which the session started.
     */
    public val targetLifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleTargetStatus? = builder.targetLifecycleStatus
    /**
     * 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
    /**
     * The worker ID for the session.
     */
    public val workerId: kotlin.String = requireNotNull(builder.workerId) { "A non-null value must be provided for workerId" }
    /**
     * The worker log for the session.
     */
    public val workerLog: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = builder.workerLog

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

    override fun toString(): kotlin.String = buildString {
        append("GetSessionResponse(")
        append("endedAt=$endedAt,")
        append("fleetId=$fleetId,")
        append("hostProperties=$hostProperties,")
        append("lifecycleStatus=$lifecycleStatus,")
        append("log=$log,")
        append("sessionId=$sessionId,")
        append("startedAt=$startedAt,")
        append("targetLifecycleStatus=$targetLifecycleStatus,")
        append("updatedAt=$updatedAt,")
        append("updatedBy=$updatedBy,")
        append("workerId=$workerId,")
        append("workerLog=$workerLog")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = endedAt?.hashCode() ?: 0
        result = 31 * result + (fleetId.hashCode())
        result = 31 * result + (hostProperties?.hashCode() ?: 0)
        result = 31 * result + (lifecycleStatus.hashCode())
        result = 31 * result + (log?.hashCode() ?: 0)
        result = 31 * result + (sessionId.hashCode())
        result = 31 * result + (startedAt.hashCode())
        result = 31 * result + (targetLifecycleStatus?.hashCode() ?: 0)
        result = 31 * result + (updatedAt?.hashCode() ?: 0)
        result = 31 * result + (updatedBy?.hashCode() ?: 0)
        result = 31 * result + (workerId.hashCode())
        result = 31 * result + (workerLog?.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 GetSessionResponse

        if (endedAt != other.endedAt) return false
        if (fleetId != other.fleetId) return false
        if (hostProperties != other.hostProperties) return false
        if (lifecycleStatus != other.lifecycleStatus) return false
        if (log != other.log) return false
        if (sessionId != other.sessionId) return false
        if (startedAt != other.startedAt) return false
        if (targetLifecycleStatus != other.targetLifecycleStatus) return false
        if (updatedAt != other.updatedAt) return false
        if (updatedBy != other.updatedBy) return false
        if (workerId != other.workerId) return false
        if (workerLog != other.workerLog) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.GetSessionResponse = 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 fleet ID for the session.
         */
        public var fleetId: kotlin.String? = null
        /**
         * Provides the Amazon EC2 properties of the host.
         */
        public var hostProperties: aws.sdk.kotlin.services.deadline.model.HostPropertiesResponse? = null
        /**
         * The life cycle status of the session.
         */
        public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleStatus? = null
        /**
         * The session log.
         */
        public var log: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = null
        /**
         * The session ID.
         */
        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 with which the session started.
         */
        public var targetLifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleTargetStatus? = 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
        /**
         * The worker ID for the session.
         */
        public var workerId: kotlin.String? = null
        /**
         * The worker log for the session.
         */
        public var workerLog: aws.sdk.kotlin.services.deadline.model.LogConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.deadline.model.GetSessionResponse) : this() {
            this.endedAt = x.endedAt
            this.fleetId = x.fleetId
            this.hostProperties = x.hostProperties
            this.lifecycleStatus = x.lifecycleStatus
            this.log = x.log
            this.sessionId = x.sessionId
            this.startedAt = x.startedAt
            this.targetLifecycleStatus = x.targetLifecycleStatus
            this.updatedAt = x.updatedAt
            this.updatedBy = x.updatedBy
            this.workerId = x.workerId
            this.workerLog = x.workerLog
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            if (fleetId == null) fleetId = ""
            if (lifecycleStatus == null) lifecycleStatus = SessionLifecycleStatus.SdkUnknown("no value provided")
            if (sessionId == null) sessionId = ""
            if (startedAt == null) startedAt = Instant.fromEpochSeconds(0)
            if (workerId == null) workerId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy