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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final IoTHubNetworkRuleSetIpRuleArgs Empty = new IoTHubNetworkRuleSetIpRuleArgs();

    /**
     * The desired action for requests captured by this rule. Possible values are `Allow`. Defaults to `Allow`.
     * 
     */
    @Import(name="action")
    private @Nullable Output<String> action;

    /**
     * @return The desired action for requests captured by this rule. Possible values are `Allow`. Defaults to `Allow`.
     * 
     */
    public Optional<Output<String>> action() {
        return Optional.ofNullable(this.action);
    }

    /**
     * The IP address range in CIDR notation for the ip rule.
     * 
     */
    @Import(name="ipMask", required=true)
    private Output<String> ipMask;

    /**
     * @return The IP address range in CIDR notation for the ip rule.
     * 
     */
    public Output<String> ipMask() {
        return this.ipMask;
    }

    /**
     * The name of the ip rule.
     * 
     */
    @Import(name="name", required=true)
    private Output<String> name;

    /**
     * @return The name of the ip rule.
     * 
     */
    public Output<String> name() {
        return this.name;
    }

    private IoTHubNetworkRuleSetIpRuleArgs() {}

    private IoTHubNetworkRuleSetIpRuleArgs(IoTHubNetworkRuleSetIpRuleArgs $) {
        this.action = $.action;
        this.ipMask = $.ipMask;
        this.name = $.name;
    }

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

    public static final class Builder {
        private IoTHubNetworkRuleSetIpRuleArgs $;

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

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

        /**
         * @param action The desired action for requests captured by this rule. Possible values are `Allow`. Defaults to `Allow`.
         * 
         * @return builder
         * 
         */
        public Builder action(@Nullable Output<String> action) {
            $.action = action;
            return this;
        }

        /**
         * @param action The desired action for requests captured by this rule. Possible values are `Allow`. Defaults to `Allow`.
         * 
         * @return builder
         * 
         */
        public Builder action(String action) {
            return action(Output.of(action));
        }

        /**
         * @param ipMask The IP address range in CIDR notation for the ip rule.
         * 
         * @return builder
         * 
         */
        public Builder ipMask(Output<String> ipMask) {
            $.ipMask = ipMask;
            return this;
        }

        /**
         * @param ipMask The IP address range in CIDR notation for the ip rule.
         * 
         * @return builder
         * 
         */
        public Builder ipMask(String ipMask) {
            return ipMask(Output.of(ipMask));
        }

        /**
         * @param name The name of the ip rule.
         * 
         * @return builder
         * 
         */
        public Builder name(Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the ip rule.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        public IoTHubNetworkRuleSetIpRuleArgs build() {
            $.ipMask = Objects.requireNonNull($.ipMask, "expected parameter 'ipMask' to be non-null");
            $.name = Objects.requireNonNull($.name, "expected parameter 'name' to be non-null");
            return $;
        }
    }

}
