"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SyntheticsGlobalVariable = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog synthetics global variable resource. This can be used to create and manage Datadog synthetics global variables.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 * import * as std from "@pulumi/std";
 *
 * // Basic Usage
 * const testVariable = new datadog.SyntheticsGlobalVariable("test_variable", {
 *     name: "EXAMPLE_VARIABLE",
 *     description: "Description of the variable",
 *     tags: [
 *         "foo:bar",
 *         "env:test",
 *     ],
 *     value: "variable-value",
 * });
 * // Write-Only Value (Recommended for Terraform 1.11+)
 * const secureVariable = new datadog.SyntheticsGlobalVariable("secure_variable", {
 *     name: "SECURE_VARIABLE",
 *     description: "Secure global variable with write-only value",
 *     tags: [
 *         "foo:bar",
 *         "env:production",
 *     ],
 *     secure: true,
 *     valueWo: secretValue,
 *     valueWoVersion: "1",
 * });
 * const secretKeepers = {
 *     rotationDate: "2024-02-15",
 *     environment: "production",
 *     securityPolicy: "v3.1",
 * };
 * // Auto-generate version from keepers
 * const secretVersion = `rotation-${std.substr({
 *     input: std.md5({
 *         input: JSON.stringify(secretKeepers),
 *     }).result,
 *     length: 0,
 *     offset: 8,
 * }).result}`;
 * const automatedRotation = new datadog.SyntheticsGlobalVariable("automated_rotation", {
 *     name: "AUTO_ROTATED_VARIABLE",
 *     description: "Variable with automated rotation",
 *     tags: [
 *         "foo:bar",
 *         "env:production",
 *     ],
 *     secure: true,
 *     valueWo: secretValue,
 *     valueWoVersion: secretVersion,
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * Synthetics global variables can be imported using their string ID, e.g.
 *
 * ```sh
 * $ pulumi import datadog:index/syntheticsGlobalVariable:SyntheticsGlobalVariable fizz abcde123-fghi-456-jkl-mnopqrstuv
 * ```
 */
class SyntheticsGlobalVariable extends pulumi.CustomResource {
    /**
     * Get an existing SyntheticsGlobalVariable 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 SyntheticsGlobalVariable(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/syntheticsGlobalVariable:SyntheticsGlobalVariable';
    /**
     * Returns true if the given object is an instance of SyntheticsGlobalVariable.  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'] === SyntheticsGlobalVariable.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["isFido"] = state?.isFido;
            resourceInputs["isTotp"] = state?.isTotp;
            resourceInputs["name"] = state?.name;
            resourceInputs["options"] = state?.options;
            resourceInputs["parseTestId"] = state?.parseTestId;
            resourceInputs["parseTestOptions"] = state?.parseTestOptions;
            resourceInputs["restrictedRoles"] = state?.restrictedRoles;
            resourceInputs["secure"] = state?.secure;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["value"] = state?.value;
            resourceInputs["valueWo"] = state?.valueWo;
            resourceInputs["valueWoVersion"] = state?.valueWoVersion;
        }
        else {
            const args = argsOrState;
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["isFido"] = args?.isFido;
            resourceInputs["isTotp"] = args?.isTotp;
            resourceInputs["name"] = args?.name;
            resourceInputs["options"] = args?.options;
            resourceInputs["parseTestId"] = args?.parseTestId;
            resourceInputs["parseTestOptions"] = args?.parseTestOptions;
            resourceInputs["restrictedRoles"] = args?.restrictedRoles;
            resourceInputs["secure"] = args?.secure;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["value"] = args?.value ? pulumi.secret(args.value) : undefined;
            resourceInputs["valueWo"] = args?.valueWo ? pulumi.secret(args.valueWo) : undefined;
            resourceInputs["valueWoVersion"] = args?.valueWoVersion;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["value", "valueWo"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(SyntheticsGlobalVariable.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SyntheticsGlobalVariable = SyntheticsGlobalVariable;
//# sourceMappingURL=syntheticsGlobalVariable.js.map