com.pulumi.azure.frontdoor.outputs.RulesEngineRule Maven / Gradle / Ivy
// *** 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.azure.frontdoor.outputs;
import com.pulumi.azure.frontdoor.outputs.RulesEngineRuleAction;
import com.pulumi.azure.frontdoor.outputs.RulesEngineRuleMatchCondition;
import com.pulumi.core.annotations.CustomType;
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;
@CustomType
public final class RulesEngineRule {
/**
* @return An `action` block as defined below.
*
*/
private @Nullable RulesEngineRuleAction action;
/**
* @return One or more `match_condition` block as defined below.
*
*/
private @Nullable List matchConditions;
/**
* @return The name of the rule.
*
*/
private String name;
/**
* @return Priority of the rule, must be unique per rules engine definition.
*
*/
private Integer priority;
private RulesEngineRule() {}
/**
* @return An `action` block as defined below.
*
*/
public Optional action() {
return Optional.ofNullable(this.action);
}
/**
* @return One or more `match_condition` block as defined below.
*
*/
public List matchConditions() {
return this.matchConditions == null ? List.of() : this.matchConditions;
}
/**
* @return The name of the rule.
*
*/
public String name() {
return this.name;
}
/**
* @return Priority of the rule, must be unique per rules engine definition.
*
*/
public Integer priority() {
return this.priority;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(RulesEngineRule defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private @Nullable RulesEngineRuleAction action;
private @Nullable List matchConditions;
private String name;
private Integer priority;
public Builder() {}
public Builder(RulesEngineRule defaults) {
Objects.requireNonNull(defaults);
this.action = defaults.action;
this.matchConditions = defaults.matchConditions;
this.name = defaults.name;
this.priority = defaults.priority;
}
@CustomType.Setter
public Builder action(@Nullable RulesEngineRuleAction action) {
this.action = action;
return this;
}
@CustomType.Setter
public Builder matchConditions(@Nullable List matchConditions) {
this.matchConditions = matchConditions;
return this;
}
public Builder matchConditions(RulesEngineRuleMatchCondition... matchConditions) {
return matchConditions(List.of(matchConditions));
}
@CustomType.Setter
public Builder name(String name) {
if (name == null) {
throw new MissingRequiredPropertyException("RulesEngineRule", "name");
}
this.name = name;
return this;
}
@CustomType.Setter
public Builder priority(Integer priority) {
if (priority == null) {
throw new MissingRequiredPropertyException("RulesEngineRule", "priority");
}
this.priority = priority;
return this;
}
public RulesEngineRule build() {
final var _resultValue = new RulesEngineRule();
_resultValue.action = action;
_resultValue.matchConditions = matchConditions;
_resultValue.name = name;
_resultValue.priority = priority;
return _resultValue;
}
}
}