// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.wafv2.outputs;

import com.pulumi.aws.wafv2.outputs.WebAclRuleActionAllow;
import com.pulumi.aws.wafv2.outputs.WebAclRuleActionBlock;
import com.pulumi.aws.wafv2.outputs.WebAclRuleActionCaptcha;
import com.pulumi.aws.wafv2.outputs.WebAclRuleActionChallenge;
import com.pulumi.aws.wafv2.outputs.WebAclRuleActionCount;
import com.pulumi.core.annotations.CustomType;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class WebAclRuleAction {
    /**
     * @return Instructs AWS WAF to allow the web request. See `allow` below for details.
     * 
     */
    private @Nullable WebAclRuleActionAllow allow;
    /**
     * @return Instructs AWS WAF to block the web request. See `block` below for details.
     * 
     */
    private @Nullable WebAclRuleActionBlock block;
    /**
     * @return Instructs AWS WAF to run a Captcha check against the web request. See `captcha` below for details.
     * 
     */
    private @Nullable WebAclRuleActionCaptcha captcha;
    /**
     * @return Instructs AWS WAF to run a check against the request to verify that the request is coming from a legitimate client session. See `challenge` below for details.
     * 
     */
    private @Nullable WebAclRuleActionChallenge challenge;
    /**
     * @return Instructs AWS WAF to count the web request and allow it. See `count` below for details.
     * 
     */
    private @Nullable WebAclRuleActionCount count;

    private WebAclRuleAction() {}
    /**
     * @return Instructs AWS WAF to allow the web request. See `allow` below for details.
     * 
     */
    public Optional<WebAclRuleActionAllow> allow() {
        return Optional.ofNullable(this.allow);
    }
    /**
     * @return Instructs AWS WAF to block the web request. See `block` below for details.
     * 
     */
    public Optional<WebAclRuleActionBlock> block() {
        return Optional.ofNullable(this.block);
    }
    /**
     * @return Instructs AWS WAF to run a Captcha check against the web request. See `captcha` below for details.
     * 
     */
    public Optional<WebAclRuleActionCaptcha> captcha() {
        return Optional.ofNullable(this.captcha);
    }
    /**
     * @return Instructs AWS WAF to run a check against the request to verify that the request is coming from a legitimate client session. See `challenge` below for details.
     * 
     */
    public Optional<WebAclRuleActionChallenge> challenge() {
        return Optional.ofNullable(this.challenge);
    }
    /**
     * @return Instructs AWS WAF to count the web request and allow it. See `count` below for details.
     * 
     */
    public Optional<WebAclRuleActionCount> count() {
        return Optional.ofNullable(this.count);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(WebAclRuleAction defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable WebAclRuleActionAllow allow;
        private @Nullable WebAclRuleActionBlock block;
        private @Nullable WebAclRuleActionCaptcha captcha;
        private @Nullable WebAclRuleActionChallenge challenge;
        private @Nullable WebAclRuleActionCount count;
        public Builder() {}
        public Builder(WebAclRuleAction defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.allow = defaults.allow;
    	      this.block = defaults.block;
    	      this.captcha = defaults.captcha;
    	      this.challenge = defaults.challenge;
    	      this.count = defaults.count;
        }

        @CustomType.Setter
        public Builder allow(@Nullable WebAclRuleActionAllow allow) {
            this.allow = allow;
            return this;
        }
        @CustomType.Setter
        public Builder block(@Nullable WebAclRuleActionBlock block) {
            this.block = block;
            return this;
        }
        @CustomType.Setter
        public Builder captcha(@Nullable WebAclRuleActionCaptcha captcha) {
            this.captcha = captcha;
            return this;
        }
        @CustomType.Setter
        public Builder challenge(@Nullable WebAclRuleActionChallenge challenge) {
            this.challenge = challenge;
            return this;
        }
        @CustomType.Setter
        public Builder count(@Nullable WebAclRuleActionCount count) {
            this.count = count;
            return this;
        }
        public WebAclRuleAction build() {
            final var o = new WebAclRuleAction();
            o.allow = allow;
            o.block = block;
            o.captcha = captcha;
            o.challenge = challenge;
            o.count = count;
            return o;
        }
    }
}
