"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.ReferenceTable = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog Reference Table resource for cloud storage sources (S3, GCS, Azure). This can be used to create and manage Datadog reference tables that sync data from cloud storage. For setup instructions including granting Datadog read access to your cloud storage bucket, see the [Reference Tables documentation](https://docs.datadoghq.com/reference_tables/?tab=cloudstorage#create-a-reference-table).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * // Create a reference table from an S3 bucket
 * const s3Table = new datadog.ReferenceTable("s3_table", {
 *     tableName: "products_catalog",
 *     description: "Product catalog synced from S3",
 *     source: "S3",
 *     fileMetadata: [{
 *         syncEnabled: true,
 *         accessDetails: [{
 *             awsDetail: [{
 *                 awsAccountId: "123456789000",
 *                 awsBucketName: "my-data-bucket",
 *                 filePath: "reference-tables/products.csv",
 *             }],
 *         }],
 *     }],
 *     schema: [{
 *         primaryKeys: ["product_id"],
 *         fields: [
 *             {
 *                 name: "product_id",
 *                 type: "STRING",
 *             },
 *             {
 *                 name: "product_name",
 *                 type: "STRING",
 *             },
 *             {
 *                 name: "category",
 *                 type: "STRING",
 *             },
 *             {
 *                 name: "price_cents",
 *                 type: "INT32",
 *             },
 *         ],
 *     }],
 *     tags: [
 *         "source:s3",
 *         "team:catalog",
 *         "env:production",
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * !/bin/bash
 * Import an existing reference table by its UUID
 *
 * ```sh
 * $ pulumi import datadog:index/referenceTable:ReferenceTable imported_table "00000000-0000-0000-0000-000000000000"
 * ```
 *
 * After importing, you must add the full resource configuration to your .tf file.
 * Use `terraform state show datadog_reference_table.imported_table` to view the imported schema
 * and other attributes, then add the matching configuration:
 *
 * resource "datadog.ReferenceTable" "importedTable" {
 * tableName  = "existingTable"
 * description = "Previously created table"
 * source      = "S3"  # or "GCS" or "AZURE"
 *
 * fileMetadata {
 * syncEnabled = true
 *
 * accessDetails {
 * awsDetail {
 * awsAccountId  = "123456789000"
 * awsBucketName = "existing-bucket"
 * filePath       = "data/existing.csv"
 * }
 * }
 * }
 *
 * schema {
 * primaryKeys = ["id"]
 *
 * fields {
 * name = "id"
 * type = "STRING"
 * }
 *
 * fields {
 * name = "value"
 * type = "STRING"
 * }
 * }
 *
 * tags = ["imported:true"]
 * }
 */
class ReferenceTable extends pulumi.CustomResource {
    /**
     * Get an existing ReferenceTable 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 ReferenceTable(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/referenceTable:ReferenceTable';
    /**
     * Returns true if the given object is an instance of ReferenceTable.  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'] === ReferenceTable.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createdBy"] = state?.createdBy;
            resourceInputs["description"] = state?.description;
            resourceInputs["fileMetadata"] = state?.fileMetadata;
            resourceInputs["lastUpdatedBy"] = state?.lastUpdatedBy;
            resourceInputs["rowCount"] = state?.rowCount;
            resourceInputs["schema"] = state?.schema;
            resourceInputs["source"] = state?.source;
            resourceInputs["status"] = state?.status;
            resourceInputs["tableName"] = state?.tableName;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["updatedAt"] = state?.updatedAt;
        }
        else {
            const args = argsOrState;
            if (args?.source === undefined && !opts.urn) {
                throw new Error("Missing required property 'source'");
            }
            if (args?.tableName === undefined && !opts.urn) {
                throw new Error("Missing required property 'tableName'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["fileMetadata"] = args?.fileMetadata;
            resourceInputs["schema"] = args?.schema;
            resourceInputs["source"] = args?.source;
            resourceInputs["tableName"] = args?.tableName;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["createdBy"] = undefined /*out*/;
            resourceInputs["lastUpdatedBy"] = undefined /*out*/;
            resourceInputs["rowCount"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["updatedAt"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ReferenceTable.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ReferenceTable = ReferenceTable;
//# sourceMappingURL=referenceTable.js.map