commonMain.aws.sdk.kotlin.services.waf.model.WebAclUpdate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of waf-jvm Show documentation
Show all versions of waf-jvm Show documentation
The AWS SDK for Kotlin client for WAF
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.waf.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* This is **AWS WAF Classic** documentation. For more information, see [AWS WAF Classic](https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html) in the developer guide.
*
* **For the latest version of AWS WAF**, use the AWS WAFV2 API and see the [AWS WAF Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). With the latest version, AWS WAF has a single set of endpoints for regional and global use.
*
* Specifies whether to insert a `Rule` into or delete a `Rule` from a `WebACL`.
*/
public class WebAclUpdate private constructor(builder: Builder) {
/**
* Specifies whether to insert a `Rule` into or delete a `Rule` from a `WebACL`.
*/
public val action: aws.sdk.kotlin.services.waf.model.ChangeAction = requireNotNull(builder.action) { "A non-null value must be provided for action" }
/**
* The `ActivatedRule` object in an UpdateWebACL request specifies a `Rule` that you want to insert or delete, the priority of the `Rule` in the `WebACL`, and the action that you want AWS WAF to take when a web request matches the `Rule` (`ALLOW`, `BLOCK`, or `COUNT`).
*/
public val activatedRule: aws.sdk.kotlin.services.waf.model.ActivatedRule? = builder.activatedRule
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.waf.model.WebAclUpdate = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("WebAclUpdate(")
append("action=$action,")
append("activatedRule=$activatedRule")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = action.hashCode()
result = 31 * result + (activatedRule?.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 WebAclUpdate
if (action != other.action) return false
if (activatedRule != other.activatedRule) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.waf.model.WebAclUpdate = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Specifies whether to insert a `Rule` into or delete a `Rule` from a `WebACL`.
*/
public var action: aws.sdk.kotlin.services.waf.model.ChangeAction? = null
/**
* The `ActivatedRule` object in an UpdateWebACL request specifies a `Rule` that you want to insert or delete, the priority of the `Rule` in the `WebACL`, and the action that you want AWS WAF to take when a web request matches the `Rule` (`ALLOW`, `BLOCK`, or `COUNT`).
*/
public var activatedRule: aws.sdk.kotlin.services.waf.model.ActivatedRule? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.waf.model.WebAclUpdate) : this() {
this.action = x.action
this.activatedRule = x.activatedRule
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.waf.model.WebAclUpdate = WebAclUpdate(this)
/**
* construct an [aws.sdk.kotlin.services.waf.model.ActivatedRule] inside the given [block]
*/
public fun activatedRule(block: aws.sdk.kotlin.services.waf.model.ActivatedRule.Builder.() -> kotlin.Unit) {
this.activatedRule = aws.sdk.kotlin.services.waf.model.ActivatedRule.invoke(block)
}
internal fun correctErrors(): Builder {
if (action == null) action = ChangeAction.SdkUnknown("no value provided")
return this
}
}
}