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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.compute.outputs.InstanceNetworkInterfaceAccessConfig;
import com.pulumi.gcp.compute.outputs.InstanceNetworkInterfaceAliasIpRange;
import com.pulumi.gcp.compute.outputs.InstanceNetworkInterfaceIpv6AccessConfig;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class InstanceNetworkInterface {
    private @Nullable List<InstanceNetworkInterfaceAccessConfig> accessConfigs;
    /**
     * @return An
     * array of alias IP ranges for this network interface. Can only be specified for network
     * interfaces on subnet-mode networks. Structure documented below.
     * 
     */
    private @Nullable List<InstanceNetworkInterfaceAliasIpRange> aliasIpRanges;
    /**
     * @return An array of IPv6 access configurations for this interface.
     * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig
     * specified, then this instance will have no external IPv6 Internet access. Structure documented below.
     * 
     */
    private @Nullable List<InstanceNetworkInterfaceIpv6AccessConfig> ipv6AccessConfigs;
    /**
     * @return One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet.
     * This field is always inherited from its subnetwork.
     * 
     */
    private @Nullable String ipv6AccessType;
    /**
     * @return A unique name for the resource, required by GCE.
     * Changing this forces a new resource to be created.
     * 
     */
    private @Nullable String name;
    /**
     * @return The name or self_link of the network to attach this interface to.
     * Either `network` or `subnetwork` must be provided. If network isn&#39;t provided it will
     * be inferred from the subnetwork.
     * 
     */
    private @Nullable String network;
    /**
     * @return The private IP address to assign to the instance. If
     * empty, the address will be automatically assigned.
     * 
     */
    private @Nullable String networkIp;
    /**
     * @return The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
     * 
     */
    private @Nullable String nicType;
    /**
     * @return The networking queue count that&#39;s specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified.
     * 
     */
    private @Nullable Integer queueCount;
    /**
     * @return The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6 or IPV4_ONLY. If not specified, IPV4_ONLY will be used.
     * 
     */
    private @Nullable String stackType;
    /**
     * @return The name or self_link of the subnetwork to attach this
     * interface to. Either `network` or `subnetwork` must be provided. If network isn&#39;t provided
     * it will be inferred from the subnetwork. The subnetwork must exist in the same region this
     * instance will be created in. If the network resource is in
     * [legacy](https://cloud.google.com/vpc/docs/legacy) mode, do not specify this field. If the
     * network is in auto subnet mode, specifying the subnetwork is optional. If the network is
     * in custom subnet mode, specifying the subnetwork is required.
     * 
     */
    private @Nullable String subnetwork;
    /**
     * @return The project in which the subnetwork belongs.
     * If the `subnetwork` is a self_link, this field is ignored in favor of the project
     * defined in the subnetwork self_link. If the `subnetwork` is a name and this
     * field is not provided, the provider project is used.
     * 
     */
    private @Nullable String subnetworkProject;

    private InstanceNetworkInterface() {}
    public List<InstanceNetworkInterfaceAccessConfig> accessConfigs() {
        return this.accessConfigs == null ? List.of() : this.accessConfigs;
    }
    /**
     * @return An
     * array of alias IP ranges for this network interface. Can only be specified for network
     * interfaces on subnet-mode networks. Structure documented below.
     * 
     */
    public List<InstanceNetworkInterfaceAliasIpRange> aliasIpRanges() {
        return this.aliasIpRanges == null ? List.of() : this.aliasIpRanges;
    }
    /**
     * @return An array of IPv6 access configurations for this interface.
     * Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig
     * specified, then this instance will have no external IPv6 Internet access. Structure documented below.
     * 
     */
    public List<InstanceNetworkInterfaceIpv6AccessConfig> ipv6AccessConfigs() {
        return this.ipv6AccessConfigs == null ? List.of() : this.ipv6AccessConfigs;
    }
    /**
     * @return One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet.
     * This field is always inherited from its subnetwork.
     * 
     */
    public Optional<String> ipv6AccessType() {
        return Optional.ofNullable(this.ipv6AccessType);
    }
    /**
     * @return A unique name for the resource, required by GCE.
     * Changing this forces a new resource to be created.
     * 
     */
    public Optional<String> name() {
        return Optional.ofNullable(this.name);
    }
    /**
     * @return The name or self_link of the network to attach this interface to.
     * Either `network` or `subnetwork` must be provided. If network isn&#39;t provided it will
     * be inferred from the subnetwork.
     * 
     */
    public Optional<String> network() {
        return Optional.ofNullable(this.network);
    }
    /**
     * @return The private IP address to assign to the instance. If
     * empty, the address will be automatically assigned.
     * 
     */
    public Optional<String> networkIp() {
        return Optional.ofNullable(this.networkIp);
    }
    /**
     * @return The type of vNIC to be used on this interface. Possible values: GVNIC, VIRTIO_NET.
     * 
     */
    public Optional<String> nicType() {
        return Optional.ofNullable(this.nicType);
    }
    /**
     * @return The networking queue count that&#39;s specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified.
     * 
     */
    public Optional<Integer> queueCount() {
        return Optional.ofNullable(this.queueCount);
    }
    /**
     * @return The stack type for this network interface to identify whether the IPv6 feature is enabled or not. Values are IPV4_IPV6 or IPV4_ONLY. If not specified, IPV4_ONLY will be used.
     * 
     */
    public Optional<String> stackType() {
        return Optional.ofNullable(this.stackType);
    }
    /**
     * @return The name or self_link of the subnetwork to attach this
     * interface to. Either `network` or `subnetwork` must be provided. If network isn&#39;t provided
     * it will be inferred from the subnetwork. The subnetwork must exist in the same region this
     * instance will be created in. If the network resource is in
     * [legacy](https://cloud.google.com/vpc/docs/legacy) mode, do not specify this field. If the
     * network is in auto subnet mode, specifying the subnetwork is optional. If the network is
     * in custom subnet mode, specifying the subnetwork is required.
     * 
     */
    public Optional<String> subnetwork() {
        return Optional.ofNullable(this.subnetwork);
    }
    /**
     * @return The project in which the subnetwork belongs.
     * If the `subnetwork` is a self_link, this field is ignored in favor of the project
     * defined in the subnetwork self_link. If the `subnetwork` is a name and this
     * field is not provided, the provider project is used.
     * 
     */
    public Optional<String> subnetworkProject() {
        return Optional.ofNullable(this.subnetworkProject);
    }

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

    public static Builder builder(InstanceNetworkInterface defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<InstanceNetworkInterfaceAccessConfig> accessConfigs;
        private @Nullable List<InstanceNetworkInterfaceAliasIpRange> aliasIpRanges;
        private @Nullable List<InstanceNetworkInterfaceIpv6AccessConfig> ipv6AccessConfigs;
        private @Nullable String ipv6AccessType;
        private @Nullable String name;
        private @Nullable String network;
        private @Nullable String networkIp;
        private @Nullable String nicType;
        private @Nullable Integer queueCount;
        private @Nullable String stackType;
        private @Nullable String subnetwork;
        private @Nullable String subnetworkProject;
        public Builder() {}
        public Builder(InstanceNetworkInterface defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.accessConfigs = defaults.accessConfigs;
    	      this.aliasIpRanges = defaults.aliasIpRanges;
    	      this.ipv6AccessConfigs = defaults.ipv6AccessConfigs;
    	      this.ipv6AccessType = defaults.ipv6AccessType;
    	      this.name = defaults.name;
    	      this.network = defaults.network;
    	      this.networkIp = defaults.networkIp;
    	      this.nicType = defaults.nicType;
    	      this.queueCount = defaults.queueCount;
    	      this.stackType = defaults.stackType;
    	      this.subnetwork = defaults.subnetwork;
    	      this.subnetworkProject = defaults.subnetworkProject;
        }

        @CustomType.Setter
        public Builder accessConfigs(@Nullable List<InstanceNetworkInterfaceAccessConfig> accessConfigs) {
            this.accessConfigs = accessConfigs;
            return this;
        }
        public Builder accessConfigs(InstanceNetworkInterfaceAccessConfig... accessConfigs) {
            return accessConfigs(List.of(accessConfigs));
        }
        @CustomType.Setter
        public Builder aliasIpRanges(@Nullable List<InstanceNetworkInterfaceAliasIpRange> aliasIpRanges) {
            this.aliasIpRanges = aliasIpRanges;
            return this;
        }
        public Builder aliasIpRanges(InstanceNetworkInterfaceAliasIpRange... aliasIpRanges) {
            return aliasIpRanges(List.of(aliasIpRanges));
        }
        @CustomType.Setter
        public Builder ipv6AccessConfigs(@Nullable List<InstanceNetworkInterfaceIpv6AccessConfig> ipv6AccessConfigs) {
            this.ipv6AccessConfigs = ipv6AccessConfigs;
            return this;
        }
        public Builder ipv6AccessConfigs(InstanceNetworkInterfaceIpv6AccessConfig... ipv6AccessConfigs) {
            return ipv6AccessConfigs(List.of(ipv6AccessConfigs));
        }
        @CustomType.Setter
        public Builder ipv6AccessType(@Nullable String ipv6AccessType) {
            this.ipv6AccessType = ipv6AccessType;
            return this;
        }
        @CustomType.Setter
        public Builder name(@Nullable String name) {
            this.name = name;
            return this;
        }
        @CustomType.Setter
        public Builder network(@Nullable String network) {
            this.network = network;
            return this;
        }
        @CustomType.Setter
        public Builder networkIp(@Nullable String networkIp) {
            this.networkIp = networkIp;
            return this;
        }
        @CustomType.Setter
        public Builder nicType(@Nullable String nicType) {
            this.nicType = nicType;
            return this;
        }
        @CustomType.Setter
        public Builder queueCount(@Nullable Integer queueCount) {
            this.queueCount = queueCount;
            return this;
        }
        @CustomType.Setter
        public Builder stackType(@Nullable String stackType) {
            this.stackType = stackType;
            return this;
        }
        @CustomType.Setter
        public Builder subnetwork(@Nullable String subnetwork) {
            this.subnetwork = subnetwork;
            return this;
        }
        @CustomType.Setter
        public Builder subnetworkProject(@Nullable String subnetworkProject) {
            this.subnetworkProject = subnetworkProject;
            return this;
        }
        public InstanceNetworkInterface build() {
            final var o = new InstanceNetworkInterface();
            o.accessConfigs = accessConfigs;
            o.aliasIpRanges = aliasIpRanges;
            o.ipv6AccessConfigs = ipv6AccessConfigs;
            o.ipv6AccessType = ipv6AccessType;
            o.name = name;
            o.network = network;
            o.networkIp = networkIp;
            o.nicType = nicType;
            o.queueCount = queueCount;
            o.stackType = stackType;
            o.subnetwork = subnetwork;
            o.subnetworkProject = subnetworkProject;
            return o;
        }
    }
}
