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

commonMain.aws.sdk.kotlin.services.waf.model.UpdateWebAclRequest.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.waf.model

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdateWebAclRequest private constructor(builder: Builder) {
    /**
     * The value returned by the most recent call to GetChangeToken.
     */
    public val changeToken: kotlin.String? = builder.changeToken
    /**
     * A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the rules in a web ACL.
     */
    public val defaultAction: aws.sdk.kotlin.services.waf.model.WafAction? = builder.defaultAction
    /**
     * An array of updates to make to the WebACL.
     *
     * An array of `WebACLUpdate` objects that you want to insert into or delete from a WebACL. For more information, see the applicable data types:
     * + WebACLUpdate: Contains `Action` and `ActivatedRule`
     * + ActivatedRule: Contains `Action`, `OverrideAction`, `Priority`, `RuleId`, and `Type`. `ActivatedRule|OverrideAction` applies only when updating or adding a `RuleGroup` to a `WebACL`. In this case, you do not use `ActivatedRule|Action`. For all other update requests, `ActivatedRule|Action` is used instead of `ActivatedRule|OverrideAction`.
     * + WafAction: Contains `Type`
     */
    public val updates: List? = builder.updates
    /**
     * The `WebACLId` of the WebACL that you want to update. `WebACLId` is returned by CreateWebACL and by ListWebACLs.
     */
    public val webAclId: kotlin.String? = builder.webAclId

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateWebAclRequest(")
        append("changeToken=$changeToken,")
        append("defaultAction=$defaultAction,")
        append("updates=$updates,")
        append("webAclId=$webAclId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = changeToken?.hashCode() ?: 0
        result = 31 * result + (defaultAction?.hashCode() ?: 0)
        result = 31 * result + (updates?.hashCode() ?: 0)
        result = 31 * result + (webAclId?.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 UpdateWebAclRequest

        if (changeToken != other.changeToken) return false
        if (defaultAction != other.defaultAction) return false
        if (updates != other.updates) return false
        if (webAclId != other.webAclId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The value returned by the most recent call to GetChangeToken.
         */
        public var changeToken: kotlin.String? = null
        /**
         * A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the rules in a web ACL.
         */
        public var defaultAction: aws.sdk.kotlin.services.waf.model.WafAction? = null
        /**
         * An array of updates to make to the WebACL.
         *
         * An array of `WebACLUpdate` objects that you want to insert into or delete from a WebACL. For more information, see the applicable data types:
         * + WebACLUpdate: Contains `Action` and `ActivatedRule`
         * + ActivatedRule: Contains `Action`, `OverrideAction`, `Priority`, `RuleId`, and `Type`. `ActivatedRule|OverrideAction` applies only when updating or adding a `RuleGroup` to a `WebACL`. In this case, you do not use `ActivatedRule|Action`. For all other update requests, `ActivatedRule|Action` is used instead of `ActivatedRule|OverrideAction`.
         * + WafAction: Contains `Type`
         */
        public var updates: List? = null
        /**
         * The `WebACLId` of the WebACL that you want to update. `WebACLId` is returned by CreateWebACL and by ListWebACLs.
         */
        public var webAclId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.waf.model.UpdateWebAclRequest) : this() {
            this.changeToken = x.changeToken
            this.defaultAction = x.defaultAction
            this.updates = x.updates
            this.webAclId = x.webAclId
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy