"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceConnectionPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Manage Service Connection Policies.
 *
 * To get more information about ServiceConnectionPolicy, see:
 *
 * * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.serviceConnectionPolicies)
 * * How-to Guides
 *     * [About Service Connection Policies](https://cloud.google.com/vpc/docs/about-service-connection-policies#service-policies)
 *     * [About Service Connectivity Automation](https://cloud.google.com/vpc/docs/about-service-connectivity-automation)
 *
 * ## Example Usage
 *
 * ### Network Connectivity Policy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "producer-net",
 *     autoCreateSubnetworks: false,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "producer-subnet",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const _default = new gcp.networkconnectivity.ServiceConnectionPolicy("default", {
 *     name: "my-network-connectivity-policy",
 *     location: "us-central1",
 *     serviceClass: "my-basic-service-class",
 *     description: "my basic service connection policy",
 *     network: producerNet.id,
 *     pscConfig: {
 *         subnetworks: [producerSubnet.id],
 *         limit: "2",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * ServiceConnectionPolicy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, ServiceConnectionPolicy can be imported using one of the formats above. For example:
 *
 * ```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}}
 * ```
 */
class ServiceConnectionPolicy extends pulumi.CustomResource {
    /**
     * Get an existing ServiceConnectionPolicy 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ServiceConnectionPolicy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ServiceConnectionPolicy.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ServiceConnectionPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["etag"] = state?.etag;
            resourceInputs["infrastructure"] = state?.infrastructure;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["project"] = state?.project;
            resourceInputs["pscConfig"] = state?.pscConfig;
            resourceInputs["pscConnections"] = state?.pscConnections;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["serviceClass"] = state?.serviceClass;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.network === undefined && !opts.urn) {
                throw new Error("Missing required property 'network'");
            }
            if (args?.serviceClass === undefined && !opts.urn) {
                throw new Error("Missing required property 'serviceClass'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["project"] = args?.project;
            resourceInputs["pscConfig"] = args?.pscConfig;
            resourceInputs["serviceClass"] = args?.serviceClass;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["etag"] = undefined /*out*/;
            resourceInputs["infrastructure"] = undefined /*out*/;
            resourceInputs["pscConnections"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ServiceConnectionPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ServiceConnectionPolicy = ServiceConnectionPolicy;
/** @internal */
ServiceConnectionPolicy.__pulumiType = 'gcp:networkconnectivity/serviceConnectionPolicy:ServiceConnectionPolicy';
//# sourceMappingURL=serviceConnectionPolicy.js.map