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

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

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

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



/**
 * **This data type is used with the Amazon GameLift FleetIQ and game server groups.**
 *
 * Configuration settings for intelligent automatic scaling that uses target tracking. These settings are used to add an Auto Scaling policy when creating the corresponding Auto Scaling group. After the Auto Scaling group is created, all updates to Auto Scaling policies, including changing this policy and adding or removing other policies, is done directly on the Auto Scaling group.
 */
public class GameServerGroupAutoScalingPolicy private constructor(builder: Builder) {
    /**
     * Length of time, in seconds, it takes for a new instance to start new game server processes and register with Amazon GameLift FleetIQ. Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.
     */
    public val estimatedInstanceWarmup: kotlin.Int? = builder.estimatedInstanceWarmup
    /**
     * Settings for a target-based scaling policy applied to Auto Scaling group. These settings are used to create a target-based policy that tracks the Amazon GameLift FleetIQ metric `"PercentUtilizedGameServers"` and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.
     */
    public val targetTrackingConfiguration: aws.sdk.kotlin.services.gamelift.model.TargetTrackingConfiguration? = builder.targetTrackingConfiguration

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

    override fun toString(): kotlin.String = buildString {
        append("GameServerGroupAutoScalingPolicy(")
        append("estimatedInstanceWarmup=$estimatedInstanceWarmup,")
        append("targetTrackingConfiguration=$targetTrackingConfiguration")
        append(")")
    }

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

        if (estimatedInstanceWarmup != other.estimatedInstanceWarmup) return false
        if (targetTrackingConfiguration != other.targetTrackingConfiguration) return false

        return true
    }

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

    public class Builder {
        /**
         * Length of time, in seconds, it takes for a new instance to start new game server processes and register with Amazon GameLift FleetIQ. Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.
         */
        public var estimatedInstanceWarmup: kotlin.Int? = null
        /**
         * Settings for a target-based scaling policy applied to Auto Scaling group. These settings are used to create a target-based policy that tracks the Amazon GameLift FleetIQ metric `"PercentUtilizedGameServers"` and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.
         */
        public var targetTrackingConfiguration: aws.sdk.kotlin.services.gamelift.model.TargetTrackingConfiguration? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.gamelift.model.GameServerGroupAutoScalingPolicy) : this() {
            this.estimatedInstanceWarmup = x.estimatedInstanceWarmup
            this.targetTrackingConfiguration = x.targetTrackingConfiguration
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy