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

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

There is a newer version: 1.3.34
Show 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

/**
 * The summary of a session.
 */
public class SessionSummary 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.
     */
    public val fleetId: kotlin.String = requireNotNull(builder.fleetId) { "A non-null value must be provided for fleetId" }
    /**
     * The life cycle status for 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 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 target life cycle status for the session.
     */
    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.
     */
    public val workerId: kotlin.String = requireNotNull(builder.workerId) { "A non-null value must be provided for workerId" }

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

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

    override fun hashCode(): kotlin.Int {
        var result = endedAt?.hashCode() ?: 0
        result = 31 * result + (fleetId.hashCode())
        result = 31 * result + (lifecycleStatus.hashCode())
        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())
        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 SessionSummary

        if (endedAt != other.endedAt) return false
        if (fleetId != other.fleetId) return false
        if (lifecycleStatus != other.lifecycleStatus) 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

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.SessionSummary = 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.
         */
        public var fleetId: kotlin.String? = null
        /**
         * The life cycle status for the session.
         */
        public var lifecycleStatus: aws.sdk.kotlin.services.deadline.model.SessionLifecycleStatus? = 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 target life cycle status for the session.
         */
        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.
         */
        public var workerId: kotlin.String? = null

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

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

        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