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

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



/**
 * A single attack statistics data record. This is returned by DescribeAttackStatistics along with a time range indicating the time period that the attack statistics apply to.
 */
public class AttackStatisticsDataItem private constructor(builder: Builder) {
    /**
     * The number of attacks detected during the time period. This is always present, but might be zero.
     */
    public val attackCount: kotlin.Long = builder.attackCount
    /**
     * Information about the volume of attacks during the time period. If the accompanying `AttackCount` is zero, this setting might be empty.
     */
    public val attackVolume: aws.sdk.kotlin.services.shield.model.AttackVolume? = builder.attackVolume

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

    override fun toString(): kotlin.String = buildString {
        append("AttackStatisticsDataItem(")
        append("attackCount=$attackCount,")
        append("attackVolume=$attackVolume")
        append(")")
    }

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

        if (attackCount != other.attackCount) return false
        if (attackVolume != other.attackVolume) return false

        return true
    }

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

    public class Builder {
        /**
         * The number of attacks detected during the time period. This is always present, but might be zero.
         */
        public var attackCount: kotlin.Long = 0L
        /**
         * Information about the volume of attacks during the time period. If the accompanying `AttackCount` is zero, this setting might be empty.
         */
        public var attackVolume: aws.sdk.kotlin.services.shield.model.AttackVolume? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.shield.model.AttackStatisticsDataItem) : this() {
            this.attackCount = x.attackCount
            this.attackVolume = x.attackVolume
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy