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

commonMain.aws.sdk.kotlin.services.codedeploy.model.TimeBasedLinear.kt Maven / Gradle / Ivy

There is a newer version: 1.3.78
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codedeploy.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A configuration that shifts traffic from one version of a Lambda function or ECS task set to another in equal increments, with an equal number of minutes between each increment. The original and target Lambda function versions or ECS task sets are specified in the deployment's AppSpec file.
 */
public class TimeBasedLinear private constructor(builder: Builder) {
    /**
     * The number of minutes between each incremental traffic shift of a `TimeBasedLinear` deployment.
     */
    public val linearInterval: kotlin.Int = builder.linearInterval
    /**
     * The percentage of traffic that is shifted at the start of each increment of a `TimeBasedLinear` deployment.
     */
    public val linearPercentage: kotlin.Int = builder.linearPercentage

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

    override fun toString(): kotlin.String = buildString {
        append("TimeBasedLinear(")
        append("linearInterval=$linearInterval,")
        append("linearPercentage=$linearPercentage")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = linearInterval
        result = 31 * result + (linearPercentage)
        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 TimeBasedLinear

        if (linearInterval != other.linearInterval) return false
        if (linearPercentage != other.linearPercentage) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The number of minutes between each incremental traffic shift of a `TimeBasedLinear` deployment.
         */
        public var linearInterval: kotlin.Int = 0
        /**
         * The percentage of traffic that is shifted at the start of each increment of a `TimeBasedLinear` deployment.
         */
        public var linearPercentage: kotlin.Int = 0

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codedeploy.model.TimeBasedLinear) : this() {
            this.linearInterval = x.linearInterval
            this.linearPercentage = x.linearPercentage
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy