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

commonMain.aws.sdk.kotlin.services.wafv2.model.ActionCondition.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wafv2.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A single action condition for a Condition in a logging filter.
 */
public class ActionCondition private constructor(builder: Builder) {
    /**
     * The action setting that a log record must contain in order to meet the condition. This is the action that WAF applied to the web request.
     *
     * For rule groups, this is either the configured rule action setting, or if you've applied a rule action override to the rule, it's the override action. The value `EXCLUDED_AS_COUNT` matches on excluded rules and also on rules that have a rule action override of Count.
     */
    public val action: aws.sdk.kotlin.services.wafv2.model.ActionValue = requireNotNull(builder.action) { "A non-null value must be provided for action" }

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

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

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

        if (action != other.action) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The action setting that a log record must contain in order to meet the condition. This is the action that WAF applied to the web request.
         *
         * For rule groups, this is either the configured rule action setting, or if you've applied a rule action override to the rule, it's the override action. The value `EXCLUDED_AS_COUNT` matches on excluded rules and also on rules that have a rule action override of Count.
         */
        public var action: aws.sdk.kotlin.services.wafv2.model.ActionValue? = null

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

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

        internal fun correctErrors(): Builder {
            if (action == null) action = ActionValue.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy