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

commonMain.aws.sdk.kotlin.services.gamelift.model.GameSessionDetail.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.gamelift.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A game session's properties plus the protection policy currently in force.
 */
public class GameSessionDetail private constructor(builder: Builder) {
    /**
     * Object that describes a game session.
     */
    public val gameSession: aws.sdk.kotlin.services.gamelift.model.GameSession? = builder.gameSession
    /**
     * Current status of protection for the game session.
     * + **NoProtection** -- The game session can be terminated during a scale-down event.
     * + **FullProtection** -- If the game session is in an `ACTIVE` status, it cannot be terminated during a scale-down event.
     */
    public val protectionPolicy: aws.sdk.kotlin.services.gamelift.model.ProtectionPolicy? = builder.protectionPolicy

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

    override fun toString(): kotlin.String = buildString {
        append("GameSessionDetail(")
        append("gameSession=$gameSession,")
        append("protectionPolicy=$protectionPolicy")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = gameSession?.hashCode() ?: 0
        result = 31 * result + (protectionPolicy?.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 GameSessionDetail

        if (gameSession != other.gameSession) return false
        if (protectionPolicy != other.protectionPolicy) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.gamelift.model.GameSessionDetail = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Object that describes a game session.
         */
        public var gameSession: aws.sdk.kotlin.services.gamelift.model.GameSession? = null
        /**
         * Current status of protection for the game session.
         * + **NoProtection** -- The game session can be terminated during a scale-down event.
         * + **FullProtection** -- If the game session is in an `ACTIVE` status, it cannot be terminated during a scale-down event.
         */
        public var protectionPolicy: aws.sdk.kotlin.services.gamelift.model.ProtectionPolicy? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.gamelift.model.GameSessionDetail) : this() {
            this.gameSession = x.gameSession
            this.protectionPolicy = x.protectionPolicy
        }

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy