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

com.pulumi.azurenative.devices.inputs.NetworkRuleSetIpRuleArgs Maven / Gradle / Ivy

There is a newer version: 2.82.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.devices.inputs;

import com.pulumi.azurenative.devices.enums.NetworkRuleIPAction;
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.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * IP Rule to be applied as part of Network Rule Set
 * 
 */
public final class NetworkRuleSetIpRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkRuleSetIpRuleArgs Empty = new NetworkRuleSetIpRuleArgs();

    /**
     * IP Filter Action
     * 
     */
    @Import(name="action")
    private @Nullable Output> action;

    /**
     * @return IP Filter Action
     * 
     */
    public Optional>> action() {
        return Optional.ofNullable(this.action);
    }

    /**
     * Name of the IP filter rule.
     * 
     */
    @Import(name="filterName", required=true)
    private Output filterName;

    /**
     * @return Name of the IP filter rule.
     * 
     */
    public Output filterName() {
        return this.filterName;
    }

    /**
     * A string that contains the IP address range in CIDR notation for the rule.
     * 
     */
    @Import(name="ipMask", required=true)
    private Output ipMask;

    /**
     * @return A string that contains the IP address range in CIDR notation for the rule.
     * 
     */
    public Output ipMask() {
        return this.ipMask;
    }

    private NetworkRuleSetIpRuleArgs() {}

    private NetworkRuleSetIpRuleArgs(NetworkRuleSetIpRuleArgs $) {
        this.action = $.action;
        this.filterName = $.filterName;
        this.ipMask = $.ipMask;
    }

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

    public static final class Builder {
        private NetworkRuleSetIpRuleArgs $;

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

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

        /**
         * @param action IP Filter Action
         * 
         * @return builder
         * 
         */
        public Builder action(@Nullable Output> action) {
            $.action = action;
            return this;
        }

        /**
         * @param action IP Filter Action
         * 
         * @return builder
         * 
         */
        public Builder action(Either action) {
            return action(Output.of(action));
        }

        /**
         * @param action IP Filter Action
         * 
         * @return builder
         * 
         */
        public Builder action(String action) {
            return action(Either.ofLeft(action));
        }

        /**
         * @param action IP Filter Action
         * 
         * @return builder
         * 
         */
        public Builder action(NetworkRuleIPAction action) {
            return action(Either.ofRight(action));
        }

        /**
         * @param filterName Name of the IP filter rule.
         * 
         * @return builder
         * 
         */
        public Builder filterName(Output filterName) {
            $.filterName = filterName;
            return this;
        }

        /**
         * @param filterName Name of the IP filter rule.
         * 
         * @return builder
         * 
         */
        public Builder filterName(String filterName) {
            return filterName(Output.of(filterName));
        }

        /**
         * @param ipMask A string that contains the IP address range in CIDR notation for the rule.
         * 
         * @return builder
         * 
         */
        public Builder ipMask(Output ipMask) {
            $.ipMask = ipMask;
            return this;
        }

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

        public NetworkRuleSetIpRuleArgs build() {
            $.action = Codegen.stringProp("action").left(NetworkRuleIPAction.class).output().arg($.action).def("Allow").getNullable();
            if ($.filterName == null) {
                throw new MissingRequiredPropertyException("NetworkRuleSetIpRuleArgs", "filterName");
            }
            if ($.ipMask == null) {
                throw new MissingRequiredPropertyException("NetworkRuleSetIpRuleArgs", "ipMask");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy