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

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

@CustomType
public final class ConnectivityTestSource {
    /**
     * @return A Compute Engine instance URI.
     * 
     */
    private @Nullable String instance;
    /**
     * @return The IP address of the endpoint, which can be an external or
     * internal IP. An IPv6 address is only allowed when the test&#39;s
     * destination is a global load balancer VIP.
     * 
     */
    private @Nullable String ipAddress;
    /**
     * @return A Compute Engine network URI.
     * 
     */
    private @Nullable String network;
    /**
     * @return Type of the network where the endpoint is located.
     * Possible values are: `GCP_NETWORK`, `NON_GCP_NETWORK`.
     * 
     */
    private @Nullable String networkType;
    /**
     * @return The IP protocol port of the endpoint. Only applicable when
     * protocol is TCP or UDP.
     * 
     */
    private @Nullable Integer port;
    /**
     * @return Project ID where the endpoint is located. The Project ID can be
     * derived from the URI if you provide a VM instance or network URI.
     * The following are two cases where you must provide the project ID:
     * 1. Only the IP address is specified, and the IP address is
     *    within a GCP project.
     * 2. When you are using Shared VPC and the IP address
     *    that you provide is from the service project. In this case,
     *    the network that the IP address resides in is defined in the
     *    host project.
     * 
     */
    private @Nullable String projectId;

    private ConnectivityTestSource() {}
    /**
     * @return A Compute Engine instance URI.
     * 
     */
    public Optional<String> instance() {
        return Optional.ofNullable(this.instance);
    }
    /**
     * @return The IP address of the endpoint, which can be an external or
     * internal IP. An IPv6 address is only allowed when the test&#39;s
     * destination is a global load balancer VIP.
     * 
     */
    public Optional<String> ipAddress() {
        return Optional.ofNullable(this.ipAddress);
    }
    /**
     * @return A Compute Engine network URI.
     * 
     */
    public Optional<String> network() {
        return Optional.ofNullable(this.network);
    }
    /**
     * @return Type of the network where the endpoint is located.
     * Possible values are: `GCP_NETWORK`, `NON_GCP_NETWORK`.
     * 
     */
    public Optional<String> networkType() {
        return Optional.ofNullable(this.networkType);
    }
    /**
     * @return The IP protocol port of the endpoint. Only applicable when
     * protocol is TCP or UDP.
     * 
     */
    public Optional<Integer> port() {
        return Optional.ofNullable(this.port);
    }
    /**
     * @return Project ID where the endpoint is located. The Project ID can be
     * derived from the URI if you provide a VM instance or network URI.
     * The following are two cases where you must provide the project ID:
     * 1. Only the IP address is specified, and the IP address is
     *    within a GCP project.
     * 2. When you are using Shared VPC and the IP address
     *    that you provide is from the service project. In this case,
     *    the network that the IP address resides in is defined in the
     *    host project.
     * 
     */
    public Optional<String> projectId() {
        return Optional.ofNullable(this.projectId);
    }

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

    public static Builder builder(ConnectivityTestSource defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String instance;
        private @Nullable String ipAddress;
        private @Nullable String network;
        private @Nullable String networkType;
        private @Nullable Integer port;
        private @Nullable String projectId;
        public Builder() {}
        public Builder(ConnectivityTestSource defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.instance = defaults.instance;
    	      this.ipAddress = defaults.ipAddress;
    	      this.network = defaults.network;
    	      this.networkType = defaults.networkType;
    	      this.port = defaults.port;
    	      this.projectId = defaults.projectId;
        }

        @CustomType.Setter
        public Builder instance(@Nullable String instance) {
            this.instance = instance;
            return this;
        }
        @CustomType.Setter
        public Builder ipAddress(@Nullable String ipAddress) {
            this.ipAddress = ipAddress;
            return this;
        }
        @CustomType.Setter
        public Builder network(@Nullable String network) {
            this.network = network;
            return this;
        }
        @CustomType.Setter
        public Builder networkType(@Nullable String networkType) {
            this.networkType = networkType;
            return this;
        }
        @CustomType.Setter
        public Builder port(@Nullable Integer port) {
            this.port = port;
            return this;
        }
        @CustomType.Setter
        public Builder projectId(@Nullable String projectId) {
            this.projectId = projectId;
            return this;
        }
        public ConnectivityTestSource build() {
            final var o = new ConnectivityTestSource();
            o.instance = instance;
            o.ipAddress = ipAddress;
            o.network = network;
            o.networkType = networkType;
            o.port = port;
            o.projectId = projectId;
            return o;
        }
    }
}
