"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.LbTrafficExtension = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * LbTrafficExtension is a resource that lets the extension service modify the headers and payloads of both requests and responses without impacting the choice of backend services or any other security policies associated with the backend service.
 *
 * To get more information about LbTrafficExtension, see:
 *
 * * [API documentation](https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.lbTrafficExtensions)
 * * How-to Guides
 *     * [Configure a traffic extension](https://cloud.google.com/service-extensions/docs/configure-callout#configure_a_traffic_extension)
 *
 * ## Example Usage
 *
 * ## Import
 *
 * LbTrafficExtension can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/lbTrafficExtensions/{{name}}`
 *
 * * `{{project}}/{{location}}/{{name}}`
 *
 * * `{{location}}/{{name}}`
 *
 * When using the `pulumi import` command, LbTrafficExtension can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default projects/{{project}}/locations/{{location}}/lbTrafficExtensions/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default {{project}}/{{location}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default {{location}}/{{name}}
 * ```
 */
class LbTrafficExtension extends pulumi.CustomResource {
    /**
     * Get an existing LbTrafficExtension 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 LbTrafficExtension(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of LbTrafficExtension.  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'] === LbTrafficExtension.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["extensionChains"] = state?.extensionChains;
            resourceInputs["forwardingRules"] = state?.forwardingRules;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["loadBalancingScheme"] = state?.loadBalancingScheme;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
        }
        else {
            const args = argsOrState;
            if (args?.extensionChains === undefined && !opts.urn) {
                throw new Error("Missing required property 'extensionChains'");
            }
            if (args?.forwardingRules === undefined && !opts.urn) {
                throw new Error("Missing required property 'forwardingRules'");
            }
            if (args?.loadBalancingScheme === undefined && !opts.urn) {
                throw new Error("Missing required property 'loadBalancingScheme'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["extensionChains"] = args?.extensionChains;
            resourceInputs["forwardingRules"] = args?.forwardingRules;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["loadBalancingScheme"] = args?.loadBalancingScheme;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(LbTrafficExtension.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LbTrafficExtension = LbTrafficExtension;
/** @internal */
LbTrafficExtension.__pulumiType = 'gcp:networkservices/lbTrafficExtension:LbTrafficExtension';
//# sourceMappingURL=lbTrafficExtension.js.map