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

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


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

    public static final InstancePublicPortsPortInfoArgs Empty = new InstancePublicPortsPortInfoArgs();

    /**
     * Set of CIDR aliases that define access for a preconfigured range of IP addresses.
     * 
     */
    @Import(name="cidrListAliases")
    private @Nullable Output<List<String>> cidrListAliases;

    /**
     * @return Set of CIDR aliases that define access for a preconfigured range of IP addresses.
     * 
     */
    public Optional<Output<List<String>>> cidrListAliases() {
        return Optional.ofNullable(this.cidrListAliases);
    }

    /**
     * Set of CIDR blocks.
     * 
     */
    @Import(name="cidrs")
    private @Nullable Output<List<String>> cidrs;

    /**
     * @return Set of CIDR blocks.
     * 
     */
    public Optional<Output<List<String>>> cidrs() {
        return Optional.ofNullable(this.cidrs);
    }

    /**
     * First port in a range of open ports on an instance.
     * 
     */
    @Import(name="fromPort", required=true)
    private Output<Integer> fromPort;

    /**
     * @return First port in a range of open ports on an instance.
     * 
     */
    public Output<Integer> fromPort() {
        return this.fromPort;
    }

    @Import(name="ipv6Cidrs")
    private @Nullable Output<List<String>> ipv6Cidrs;

    public Optional<Output<List<String>>> ipv6Cidrs() {
        return Optional.ofNullable(this.ipv6Cidrs);
    }

    /**
     * IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`.
     * 
     */
    @Import(name="protocol", required=true)
    private Output<String> protocol;

    /**
     * @return IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`.
     * 
     */
    public Output<String> protocol() {
        return this.protocol;
    }

    /**
     * Last port in a range of open ports on an instance.
     * 
     * The following arguments are optional:
     * 
     */
    @Import(name="toPort", required=true)
    private Output<Integer> toPort;

    /**
     * @return Last port in a range of open ports on an instance.
     * 
     * The following arguments are optional:
     * 
     */
    public Output<Integer> toPort() {
        return this.toPort;
    }

    private InstancePublicPortsPortInfoArgs() {}

    private InstancePublicPortsPortInfoArgs(InstancePublicPortsPortInfoArgs $) {
        this.cidrListAliases = $.cidrListAliases;
        this.cidrs = $.cidrs;
        this.fromPort = $.fromPort;
        this.ipv6Cidrs = $.ipv6Cidrs;
        this.protocol = $.protocol;
        this.toPort = $.toPort;
    }

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

    public static final class Builder {
        private InstancePublicPortsPortInfoArgs $;

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

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

        /**
         * @param cidrListAliases Set of CIDR aliases that define access for a preconfigured range of IP addresses.
         * 
         * @return builder
         * 
         */
        public Builder cidrListAliases(@Nullable Output<List<String>> cidrListAliases) {
            $.cidrListAliases = cidrListAliases;
            return this;
        }

        /**
         * @param cidrListAliases Set of CIDR aliases that define access for a preconfigured range of IP addresses.
         * 
         * @return builder
         * 
         */
        public Builder cidrListAliases(List<String> cidrListAliases) {
            return cidrListAliases(Output.of(cidrListAliases));
        }

        /**
         * @param cidrListAliases Set of CIDR aliases that define access for a preconfigured range of IP addresses.
         * 
         * @return builder
         * 
         */
        public Builder cidrListAliases(String... cidrListAliases) {
            return cidrListAliases(List.of(cidrListAliases));
        }

        /**
         * @param cidrs Set of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrs(@Nullable Output<List<String>> cidrs) {
            $.cidrs = cidrs;
            return this;
        }

        /**
         * @param cidrs Set of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrs(List<String> cidrs) {
            return cidrs(Output.of(cidrs));
        }

        /**
         * @param cidrs Set of CIDR blocks.
         * 
         * @return builder
         * 
         */
        public Builder cidrs(String... cidrs) {
            return cidrs(List.of(cidrs));
        }

        /**
         * @param fromPort First port in a range of open ports on an instance.
         * 
         * @return builder
         * 
         */
        public Builder fromPort(Output<Integer> fromPort) {
            $.fromPort = fromPort;
            return this;
        }

        /**
         * @param fromPort First port in a range of open ports on an instance.
         * 
         * @return builder
         * 
         */
        public Builder fromPort(Integer fromPort) {
            return fromPort(Output.of(fromPort));
        }

        public Builder ipv6Cidrs(@Nullable Output<List<String>> ipv6Cidrs) {
            $.ipv6Cidrs = ipv6Cidrs;
            return this;
        }

        public Builder ipv6Cidrs(List<String> ipv6Cidrs) {
            return ipv6Cidrs(Output.of(ipv6Cidrs));
        }

        public Builder ipv6Cidrs(String... ipv6Cidrs) {
            return ipv6Cidrs(List.of(ipv6Cidrs));
        }

        /**
         * @param protocol IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(Output<String> protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        /**
         * @param toPort Last port in a range of open ports on an instance.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder toPort(Output<Integer> toPort) {
            $.toPort = toPort;
            return this;
        }

        /**
         * @param toPort Last port in a range of open ports on an instance.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder toPort(Integer toPort) {
            return toPort(Output.of(toPort));
        }

        public InstancePublicPortsPortInfoArgs build() {
            $.fromPort = Objects.requireNonNull($.fromPort, "expected parameter 'fromPort' to be non-null");
            $.protocol = Objects.requireNonNull($.protocol, "expected parameter 'protocol' to be non-null");
            $.toPort = Objects.requireNonNull($.toPort, "expected parameter 'toPort' to be non-null");
            return $;
        }
    }

}
