commonMain.aws.sdk.kotlin.services.wafv2.model.HeaderMatchPattern.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wafv2-jvm Show documentation
Show all versions of wafv2-jvm Show documentation
The AWS Kotlin client for WAFV2
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wafv2.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The filter to use to identify the subset of headers to inspect in a web request.
*
* You must specify exactly one setting: either `All`, `IncludedHeaders`, or `ExcludedHeaders`.
*
* Example JSON: `"MatchPattern": { "ExcludedHeaders": [ "KeyToExclude1", "KeyToExclude2" ] }`
*/
public class HeaderMatchPattern private constructor(builder: Builder) {
/**
* Inspect all headers.
*/
public val all: aws.sdk.kotlin.services.wafv2.model.All? = builder.all
/**
* Inspect only the headers whose keys don't match any of the strings specified here.
*/
public val excludedHeaders: List? = builder.excludedHeaders
/**
* Inspect only the headers that have a key that matches one of the strings specified here.
*/
public val includedHeaders: List? = builder.includedHeaders
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.wafv2.model.HeaderMatchPattern = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("HeaderMatchPattern(")
append("all=$all,")
append("excludedHeaders=$excludedHeaders,")
append("includedHeaders=$includedHeaders")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = all?.hashCode() ?: 0
result = 31 * result + (excludedHeaders?.hashCode() ?: 0)
result = 31 * result + (includedHeaders?.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 HeaderMatchPattern
if (all != other.all) return false
if (excludedHeaders != other.excludedHeaders) return false
if (includedHeaders != other.includedHeaders) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.wafv2.model.HeaderMatchPattern = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Inspect all headers.
*/
public var all: aws.sdk.kotlin.services.wafv2.model.All? = null
/**
* Inspect only the headers whose keys don't match any of the strings specified here.
*/
public var excludedHeaders: List? = null
/**
* Inspect only the headers that have a key that matches one of the strings specified here.
*/
public var includedHeaders: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.wafv2.model.HeaderMatchPattern) : this() {
this.all = x.all
this.excludedHeaders = x.excludedHeaders
this.includedHeaders = x.includedHeaders
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.wafv2.model.HeaderMatchPattern = HeaderMatchPattern(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