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

commonMain.aws.sdk.kotlin.services.cloudfront.model.OriginGroupFailoverCriteria.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudfront.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A complex data type that includes information about the failover criteria for an origin group, including the status codes for which CloudFront will failover from the primary origin to the second origin.
 */
public class OriginGroupFailoverCriteria private constructor(builder: Builder) {
    /**
     * The status codes that, when returned from the primary origin, will trigger CloudFront to failover to the second origin.
     */
    public val statusCodes: aws.sdk.kotlin.services.cloudfront.model.StatusCodes? = builder.statusCodes

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

    override fun toString(): kotlin.String = buildString {
        append("OriginGroupFailoverCriteria(")
        append("statusCodes=$statusCodes")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = statusCodes?.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 OriginGroupFailoverCriteria

        if (statusCodes != other.statusCodes) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The status codes that, when returned from the primary origin, will trigger CloudFront to failover to the second origin.
         */
        public var statusCodes: aws.sdk.kotlin.services.cloudfront.model.StatusCodes? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.OriginGroupFailoverCriteria) : this() {
            this.statusCodes = x.statusCodes
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy