"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.MaskingPoliciesMaskingColumn = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Masking Policies Masking Column resource in Oracle Cloud Infrastructure Data Safe service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/data-safe/latest/MaskingPoliciesMaskingColumn
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/datasafe
 *
 * Creates a new masking column in the specified masking policy. Use this operation
 * to add parent columns only. It automatically adds the child columns from the
 * associated sensitive data model or target database. If you provide the
 * sensitiveTypeId attribute but not the maskingFormats attribute, it automatically
 * assigns the default masking format associated with the specified sensitive type.
 * Alternatively, if you provide the maskingFormats attribute, the specified masking
 * formats are assigned to the column.
 *
 * Using the maskingFormats attribute, you can assign one or more masking formats
 * to a column. You need to specify a condition as part of each masking format. It
 * enables you to do <a href="https://docs.oracle.com/en/cloud/paas/data-safe/udscs/conditional-masking.html">conditional masking</a>
 * so that you can mask the column data values differently using different
 * masking conditions. A masking format can have one or more format entries. The
 * combined output of all the format entries is used for masking. It provides the
 * flexibility to define a masking format that can generate different parts of a data
 * value separately and then combine them to get the final data value for masking.
 *
 * You can use the maskingColumnGroup attribute to group the columns that you would
 * like to mask together. It enables you to do <a href="https://docs.oracle.com/en/cloud/paas/data-safe/udscs/group-masking1.html#GUID-755056B9-9540-48C0-9491-262A44A85037">group or compound masking</a> that ensures that the
 * masked data across the columns in a group continue to retain the same logical relationship.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testMaskingPoliciesMaskingColumn = new oci.datasafe.MaskingPoliciesMaskingColumn("test_masking_policies_masking_column", {
 *     columnName: maskingPoliciesMaskingColumnColumnName,
 *     maskingPolicyId: testMaskingPolicy.id,
 *     object: maskingPoliciesMaskingColumnObject,
 *     schemaName: maskingPoliciesMaskingColumnSchemaName,
 *     isMaskingEnabled: maskingPoliciesMaskingColumnIsMaskingEnabled === "true",
 *     maskingColumnGroup: maskingPoliciesMaskingColumnMaskingColumnGroup,
 *     maskingFormats: [{
 *         formatEntries: [{
 *             type: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesType,
 *             columnName: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesColumnName,
 *             description: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesDescription,
 *             endDate: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesEndDate,
 *             endLength: Number(maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesEndLength),
 *             endValue: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesEndValue,
 *             fixedNumber: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesFixedNumber,
 *             fixedString: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesFixedString,
 *             groupingColumns: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesGroupingColumns,
 *             length: Number(maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesLength),
 *             libraryMaskingFormatId: testLibraryMaskingFormat.id,
 *             pattern: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesPattern,
 *             postProcessingFunction: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesPostProcessingFunction,
 *             randomLists: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesRandomList,
 *             regularExpression: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesRegularExpression,
 *             replaceWith: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesReplaceWith,
 *             schemaName: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesSchemaName,
 *             sqlExpression: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesSqlExpression,
 *             startDate: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesStartDate,
 *             startLength: Number(maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesStartLength),
 *             startPosition: Number(maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesStartPosition),
 *             startValue: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesStartValue,
 *             tableName: testTable.name,
 *             userDefinedFunction: maskingPoliciesMaskingColumnMaskingFormatsFormatEntriesUserDefinedFunction,
 *         }],
 *         condition: maskingPoliciesMaskingColumnMaskingFormatsCondition,
 *         description: maskingPoliciesMaskingColumnMaskingFormatsDescription,
 *     }],
 *     objectType: maskingPoliciesMaskingColumnObjectType,
 *     sensitiveTypeId: testSensitiveType.id,
 * });
 * ```
 *
 * ## Import
 *
 * MaskingPoliciesMaskingColumns can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:DataSafe/maskingPoliciesMaskingColumn:MaskingPoliciesMaskingColumn test_masking_policies_masking_column "maskingPolicies/{maskingPolicyId}/maskingColumns/{maskingColumnKey}"
 * ```
 */
class MaskingPoliciesMaskingColumn extends pulumi.CustomResource {
    /**
     * Get an existing MaskingPoliciesMaskingColumn 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 MaskingPoliciesMaskingColumn(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:DataSafe/maskingPoliciesMaskingColumn:MaskingPoliciesMaskingColumn';
    /**
     * Returns true if the given object is an instance of MaskingPoliciesMaskingColumn.  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'] === MaskingPoliciesMaskingColumn.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["childColumns"] = state?.childColumns;
            resourceInputs["columnName"] = state?.columnName;
            resourceInputs["dataType"] = state?.dataType;
            resourceInputs["isMaskingEnabled"] = state?.isMaskingEnabled;
            resourceInputs["key"] = state?.key;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["maskingColumnGroup"] = state?.maskingColumnGroup;
            resourceInputs["maskingFormats"] = state?.maskingFormats;
            resourceInputs["maskingPolicyId"] = state?.maskingPolicyId;
            resourceInputs["object"] = state?.object;
            resourceInputs["objectType"] = state?.objectType;
            resourceInputs["schemaName"] = state?.schemaName;
            resourceInputs["sensitiveTypeId"] = state?.sensitiveTypeId;
            resourceInputs["state"] = state?.state;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        else {
            const args = argsOrState;
            if (args?.columnName === undefined && !opts.urn) {
                throw new Error("Missing required property 'columnName'");
            }
            if (args?.maskingPolicyId === undefined && !opts.urn) {
                throw new Error("Missing required property 'maskingPolicyId'");
            }
            if (args?.object === undefined && !opts.urn) {
                throw new Error("Missing required property 'object'");
            }
            if (args?.schemaName === undefined && !opts.urn) {
                throw new Error("Missing required property 'schemaName'");
            }
            resourceInputs["columnName"] = args?.columnName;
            resourceInputs["isMaskingEnabled"] = args?.isMaskingEnabled;
            resourceInputs["maskingColumnGroup"] = args?.maskingColumnGroup;
            resourceInputs["maskingFormats"] = args?.maskingFormats;
            resourceInputs["maskingPolicyId"] = args?.maskingPolicyId;
            resourceInputs["object"] = args?.object;
            resourceInputs["objectType"] = args?.objectType;
            resourceInputs["schemaName"] = args?.schemaName;
            resourceInputs["sensitiveTypeId"] = args?.sensitiveTypeId;
            resourceInputs["childColumns"] = undefined /*out*/;
            resourceInputs["dataType"] = undefined /*out*/;
            resourceInputs["key"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(MaskingPoliciesMaskingColumn.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MaskingPoliciesMaskingColumn = MaskingPoliciesMaskingColumn;
//# sourceMappingURL=maskingPoliciesMaskingColumn.js.map