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

commonMain.aws.sdk.kotlin.services.eventbridge.model.FailoverConfig.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.eventbridge.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The failover configuration for an endpoint. This includes what triggers failover and what happens when it's triggered.
 */
public class FailoverConfig private constructor(builder: Builder) {
    /**
     * The main Region of the endpoint.
     */
    public val primary: aws.sdk.kotlin.services.eventbridge.model.Primary? = builder.primary
    /**
     * The Region that events are routed to when failover is triggered or event replication is enabled.
     */
    public val secondary: aws.sdk.kotlin.services.eventbridge.model.Secondary? = builder.secondary

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

    override fun toString(): kotlin.String = buildString {
        append("FailoverConfig(")
        append("primary=$primary,")
        append("secondary=$secondary")
        append(")")
    }

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

        if (primary != other.primary) return false
        if (secondary != other.secondary) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The main Region of the endpoint.
         */
        public var primary: aws.sdk.kotlin.services.eventbridge.model.Primary? = null
        /**
         * The Region that events are routed to when failover is triggered or event replication is enabled.
         */
        public var secondary: aws.sdk.kotlin.services.eventbridge.model.Secondary? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.eventbridge.model.FailoverConfig) : this() {
            this.primary = x.primary
            this.secondary = x.secondary
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy