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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyState;
import com.pulumi.gcp.networkconnectivity.outputs.ServiceConnectionPolicyPscConfig;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manage Service Connection Policies.
 * 
 * To get more information about ServiceConnectionPolicy, see:
 * 
 * * [API documentation](https://cloud.google.com/secure-web-proxy/docs/reference/networkconnectivity/rest/v1/projects.locations.networkConnectionPolicies)
 * * How-to Guides
 *     * [About Service Connection Policies](https://cloud.google.com/vpc/docs/about-service-connection-policies#service-policies)
 * 
 * ## Example Usage
 * ### Network Connectivity Policy Basic
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicy;
 * import com.pulumi.gcp.networkconnectivity.ServiceConnectionPolicyArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.ServiceConnectionPolicyPscConfigArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var producerNet = new Network(&#34;producerNet&#34;, NetworkArgs.builder()        
 *             .autoCreateSubnetworks(false)
 *             .build());
 * 
 *         var producerSubnet = new Subnetwork(&#34;producerSubnet&#34;, SubnetworkArgs.builder()        
 *             .ipCidrRange(&#34;10.0.0.0/16&#34;)
 *             .region(&#34;us-central1&#34;)
 *             .network(producerNet.id())
 *             .build());
 * 
 *         var default_ = new ServiceConnectionPolicy(&#34;default&#34;, ServiceConnectionPolicyArgs.builder()        
 *             .location(&#34;us-central1&#34;)
 *             .serviceClass(&#34;my-basic-service-class&#34;)
 *             .description(&#34;my basic service connection policy&#34;)
 *             .network(producerNet.id())
 *             .pscConfig(ServiceConnectionPolicyPscConfigArgs.builder()
 *                 .subnetworks(producerSubnet.id())
 *                 .limit(2)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * ServiceConnectionPolicy can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default {{project}}/{{location}}/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy default {{location}}/{{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy")
public class ServiceConnectionPolicy extends com.pulumi.resources.CustomResource {
    /**
     * The timestamp when the resource was created.
     * 
     */
    @Export(name="createTime", type=String.class, parameters={})
    private Output<String> createTime;

    /**
     * @return The timestamp when the resource was created.
     * 
     */
    public Output<String> createTime() {
        return this.createTime;
    }
    /**
     * Free-text description of the resource.
     * 
     */
    @Export(name="description", type=String.class, parameters={})
    private Output</* @Nullable */ String> description;

    /**
     * @return Free-text description of the resource.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
     * 
     */
    @Export(name="etag", type=String.class, parameters={})
    private Output<String> etag;

    /**
     * @return The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
     * 
     */
    public Output<String> etag() {
        return this.etag;
    }
    /**
     * The type of underlying resources used to create the connection.
     * 
     */
    @Export(name="infrastructure", type=String.class, parameters={})
    private Output<String> infrastructure;

    /**
     * @return The type of underlying resources used to create the connection.
     * 
     */
    public Output<String> infrastructure() {
        return this.infrastructure;
    }
    /**
     * User-defined labels.
     * 
     */
    @Export(name="labels", type=Map.class, parameters={String.class, String.class})
    private Output</* @Nullable */ Map<String,String>> labels;

    /**
     * @return User-defined labels.
     * 
     */
    public Output<Optional<Map<String,String>>> labels() {
        return Codegen.optional(this.labels);
    }
    /**
     * The location of the ServiceConnectionPolicy.
     * 
     * ***
     * 
     */
    @Export(name="location", type=String.class, parameters={})
    private Output<String> location;

    /**
     * @return The location of the ServiceConnectionPolicy.
     * 
     * ***
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
     * 
     */
    @Export(name="network", type=String.class, parameters={})
    private Output<String> network;

    /**
     * @return The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}.
     * 
     */
    public Output<String> network() {
        return this.network;
    }
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Export(name="project", type=String.class, parameters={})
    private Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Output<String> project() {
        return this.project;
    }
    /**
     * Configuration used for Private Service Connect connections. Used when Infrastructure is PSC.
     * Structure is documented below.
     * 
     */
    @Export(name="pscConfig", type=ServiceConnectionPolicyPscConfig.class, parameters={})
    private Output</* @Nullable */ ServiceConnectionPolicyPscConfig> pscConfig;

    /**
     * @return Configuration used for Private Service Connect connections. Used when Infrastructure is PSC.
     * Structure is documented below.
     * 
     */
    public Output<Optional<ServiceConnectionPolicyPscConfig>> pscConfig() {
        return Codegen.optional(this.pscConfig);
    }
    /**
     * Information about each Private Service Connect connection.
     * 
     */
    @Export(name="pscConnections", type=List.class, parameters={String.class})
    private Output<List<String>> pscConnections;

    /**
     * @return Information about each Private Service Connect connection.
     * 
     */
    public Output<List<String>> pscConnections() {
        return this.pscConnections;
    }
    /**
     * The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass.
     * It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
     * 
     */
    @Export(name="serviceClass", type=String.class, parameters={})
    private Output<String> serviceClass;

    /**
     * @return The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass.
     * It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx.
     * 
     */
    public Output<String> serviceClass() {
        return this.serviceClass;
    }
    /**
     * The timestamp when the resource was updated.
     * 
     */
    @Export(name="updateTime", type=String.class, parameters={})
    private Output<String> updateTime;

    /**
     * @return The timestamp when the resource was updated.
     * 
     */
    public Output<String> updateTime() {
        return this.updateTime;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ServiceConnectionPolicy(String name) {
        this(name, ServiceConnectionPolicyArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ServiceConnectionPolicy(String name, ServiceConnectionPolicyArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ServiceConnectionPolicy(String name, ServiceConnectionPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy", name, args == null ? ServiceConnectionPolicyArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ServiceConnectionPolicy(String name, Output<String> id, @Nullable ServiceConnectionPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ServiceConnectionPolicy get(String name, Output<String> id, @Nullable ServiceConnectionPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ServiceConnectionPolicy(name, id, state, options);
    }
}
