"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.DeploymentGate = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog DeploymentGate resource. This can be used to create and manage Datadog deployment_gate.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Create new deployment_gate resource
 * const foo = new datadog.DeploymentGate("foo", {
 *     dryRun: false,
 *     env: "production",
 *     identifier: "my-gate",
 *     service: "my-service",
 *     rules: [
 *         {
 *             name: "fdd",
 *             type: "faulty_deployment_detection",
 *             dryRun: false,
 *             options: [{
 *                 duration: 1300,
 *                 excludedResources: ["GET api/v1/test"],
 *             }],
 *         },
 *         {
 *             name: "monitor",
 *             type: "monitor",
 *             dryRun: false,
 *             options: [{
 *                 query: "service:test-service",
 *                 duration: 1300,
 *             }],
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * ```sh
 * $ pulumi import datadog:index/deploymentGate:DeploymentGate new_list ""
 * ```
 */
class DeploymentGate extends pulumi.CustomResource {
    /**
     * Get an existing DeploymentGate 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 DeploymentGate(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/deploymentGate:DeploymentGate';
    /**
     * Returns true if the given object is an instance of DeploymentGate.  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'] === DeploymentGate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createdAt"] = state?.createdAt;
            resourceInputs["dryRun"] = state?.dryRun;
            resourceInputs["env"] = state?.env;
            resourceInputs["identifier"] = state?.identifier;
            resourceInputs["rules"] = state?.rules;
            resourceInputs["service"] = state?.service;
            resourceInputs["updatedAt"] = state?.updatedAt;
        }
        else {
            const args = argsOrState;
            if (args?.env === undefined && !opts.urn) {
                throw new Error("Missing required property 'env'");
            }
            if (args?.service === undefined && !opts.urn) {
                throw new Error("Missing required property 'service'");
            }
            resourceInputs["dryRun"] = args?.dryRun;
            resourceInputs["env"] = args?.env;
            resourceInputs["identifier"] = args?.identifier;
            resourceInputs["rules"] = args?.rules;
            resourceInputs["service"] = args?.service;
            resourceInputs["createdAt"] = undefined /*out*/;
            resourceInputs["updatedAt"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DeploymentGate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DeploymentGate = DeploymentGate;
//# sourceMappingURL=deploymentGate.js.map