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

commonMain.aws.sdk.kotlin.services.cloudfront.model.OriginGroups.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 for the origin groups specified for a distribution.
 */
public class OriginGroups private constructor(builder: Builder) {
    /**
     * The items (origin groups) in a distribution.
     */
    public val items: List? = builder.items
    /**
     * The number of origin groups.
     */
    public val quantity: kotlin.Int = requireNotNull(builder.quantity) { "A non-null value must be provided for quantity" }

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

    override fun toString(): kotlin.String = buildString {
        append("OriginGroups(")
        append("items=$items,")
        append("quantity=$quantity")
        append(")")
    }

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

        if (items != other.items) return false
        if (quantity != other.quantity) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The items (origin groups) in a distribution.
         */
        public var items: List? = null
        /**
         * The number of origin groups.
         */
        public var quantity: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.OriginGroups) : this() {
            this.items = x.items
            this.quantity = x.quantity
        }

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

        internal fun correctErrors(): Builder {
            if (quantity == null) quantity = 0
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy