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

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

/**
 * The patterns to look for in the JSON body. WAF inspects the results of these pattern matches against the rule inspection criteria. This is used with the FieldToMatch option `JsonBody`.
 */
public class JsonMatchPattern private constructor(builder: Builder) {
    /**
     * Match all of the elements. See also `MatchScope` in JsonBody.
     *
     * You must specify either this setting or the `IncludedPaths` setting, but not both.
     */
    public val all: aws.sdk.kotlin.services.wafv2.model.All? = builder.all
    /**
     * Match only the specified include paths. See also `MatchScope` in JsonBody.
     *
     * Provide the include paths using JSON Pointer syntax. For example, `"IncludedPaths": ["/dogs/0/name", "/dogs/1/name"]`. For information about this syntax, see the Internet Engineering Task Force (IETF) documentation [JavaScript Object Notation (JSON) Pointer](https://tools.ietf.org/html/rfc6901).
     *
     * You must specify either this setting or the `All` setting, but not both.
     *
     * Don't use this option to include all paths. Instead, use the `All` setting.
     */
    public val includedPaths: List? = builder.includedPaths

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

    override fun toString(): kotlin.String = buildString {
        append("JsonMatchPattern(")
        append("all=$all,")
        append("includedPaths=$includedPaths")
        append(")")
    }

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

        if (all != other.all) return false
        if (includedPaths != other.includedPaths) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Match all of the elements. See also `MatchScope` in JsonBody.
         *
         * You must specify either this setting or the `IncludedPaths` setting, but not both.
         */
        public var all: aws.sdk.kotlin.services.wafv2.model.All? = null
        /**
         * Match only the specified include paths. See also `MatchScope` in JsonBody.
         *
         * Provide the include paths using JSON Pointer syntax. For example, `"IncludedPaths": ["/dogs/0/name", "/dogs/1/name"]`. For information about this syntax, see the Internet Engineering Task Force (IETF) documentation [JavaScript Object Notation (JSON) Pointer](https://tools.ietf.org/html/rfc6901).
         *
         * You must specify either this setting or the `All` setting, but not both.
         *
         * Don't use this option to include all paths. Instead, use the `All` setting.
         */
        public var includedPaths: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wafv2.model.JsonMatchPattern) : this() {
            this.all = x.all
            this.includedPaths = x.includedPaths
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy