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

commonMain.aws.sdk.kotlin.services.wafv2.model.ImmunityTimeProperty.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.wafv2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Used for CAPTCHA and challenge token settings. Determines how long a `CAPTCHA` or challenge timestamp remains valid after WAF updates it for a successful `CAPTCHA` or challenge response.
 */
public class ImmunityTimeProperty private constructor(builder: Builder) {
    /**
     * The amount of time, in seconds, that a `CAPTCHA` or challenge timestamp is considered valid by WAF. The default setting is 300.
     *
     * For the Challenge action, the minimum setting is 300.
     */
    public val immunityTime: kotlin.Long = requireNotNull(builder.immunityTime) { "A non-null value must be provided for immunityTime" }

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

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

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

        if (immunityTime != other.immunityTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The amount of time, in seconds, that a `CAPTCHA` or challenge timestamp is considered valid by WAF. The default setting is 300.
         *
         * For the Challenge action, the minimum setting is 300.
         */
        public var immunityTime: kotlin.Long? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wafv2.model.ImmunityTimeProperty) : this() {
            this.immunityTime = x.immunityTime
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy