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

com.pulumi.azurenative.containerregistry.inputs.IPRuleArgs 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.containerregistry.inputs;

import com.pulumi.azurenative.containerregistry.enums.Action;
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 with specific IP or IP range in CIDR format.
 * 
 */
public final class IPRuleArgs extends com.pulumi.resources.ResourceArgs {

    public static final IPRuleArgs Empty = new IPRuleArgs();

    /**
     * The action of IP ACL rule.
     * 
     */
    @Import(name="action")
    private @Nullable Output> action;

    /**
     * @return The action of IP ACL rule.
     * 
     */
    public Optional>> action() {
        return Optional.ofNullable(this.action);
    }

    /**
     * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
     * 
     */
    @Import(name="iPAddressOrRange", required=true)
    private Output iPAddressOrRange;

    /**
     * @return Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
     * 
     */
    public Output iPAddressOrRange() {
        return this.iPAddressOrRange;
    }

    private IPRuleArgs() {}

    private IPRuleArgs(IPRuleArgs $) {
        this.action = $.action;
        this.iPAddressOrRange = $.iPAddressOrRange;
    }

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

    public static final class Builder {
        private IPRuleArgs $;

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

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

        /**
         * @param action The action of IP ACL rule.
         * 
         * @return builder
         * 
         */
        public Builder action(@Nullable Output> action) {
            $.action = action;
            return this;
        }

        /**
         * @param action The action of IP ACL rule.
         * 
         * @return builder
         * 
         */
        public Builder action(Either action) {
            return action(Output.of(action));
        }

        /**
         * @param action The action of IP ACL rule.
         * 
         * @return builder
         * 
         */
        public Builder action(String action) {
            return action(Either.ofLeft(action));
        }

        /**
         * @param action The action of IP ACL rule.
         * 
         * @return builder
         * 
         */
        public Builder action(Action action) {
            return action(Either.ofRight(action));
        }

        /**
         * @param iPAddressOrRange Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
         * 
         * @return builder
         * 
         */
        public Builder iPAddressOrRange(Output iPAddressOrRange) {
            $.iPAddressOrRange = iPAddressOrRange;
            return this;
        }

        /**
         * @param iPAddressOrRange Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
         * 
         * @return builder
         * 
         */
        public Builder iPAddressOrRange(String iPAddressOrRange) {
            return iPAddressOrRange(Output.of(iPAddressOrRange));
        }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy