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

com.pulumi.azurenative.network.inputs.WebApplicationFirewallCustomRuleArgs Maven / Gradle / Ivy

The newest version!
// *** 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.azurenative.network.inputs;

import com.pulumi.azurenative.network.enums.ApplicationGatewayFirewallRateLimitDuration;
import com.pulumi.azurenative.network.enums.WebApplicationFirewallAction;
import com.pulumi.azurenative.network.enums.WebApplicationFirewallRuleType;
import com.pulumi.azurenative.network.enums.WebApplicationFirewallState;
import com.pulumi.azurenative.network.inputs.GroupByUserSessionArgs;
import com.pulumi.azurenative.network.inputs.MatchConditionArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * Defines contents of a web application rule.
 * 
 */
public final class WebApplicationFirewallCustomRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final WebApplicationFirewallCustomRuleArgs Empty = new WebApplicationFirewallCustomRuleArgs();

    /**
     * Type of Actions.
     * 
     */
    @Import(name="action", required=true)
    private Output> action;

    /**
     * @return Type of Actions.
     * 
     */
    public Output> action() {
        return this.action;
    }

    /**
     * List of user session identifier group by clauses.
     * 
     */
    @Import(name="groupByUserSession")
    private @Nullable Output> groupByUserSession;

    /**
     * @return List of user session identifier group by clauses.
     * 
     */
    public Optional>> groupByUserSession() {
        return Optional.ofNullable(this.groupByUserSession);
    }

    /**
     * List of match conditions.
     * 
     */
    @Import(name="matchConditions", required=true)
    private Output> matchConditions;

    /**
     * @return List of match conditions.
     * 
     */
    public Output> matchConditions() {
        return this.matchConditions;
    }

    /**
     * The name of the resource that is unique within a policy. This name can be used to access the resource.
     * 
     */
    @Import(name="name")
    private @Nullable Output name;

    /**
     * @return The name of the resource that is unique within a policy. This name can be used to access the resource.
     * 
     */
    public Optional> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
     * 
     */
    @Import(name="priority", required=true)
    private Output priority;

    /**
     * @return Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
     * 
     */
    public Output priority() {
        return this.priority;
    }

    /**
     * Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
     * 
     */
    @Import(name="rateLimitDuration")
    private @Nullable Output> rateLimitDuration;

    /**
     * @return Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
     * 
     */
    public Optional>> rateLimitDuration() {
        return Optional.ofNullable(this.rateLimitDuration);
    }

    /**
     * Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1
     * 
     */
    @Import(name="rateLimitThreshold")
    private @Nullable Output rateLimitThreshold;

    /**
     * @return Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1
     * 
     */
    public Optional> rateLimitThreshold() {
        return Optional.ofNullable(this.rateLimitThreshold);
    }

    /**
     * The rule type.
     * 
     */
    @Import(name="ruleType", required=true)
    private Output> ruleType;

    /**
     * @return The rule type.
     * 
     */
    public Output> ruleType() {
        return this.ruleType;
    }

    /**
     * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     * 
     */
    @Import(name="state")
    private @Nullable Output> state;

    /**
     * @return Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
     * 
     */
    public Optional>> state() {
        return Optional.ofNullable(this.state);
    }

    private WebApplicationFirewallCustomRuleArgs() {}

    private WebApplicationFirewallCustomRuleArgs(WebApplicationFirewallCustomRuleArgs $) {
        this.action = $.action;
        this.groupByUserSession = $.groupByUserSession;
        this.matchConditions = $.matchConditions;
        this.name = $.name;
        this.priority = $.priority;
        this.rateLimitDuration = $.rateLimitDuration;
        this.rateLimitThreshold = $.rateLimitThreshold;
        this.ruleType = $.ruleType;
        this.state = $.state;
    }

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

    public static final class Builder {
        private WebApplicationFirewallCustomRuleArgs $;

        public Builder() {
            $ = new WebApplicationFirewallCustomRuleArgs();
        }

        public Builder(WebApplicationFirewallCustomRuleArgs defaults) {
            $ = new WebApplicationFirewallCustomRuleArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param action Type of Actions.
         * 
         * @return builder
         * 
         */
        public Builder action(Output> action) {
            $.action = action;
            return this;
        }

        /**
         * @param action Type of Actions.
         * 
         * @return builder
         * 
         */
        public Builder action(Either action) {
            return action(Output.of(action));
        }

        /**
         * @param action Type of Actions.
         * 
         * @return builder
         * 
         */
        public Builder action(String action) {
            return action(Either.ofLeft(action));
        }

        /**
         * @param action Type of Actions.
         * 
         * @return builder
         * 
         */
        public Builder action(WebApplicationFirewallAction action) {
            return action(Either.ofRight(action));
        }

        /**
         * @param groupByUserSession List of user session identifier group by clauses.
         * 
         * @return builder
         * 
         */
        public Builder groupByUserSession(@Nullable Output> groupByUserSession) {
            $.groupByUserSession = groupByUserSession;
            return this;
        }

        /**
         * @param groupByUserSession List of user session identifier group by clauses.
         * 
         * @return builder
         * 
         */
        public Builder groupByUserSession(List groupByUserSession) {
            return groupByUserSession(Output.of(groupByUserSession));
        }

        /**
         * @param groupByUserSession List of user session identifier group by clauses.
         * 
         * @return builder
         * 
         */
        public Builder groupByUserSession(GroupByUserSessionArgs... groupByUserSession) {
            return groupByUserSession(List.of(groupByUserSession));
        }

        /**
         * @param matchConditions List of match conditions.
         * 
         * @return builder
         * 
         */
        public Builder matchConditions(Output> matchConditions) {
            $.matchConditions = matchConditions;
            return this;
        }

        /**
         * @param matchConditions List of match conditions.
         * 
         * @return builder
         * 
         */
        public Builder matchConditions(List matchConditions) {
            return matchConditions(Output.of(matchConditions));
        }

        /**
         * @param matchConditions List of match conditions.
         * 
         * @return builder
         * 
         */
        public Builder matchConditions(MatchConditionArgs... matchConditions) {
            return matchConditions(List.of(matchConditions));
        }

        /**
         * @param name The name of the resource that is unique within a policy. This name can be used to access the resource.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the resource that is unique within a policy. This name can be used to access the resource.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param priority Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
         * 
         * @return builder
         * 
         */
        public Builder priority(Output priority) {
            $.priority = priority;
            return this;
        }

        /**
         * @param priority Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
         * 
         * @return builder
         * 
         */
        public Builder priority(Integer priority) {
            return priority(Output.of(priority));
        }

        /**
         * @param rateLimitDuration Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
         * 
         * @return builder
         * 
         */
        public Builder rateLimitDuration(@Nullable Output> rateLimitDuration) {
            $.rateLimitDuration = rateLimitDuration;
            return this;
        }

        /**
         * @param rateLimitDuration Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
         * 
         * @return builder
         * 
         */
        public Builder rateLimitDuration(Either rateLimitDuration) {
            return rateLimitDuration(Output.of(rateLimitDuration));
        }

        /**
         * @param rateLimitDuration Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
         * 
         * @return builder
         * 
         */
        public Builder rateLimitDuration(String rateLimitDuration) {
            return rateLimitDuration(Either.ofLeft(rateLimitDuration));
        }

        /**
         * @param rateLimitDuration Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule.
         * 
         * @return builder
         * 
         */
        public Builder rateLimitDuration(ApplicationGatewayFirewallRateLimitDuration rateLimitDuration) {
            return rateLimitDuration(Either.ofRight(rateLimitDuration));
        }

        /**
         * @param rateLimitThreshold Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1
         * 
         * @return builder
         * 
         */
        public Builder rateLimitThreshold(@Nullable Output rateLimitThreshold) {
            $.rateLimitThreshold = rateLimitThreshold;
            return this;
        }

        /**
         * @param rateLimitThreshold Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1
         * 
         * @return builder
         * 
         */
        public Builder rateLimitThreshold(Integer rateLimitThreshold) {
            return rateLimitThreshold(Output.of(rateLimitThreshold));
        }

        /**
         * @param ruleType The rule type.
         * 
         * @return builder
         * 
         */
        public Builder ruleType(Output> ruleType) {
            $.ruleType = ruleType;
            return this;
        }

        /**
         * @param ruleType The rule type.
         * 
         * @return builder
         * 
         */
        public Builder ruleType(Either ruleType) {
            return ruleType(Output.of(ruleType));
        }

        /**
         * @param ruleType The rule type.
         * 
         * @return builder
         * 
         */
        public Builder ruleType(String ruleType) {
            return ruleType(Either.ofLeft(ruleType));
        }

        /**
         * @param ruleType The rule type.
         * 
         * @return builder
         * 
         */
        public Builder ruleType(WebApplicationFirewallRuleType ruleType) {
            return ruleType(Either.ofRight(ruleType));
        }

        /**
         * @param state Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
         * 
         * @return builder
         * 
         */
        public Builder state(@Nullable Output> state) {
            $.state = state;
            return this;
        }

        /**
         * @param state Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
         * 
         * @return builder
         * 
         */
        public Builder state(Either state) {
            return state(Output.of(state));
        }

        /**
         * @param state Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
         * 
         * @return builder
         * 
         */
        public Builder state(String state) {
            return state(Either.ofLeft(state));
        }

        /**
         * @param state Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.
         * 
         * @return builder
         * 
         */
        public Builder state(WebApplicationFirewallState state) {
            return state(Either.ofRight(state));
        }

        public WebApplicationFirewallCustomRuleArgs build() {
            if ($.action == null) {
                throw new MissingRequiredPropertyException("WebApplicationFirewallCustomRuleArgs", "action");
            }
            if ($.matchConditions == null) {
                throw new MissingRequiredPropertyException("WebApplicationFirewallCustomRuleArgs", "matchConditions");
            }
            if ($.priority == null) {
                throw new MissingRequiredPropertyException("WebApplicationFirewallCustomRuleArgs", "priority");
            }
            if ($.ruleType == null) {
                throw new MissingRequiredPropertyException("WebApplicationFirewallCustomRuleArgs", "ruleType");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy