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

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

/**
 * A single match condition for a Filter.
 */
public class Condition private constructor(builder: Builder) {
    /**
     * A single action condition. This is the action setting that a log record must contain in order to meet the condition.
     */
    public val actionCondition: aws.sdk.kotlin.services.wafv2.model.ActionCondition? = builder.actionCondition
    /**
     * A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.
     */
    public val labelNameCondition: aws.sdk.kotlin.services.wafv2.model.LabelNameCondition? = builder.labelNameCondition

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

    override fun toString(): kotlin.String = buildString {
        append("Condition(")
        append("actionCondition=$actionCondition,")
        append("labelNameCondition=$labelNameCondition")
        append(")")
    }

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

        if (actionCondition != other.actionCondition) return false
        if (labelNameCondition != other.labelNameCondition) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A single action condition. This is the action setting that a log record must contain in order to meet the condition.
         */
        public var actionCondition: aws.sdk.kotlin.services.wafv2.model.ActionCondition? = null
        /**
         * A single label name condition. This is the fully qualified label name that a log record must contain in order to meet the condition. Fully qualified labels have a prefix, optional namespaces, and label name. The prefix identifies the rule group or web ACL context of the rule that added the label.
         */
        public var labelNameCondition: aws.sdk.kotlin.services.wafv2.model.LabelNameCondition? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wafv2.model.Condition) : this() {
            this.actionCondition = x.actionCondition
            this.labelNameCondition = x.labelNameCondition
        }

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy