"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.PreventionDeidentifyTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Allows creation of templates to de-identify content.
 *
 * To get more information about DeidentifyTemplate, see:
 *
 * * [API documentation](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.deidentifyTemplates)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dlp/docs/concepts-templates)
 *
 * ## Example Usage
 *
 * ### Dlp Deidentify Template Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.dataloss.PreventionDeidentifyTemplate("basic", {
 *     parent: "projects/my-project-name",
 *     description: "Description",
 *     displayName: "Displayname",
 *     deidentifyConfig: {
 *         infoTypeTransformations: {
 *             transformations: [
 *                 {
 *                     infoTypes: [{
 *                         name: "FIRST_NAME",
 *                     }],
 *                     primitiveTransformation: {
 *                         replaceWithInfoTypeConfig: true,
 *                     },
 *                 },
 *                 {
 *                     infoTypes: [
 *                         {
 *                             name: "PHONE_NUMBER",
 *                         },
 *                         {
 *                             name: "AGE",
 *                         },
 *                     ],
 *                     primitiveTransformation: {
 *                         replaceConfig: {
 *                             newValue: {
 *                                 integerValue: 9,
 *                             },
 *                         },
 *                     },
 *                 },
 *                 {
 *                     infoTypes: [
 *                         {
 *                             name: "EMAIL_ADDRESS",
 *                         },
 *                         {
 *                             name: "LAST_NAME",
 *                         },
 *                     ],
 *                     primitiveTransformation: {
 *                         characterMaskConfig: {
 *                             maskingCharacter: "X",
 *                             numberToMask: 4,
 *                             reverseOrder: true,
 *                             charactersToIgnores: [{
 *                                 commonCharactersToIgnore: "PUNCTUATION",
 *                             }],
 *                         },
 *                     },
 *                 },
 *                 {
 *                     infoTypes: [{
 *                         name: "DATE_OF_BIRTH",
 *                     }],
 *                     primitiveTransformation: {
 *                         replaceConfig: {
 *                             newValue: {
 *                                 dateValue: {
 *                                     year: 2020,
 *                                     month: 1,
 *                                     day: 1,
 *                                 },
 *                             },
 *                         },
 *                     },
 *                 },
 *                 {
 *                     infoTypes: [{
 *                         name: "CREDIT_CARD_NUMBER",
 *                     }],
 *                     primitiveTransformation: {
 *                         cryptoDeterministicConfig: {
 *                             context: {
 *                                 name: "sometweak",
 *                             },
 *                             cryptoKey: {
 *                                 transient: {
 *                                     name: "beep",
 *                                 },
 *                             },
 *                             surrogateInfoType: {
 *                                 name: "abc",
 *                             },
 *                         },
 *                     },
 *                 },
 *             ],
 *         },
 *     },
 * });
 * ```
 * ### Dlp Deidentify Template Image Transformations
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.dataloss.PreventionDeidentifyTemplate("basic", {
 *     parent: "projects/my-project-name",
 *     description: "Description",
 *     displayName: "Displayname",
 *     deidentifyConfig: {
 *         imageTransformations: {
 *             transforms: [
 *                 {
 *                     redactionColor: {
 *                         red: 0.5,
 *                         blue: 1,
 *                         green: 0.2,
 *                     },
 *                     selectedInfoTypes: {
 *                         infoTypes: [{
 *                             name: "COLOR_INFO",
 *                             version: "latest",
 *                         }],
 *                     },
 *                 },
 *                 {
 *                     allInfoTypes: {},
 *                 },
 *                 {
 *                     allText: {},
 *                 },
 *             ],
 *         },
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * DeidentifyTemplate can be imported using any of these accepted formats:
 *
 * * `{{parent}}/deidentifyTemplates/{{name}}`
 *
 * * `{{parent}}/{{name}}`
 *
 * When using the `pulumi import` command, DeidentifyTemplate can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate default {{parent}}/deidentifyTemplates/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate default {{parent}}/{{name}}
 * ```
 */
class PreventionDeidentifyTemplate extends pulumi.CustomResource {
    /**
     * Get an existing PreventionDeidentifyTemplate 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 PreventionDeidentifyTemplate(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of PreventionDeidentifyTemplate.  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'] === PreventionDeidentifyTemplate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["deidentifyConfig"] = state?.deidentifyConfig;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["name"] = state?.name;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["templateId"] = state?.templateId;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.deidentifyConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'deidentifyConfig'");
            }
            if (args?.parent === undefined && !opts.urn) {
                throw new Error("Missing required property 'parent'");
            }
            resourceInputs["deidentifyConfig"] = args?.deidentifyConfig;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["parent"] = args?.parent;
            resourceInputs["templateId"] = args?.templateId;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PreventionDeidentifyTemplate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PreventionDeidentifyTemplate = PreventionDeidentifyTemplate;
/** @internal */
PreventionDeidentifyTemplate.__pulumiType = 'gcp:dataloss/preventionDeidentifyTemplate:PreventionDeidentifyTemplate';
//# sourceMappingURL=preventionDeidentifyTemplate.js.map