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

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

The 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 Amazon ECS task set to another in two increments. The original and target Lambda function versions or ECS task sets are specified in the deployment's AppSpec file.
 */
public class TimeBasedCanary private constructor(builder: Builder) {
    /**
     * The number of minutes between the first and second traffic shifts of a `TimeBasedCanary` deployment.
     */
    public val canaryInterval: kotlin.Int = builder.canaryInterval
    /**
     * The percentage of traffic to shift in the first increment of a `TimeBasedCanary` deployment.
     */
    public val canaryPercentage: kotlin.Int = builder.canaryPercentage

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

    override fun toString(): kotlin.String = buildString {
        append("TimeBasedCanary(")
        append("canaryInterval=$canaryInterval,")
        append("canaryPercentage=$canaryPercentage")
        append(")")
    }

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

        if (canaryInterval != other.canaryInterval) return false
        if (canaryPercentage != other.canaryPercentage) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The number of minutes between the first and second traffic shifts of a `TimeBasedCanary` deployment.
         */
        public var canaryInterval: kotlin.Int = 0
        /**
         * The percentage of traffic to shift in the first increment of a `TimeBasedCanary` deployment.
         */
        public var canaryPercentage: kotlin.Int = 0

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codedeploy.model.TimeBasedCanary) : this() {
            this.canaryInterval = x.canaryInterval
            this.canaryPercentage = x.canaryPercentage
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy