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

com.pulumi.azurenative.cdn.RuleArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show 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.cdn;

import com.pulumi.azurenative.cdn.enums.MatchProcessingBehavior;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleCacheExpirationActionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleCacheKeyQueryStringActionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleClientPortConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleCookiesConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleHostNameConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleHttpVersionConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleIsDeviceConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRulePostArgsConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleQueryStringConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRemoteAddressConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestBodyConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestHeaderActionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestHeaderConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestMethodConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestSchemeConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRequestUriConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleResponseHeaderActionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleRouteConfigurationOverrideActionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleServerPortConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleSocketAddrConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleSslProtocolConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleUrlFileExtensionConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleUrlFileNameConditionArgs;
import com.pulumi.azurenative.cdn.inputs.DeliveryRuleUrlPathConditionArgs;
import com.pulumi.azurenative.cdn.inputs.OriginGroupOverrideActionArgs;
import com.pulumi.azurenative.cdn.inputs.UrlRedirectActionArgs;
import com.pulumi.azurenative.cdn.inputs.UrlRewriteActionArgs;
import com.pulumi.azurenative.cdn.inputs.UrlSigningActionArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class RuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final RuleArgs Empty = new RuleArgs();

    /**
     * A list of actions that are executed when all the conditions of a rule are satisfied.
     * 
     */
    @Import(name="actions", required=true)
    private Output> actions;

    /**
     * @return A list of actions that are executed when all the conditions of a rule are satisfied.
     * 
     */
    public Output> actions() {
        return this.actions;
    }

    /**
     * A list of conditions that must be matched for the actions to be executed
     * 
     */
    @Import(name="conditions")
    private @Nullable Output> conditions;

    /**
     * @return A list of conditions that must be matched for the actions to be executed
     * 
     */
    public Optional>> conditions() {
        return Optional.ofNullable(this.conditions);
    }

    /**
     * If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
     * 
     */
    @Import(name="matchProcessingBehavior")
    private @Nullable Output> matchProcessingBehavior;

    /**
     * @return If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
     * 
     */
    public Optional>> matchProcessingBehavior() {
        return Optional.ofNullable(this.matchProcessingBehavior);
    }

    /**
     * The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
     * 
     */
    @Import(name="order", required=true)
    private Output order;

    /**
     * @return The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
     * 
     */
    public Output order() {
        return this.order;
    }

    /**
     * Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     * 
     */
    @Import(name="profileName", required=true)
    private Output profileName;

    /**
     * @return Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     * 
     */
    public Output profileName() {
        return this.profileName;
    }

    /**
     * Name of the Resource group within the Azure subscription.
     * 
     */
    @Import(name="resourceGroupName", required=true)
    private Output resourceGroupName;

    /**
     * @return Name of the Resource group within the Azure subscription.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }

    /**
     * Name of the delivery rule which is unique within the endpoint.
     * 
     */
    @Import(name="ruleName")
    private @Nullable Output ruleName;

    /**
     * @return Name of the delivery rule which is unique within the endpoint.
     * 
     */
    public Optional> ruleName() {
        return Optional.ofNullable(this.ruleName);
    }

    /**
     * Name of the rule set under the profile.
     * 
     */
    @Import(name="ruleSetName", required=true)
    private Output ruleSetName;

    /**
     * @return Name of the rule set under the profile.
     * 
     */
    public Output ruleSetName() {
        return this.ruleSetName;
    }

    private RuleArgs() {}

    private RuleArgs(RuleArgs $) {
        this.actions = $.actions;
        this.conditions = $.conditions;
        this.matchProcessingBehavior = $.matchProcessingBehavior;
        this.order = $.order;
        this.profileName = $.profileName;
        this.resourceGroupName = $.resourceGroupName;
        this.ruleName = $.ruleName;
        this.ruleSetName = $.ruleSetName;
    }

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

    public static final class Builder {
        private RuleArgs $;

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

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

        /**
         * @param actions A list of actions that are executed when all the conditions of a rule are satisfied.
         * 
         * @return builder
         * 
         */
        public Builder actions(Output> actions) {
            $.actions = actions;
            return this;
        }

        /**
         * @param actions A list of actions that are executed when all the conditions of a rule are satisfied.
         * 
         * @return builder
         * 
         */
        public Builder actions(List actions) {
            return actions(Output.of(actions));
        }

        /**
         * @param actions A list of actions that are executed when all the conditions of a rule are satisfied.
         * 
         * @return builder
         * 
         */
        public Builder actions(Object... actions) {
            return actions(List.of(actions));
        }

        /**
         * @param conditions A list of conditions that must be matched for the actions to be executed
         * 
         * @return builder
         * 
         */
        public Builder conditions(@Nullable Output> conditions) {
            $.conditions = conditions;
            return this;
        }

        /**
         * @param conditions A list of conditions that must be matched for the actions to be executed
         * 
         * @return builder
         * 
         */
        public Builder conditions(List conditions) {
            return conditions(Output.of(conditions));
        }

        /**
         * @param conditions A list of conditions that must be matched for the actions to be executed
         * 
         * @return builder
         * 
         */
        public Builder conditions(Object... conditions) {
            return conditions(List.of(conditions));
        }

        /**
         * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
         * 
         * @return builder
         * 
         */
        public Builder matchProcessingBehavior(@Nullable Output> matchProcessingBehavior) {
            $.matchProcessingBehavior = matchProcessingBehavior;
            return this;
        }

        /**
         * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
         * 
         * @return builder
         * 
         */
        public Builder matchProcessingBehavior(Either matchProcessingBehavior) {
            return matchProcessingBehavior(Output.of(matchProcessingBehavior));
        }

        /**
         * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
         * 
         * @return builder
         * 
         */
        public Builder matchProcessingBehavior(String matchProcessingBehavior) {
            return matchProcessingBehavior(Either.ofLeft(matchProcessingBehavior));
        }

        /**
         * @param matchProcessingBehavior If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
         * 
         * @return builder
         * 
         */
        public Builder matchProcessingBehavior(MatchProcessingBehavior matchProcessingBehavior) {
            return matchProcessingBehavior(Either.ofRight(matchProcessingBehavior));
        }

        /**
         * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
         * 
         * @return builder
         * 
         */
        public Builder order(Output order) {
            $.order = order;
            return this;
        }

        /**
         * @param order The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
         * 
         * @return builder
         * 
         */
        public Builder order(Integer order) {
            return order(Output.of(order));
        }

        /**
         * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
         * 
         * @return builder
         * 
         */
        public Builder profileName(Output profileName) {
            $.profileName = profileName;
            return this;
        }

        /**
         * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
         * 
         * @return builder
         * 
         */
        public Builder profileName(String profileName) {
            return profileName(Output.of(profileName));
        }

        /**
         * @param resourceGroupName Name of the Resource group within the Azure subscription.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(Output resourceGroupName) {
            $.resourceGroupName = resourceGroupName;
            return this;
        }

        /**
         * @param resourceGroupName Name of the Resource group within the Azure subscription.
         * 
         * @return builder
         * 
         */
        public Builder resourceGroupName(String resourceGroupName) {
            return resourceGroupName(Output.of(resourceGroupName));
        }

        /**
         * @param ruleName Name of the delivery rule which is unique within the endpoint.
         * 
         * @return builder
         * 
         */
        public Builder ruleName(@Nullable Output ruleName) {
            $.ruleName = ruleName;
            return this;
        }

        /**
         * @param ruleName Name of the delivery rule which is unique within the endpoint.
         * 
         * @return builder
         * 
         */
        public Builder ruleName(String ruleName) {
            return ruleName(Output.of(ruleName));
        }

        /**
         * @param ruleSetName Name of the rule set under the profile.
         * 
         * @return builder
         * 
         */
        public Builder ruleSetName(Output ruleSetName) {
            $.ruleSetName = ruleSetName;
            return this;
        }

        /**
         * @param ruleSetName Name of the rule set under the profile.
         * 
         * @return builder
         * 
         */
        public Builder ruleSetName(String ruleSetName) {
            return ruleSetName(Output.of(ruleSetName));
        }

        public RuleArgs build() {
            if ($.actions == null) {
                throw new MissingRequiredPropertyException("RuleArgs", "actions");
            }
            $.matchProcessingBehavior = Codegen.stringProp("matchProcessingBehavior").left(MatchProcessingBehavior.class).output().arg($.matchProcessingBehavior).def("Continue").getNullable();
            if ($.order == null) {
                throw new MissingRequiredPropertyException("RuleArgs", "order");
            }
            if ($.profileName == null) {
                throw new MissingRequiredPropertyException("RuleArgs", "profileName");
            }
            if ($.resourceGroupName == null) {
                throw new MissingRequiredPropertyException("RuleArgs", "resourceGroupName");
            }
            if ($.ruleSetName == null) {
                throw new MissingRequiredPropertyException("RuleArgs", "ruleSetName");
            }
            return $;
        }
    }

}