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

commonMain.aws.sdk.kotlin.services.shield.model.Limit.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.shield.model



/**
 * Specifies how many protections of a given type you can create.
 */
public class Limit private constructor(builder: Builder) {
    /**
     * The maximum number of protections that can be created for the specified `Type`.
     */
    public val max: kotlin.Long = builder.max
    /**
     * The type of protection.
     */
    public val type: kotlin.String? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("Limit(")
        append("max=$max,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = max.hashCode()
        result = 31 * result + (type?.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 Limit

        if (max != other.max) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * The maximum number of protections that can be created for the specified `Type`.
         */
        public var max: kotlin.Long = 0L
        /**
         * The type of protection.
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.shield.model.Limit) : this() {
            this.max = x.max
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.shield.model.Limit = Limit(this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy