"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ParameterTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage rds postgresql parameter template
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const tplBase = new volcengine.rds_postgresql.ParameterTemplate("tplBase", {
 *     templateDesc: "base template for clone",
 *     templateName: "tf-pg-pt-base",
 *     templateParams: [
 *         {
 *             name: "auto_explain.log_analyze",
 *             value: "off",
 *         },
 *         {
 *             name: "auto_explain.log_buffers",
 *             value: "on",
 *         },
 *     ],
 *     templateType: "PostgreSQL",
 *     templateTypeVersion: "PostgreSQL_12",
 * });
 * const tplClone = new volcengine.rds_postgresql.ParameterTemplate("tplClone", {
 *     srcTemplateId: "postgresql-b62f5687df914b1c",
 *     templateDesc: "cloned by terraform",
 *     templateName: "tf-pg-pt-clone",
 *     templateType: "PostgreSQL",
 *     templateTypeVersion: "PostgreSQL_12",
 * });
 * const tplExport = new volcengine.rds_postgresql.ParameterTemplate("tplExport", {
 *     instanceId: "postgres-72715e0d9f58",
 *     templateDesc: "exported from instance",
 *     templateName: "tf-pg-pt-export",
 *     templateType: "PostgreSQL",
 *     templateTypeVersion: "PostgreSQL_12",
 * });
 * ```
 *
 * ## Import
 *
 * RdsPostgresqlParameterTemplate can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:rds_postgresql/parameterTemplate:ParameterTemplate default resource_id
 * ```
 */
class ParameterTemplate extends pulumi.CustomResource {
    /**
     * Get an existing ParameterTemplate 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 ParameterTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of ParameterTemplate.  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'] === ParameterTemplate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["instanceId"] = state ? state.instanceId : undefined;
            resourceInputs["srcTemplateId"] = state ? state.srcTemplateId : undefined;
            resourceInputs["templateDesc"] = state ? state.templateDesc : undefined;
            resourceInputs["templateId"] = state ? state.templateId : undefined;
            resourceInputs["templateName"] = state ? state.templateName : undefined;
            resourceInputs["templateParams"] = state ? state.templateParams : undefined;
            resourceInputs["templateType"] = state ? state.templateType : undefined;
            resourceInputs["templateTypeVersion"] = state ? state.templateTypeVersion : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.templateName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'templateName'");
            }
            if ((!args || args.templateTypeVersion === undefined) && !opts.urn) {
                throw new Error("Missing required property 'templateTypeVersion'");
            }
            resourceInputs["instanceId"] = args ? args.instanceId : undefined;
            resourceInputs["srcTemplateId"] = args ? args.srcTemplateId : undefined;
            resourceInputs["templateDesc"] = args ? args.templateDesc : undefined;
            resourceInputs["templateName"] = args ? args.templateName : undefined;
            resourceInputs["templateParams"] = args ? args.templateParams : undefined;
            resourceInputs["templateType"] = args ? args.templateType : undefined;
            resourceInputs["templateTypeVersion"] = args ? args.templateTypeVersion : undefined;
            resourceInputs["templateId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ParameterTemplate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ParameterTemplate = ParameterTemplate;
/** @internal */
ParameterTemplate.__pulumiType = 'volcengine:rds_postgresql/parameterTemplate:ParameterTemplate';
//# sourceMappingURL=parameterTemplate.js.map