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

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

@CustomType
public final class EndpointPrivateServiceConnection {
    /**
     * @return Does the Private Endpoint require Manual Approval from the remote resource owner? Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** If you are trying to connect the Private Endpoint to a remote resource without having the correct RBAC permissions on the remote resource set this value to `true`.
     * 
     */
    private Boolean isManualConnection;
    /**
     * @return Specifies the Name of the Private Service Connection. Changing this forces a new resource to be created.
     * 
     */
    private String name;
    /**
     * @return The Service Alias of the Private Link Enabled Remote Resource which this Private Endpoint should be connected to. One of `private_connection_resource_id` or `private_connection_resource_alias` must be specified. Changing this forces a new resource to be created.
     * 
     */
    private @Nullable String privateConnectionResourceAlias;
    /**
     * @return The ID of the Private Link Enabled Remote Resource which this Private Endpoint should be connected to. One of `private_connection_resource_id` or `private_connection_resource_alias` must be specified. Changing this forces a new resource to be created. For a web app or function app slot, the parent web app should be used in this field instead of a reference to the slot itself.
     * 
     */
    private @Nullable String privateConnectionResourceId;
    /**
     * @return Specifies the static IP address within the private endpoint&#39;s subnet to be used. Changing this forces a new resource to be created.
     * 
     */
    private @Nullable String privateIpAddress;
    /**
     * @return A message passed to the owner of the remote resource when the private endpoint attempts to establish the connection to the remote resource. The request message can be a maximum of `140` characters in length. Only valid if `is_manual_connection` is set to `true`.
     * 
     */
    private @Nullable String requestMessage;
    /**
     * @return A list of subresource names which the Private Endpoint is able to connect to. `subresource_names` corresponds to `group_id`. Possible values are detailed in the product [documentation](https://docs.microsoft.com/azure/private-link/private-endpoint-overview#private-link-resource) in the `Subresources` column. Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** Some resource types (such as Storage Account) only support 1 subresource per private endpoint.
     * 
     */
    private @Nullable List<String> subresourceNames;

    private EndpointPrivateServiceConnection() {}
    /**
     * @return Does the Private Endpoint require Manual Approval from the remote resource owner? Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** If you are trying to connect the Private Endpoint to a remote resource without having the correct RBAC permissions on the remote resource set this value to `true`.
     * 
     */
    public Boolean isManualConnection() {
        return this.isManualConnection;
    }
    /**
     * @return Specifies the Name of the Private Service Connection. Changing this forces a new resource to be created.
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return The Service Alias of the Private Link Enabled Remote Resource which this Private Endpoint should be connected to. One of `private_connection_resource_id` or `private_connection_resource_alias` must be specified. Changing this forces a new resource to be created.
     * 
     */
    public Optional<String> privateConnectionResourceAlias() {
        return Optional.ofNullable(this.privateConnectionResourceAlias);
    }
    /**
     * @return The ID of the Private Link Enabled Remote Resource which this Private Endpoint should be connected to. One of `private_connection_resource_id` or `private_connection_resource_alias` must be specified. Changing this forces a new resource to be created. For a web app or function app slot, the parent web app should be used in this field instead of a reference to the slot itself.
     * 
     */
    public Optional<String> privateConnectionResourceId() {
        return Optional.ofNullable(this.privateConnectionResourceId);
    }
    /**
     * @return Specifies the static IP address within the private endpoint&#39;s subnet to be used. Changing this forces a new resource to be created.
     * 
     */
    public Optional<String> privateIpAddress() {
        return Optional.ofNullable(this.privateIpAddress);
    }
    /**
     * @return A message passed to the owner of the remote resource when the private endpoint attempts to establish the connection to the remote resource. The request message can be a maximum of `140` characters in length. Only valid if `is_manual_connection` is set to `true`.
     * 
     */
    public Optional<String> requestMessage() {
        return Optional.ofNullable(this.requestMessage);
    }
    /**
     * @return A list of subresource names which the Private Endpoint is able to connect to. `subresource_names` corresponds to `group_id`. Possible values are detailed in the product [documentation](https://docs.microsoft.com/azure/private-link/private-endpoint-overview#private-link-resource) in the `Subresources` column. Changing this forces a new resource to be created.
     * 
     * &gt; **NOTE:** Some resource types (such as Storage Account) only support 1 subresource per private endpoint.
     * 
     */
    public List<String> subresourceNames() {
        return this.subresourceNames == null ? List.of() : this.subresourceNames;
    }

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

    public static Builder builder(EndpointPrivateServiceConnection defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private Boolean isManualConnection;
        private String name;
        private @Nullable String privateConnectionResourceAlias;
        private @Nullable String privateConnectionResourceId;
        private @Nullable String privateIpAddress;
        private @Nullable String requestMessage;
        private @Nullable List<String> subresourceNames;
        public Builder() {}
        public Builder(EndpointPrivateServiceConnection defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.isManualConnection = defaults.isManualConnection;
    	      this.name = defaults.name;
    	      this.privateConnectionResourceAlias = defaults.privateConnectionResourceAlias;
    	      this.privateConnectionResourceId = defaults.privateConnectionResourceId;
    	      this.privateIpAddress = defaults.privateIpAddress;
    	      this.requestMessage = defaults.requestMessage;
    	      this.subresourceNames = defaults.subresourceNames;
        }

        @CustomType.Setter
        public Builder isManualConnection(Boolean isManualConnection) {
            this.isManualConnection = Objects.requireNonNull(isManualConnection);
            return this;
        }
        @CustomType.Setter
        public Builder name(String name) {
            this.name = Objects.requireNonNull(name);
            return this;
        }
        @CustomType.Setter
        public Builder privateConnectionResourceAlias(@Nullable String privateConnectionResourceAlias) {
            this.privateConnectionResourceAlias = privateConnectionResourceAlias;
            return this;
        }
        @CustomType.Setter
        public Builder privateConnectionResourceId(@Nullable String privateConnectionResourceId) {
            this.privateConnectionResourceId = privateConnectionResourceId;
            return this;
        }
        @CustomType.Setter
        public Builder privateIpAddress(@Nullable String privateIpAddress) {
            this.privateIpAddress = privateIpAddress;
            return this;
        }
        @CustomType.Setter
        public Builder requestMessage(@Nullable String requestMessage) {
            this.requestMessage = requestMessage;
            return this;
        }
        @CustomType.Setter
        public Builder subresourceNames(@Nullable List<String> subresourceNames) {
            this.subresourceNames = subresourceNames;
            return this;
        }
        public Builder subresourceNames(String... subresourceNames) {
            return subresourceNames(List.of(subresourceNames));
        }
        public EndpointPrivateServiceConnection build() {
            final var o = new EndpointPrivateServiceConnection();
            o.isManualConnection = isManualConnection;
            o.name = name;
            o.privateConnectionResourceAlias = privateConnectionResourceAlias;
            o.privateConnectionResourceId = privateConnectionResourceId;
            o.privateIpAddress = privateIpAddress;
            o.requestMessage = requestMessage;
            o.subresourceNames = subresourceNames;
            return o;
        }
    }
}
