// *** 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.iot.outputs;

import com.pulumi.azure.iot.outputs.IoTHubNetworkRuleSetIpRule;
import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class IoTHubNetworkRuleSet {
    /**
     * @return Determines if Network Rule Set is also applied to the BuiltIn EventHub EndPoint of the IotHub. Defaults to `false`.
     * 
     */
    private @Nullable Boolean applyToBuiltinEventhubEndpoint;
    /**
     * @return Default Action for Network Rule Set. Possible values are `DefaultActionDeny`, `DefaultActionAllow`. Defaults to `DefaultActionDeny`.
     * 
     */
    private @Nullable String defaultAction;
    /**
     * @return One or more `ip_rule` blocks as defined below.
     * 
     */
    private @Nullable List<IoTHubNetworkRuleSetIpRule> ipRules;

    private IoTHubNetworkRuleSet() {}
    /**
     * @return Determines if Network Rule Set is also applied to the BuiltIn EventHub EndPoint of the IotHub. Defaults to `false`.
     * 
     */
    public Optional<Boolean> applyToBuiltinEventhubEndpoint() {
        return Optional.ofNullable(this.applyToBuiltinEventhubEndpoint);
    }
    /**
     * @return Default Action for Network Rule Set. Possible values are `DefaultActionDeny`, `DefaultActionAllow`. Defaults to `DefaultActionDeny`.
     * 
     */
    public Optional<String> defaultAction() {
        return Optional.ofNullable(this.defaultAction);
    }
    /**
     * @return One or more `ip_rule` blocks as defined below.
     * 
     */
    public List<IoTHubNetworkRuleSetIpRule> ipRules() {
        return this.ipRules == null ? List.of() : this.ipRules;
    }

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

    public static Builder builder(IoTHubNetworkRuleSet defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Boolean applyToBuiltinEventhubEndpoint;
        private @Nullable String defaultAction;
        private @Nullable List<IoTHubNetworkRuleSetIpRule> ipRules;
        public Builder() {}
        public Builder(IoTHubNetworkRuleSet defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.applyToBuiltinEventhubEndpoint = defaults.applyToBuiltinEventhubEndpoint;
    	      this.defaultAction = defaults.defaultAction;
    	      this.ipRules = defaults.ipRules;
        }

        @CustomType.Setter
        public Builder applyToBuiltinEventhubEndpoint(@Nullable Boolean applyToBuiltinEventhubEndpoint) {
            this.applyToBuiltinEventhubEndpoint = applyToBuiltinEventhubEndpoint;
            return this;
        }
        @CustomType.Setter
        public Builder defaultAction(@Nullable String defaultAction) {
            this.defaultAction = defaultAction;
            return this;
        }
        @CustomType.Setter
        public Builder ipRules(@Nullable List<IoTHubNetworkRuleSetIpRule> ipRules) {
            this.ipRules = ipRules;
            return this;
        }
        public Builder ipRules(IoTHubNetworkRuleSetIpRule... ipRules) {
            return ipRules(List.of(ipRules));
        }
        public IoTHubNetworkRuleSet build() {
            final var o = new IoTHubNetworkRuleSet();
            o.applyToBuiltinEventhubEndpoint = applyToBuiltinEventhubEndpoint;
            o.defaultAction = defaultAction;
            o.ipRules = ipRules;
            return o;
        }
    }
}
