"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.RecordWeightEnabler = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage private zone record weight enabler
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooRecord = new volcengine.private_zone.Record("fooRecord", {
 *     zid: 2450000,
 *     host: "www",
 *     type: "A",
 *     value: "10.1.1.158",
 *     weight: 8,
 *     ttl: 700,
 *     remark: "tf-test",
 *     enable: true,
 * });
 * const fooRecordSets = volcengine.private_zone.getRecordSetsOutput({
 *     zid: fooRecord.zid,
 *     host: fooRecord.host,
 *     searchMode: "EXACT",
 * });
 * const fooRecordWeightEnabler = new volcengine.private_zone.RecordWeightEnabler("fooRecordWeightEnabler", {
 *     zid: fooRecord.zid,
 *     recordSetId: pulumi.all([fooRecordSets, fooRecord.type]).apply(([fooRecordSets, type]) => .filter(set => set.type == type).map(set => (set.recordSetId))[0]),
 *     weightEnabled: true,
 * });
 * ```
 *
 * ## Import
 *
 * PrivateZoneRecordWeightEnabler can be imported using the zid:record_set_id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:private_zone/recordWeightEnabler:RecordWeightEnabler default resource_id
 * ```
 */
class RecordWeightEnabler extends pulumi.CustomResource {
    /**
     * Get an existing RecordWeightEnabler 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 RecordWeightEnabler(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of RecordWeightEnabler.  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'] === RecordWeightEnabler.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["recordSetId"] = state ? state.recordSetId : undefined;
            resourceInputs["weightEnabled"] = state ? state.weightEnabled : undefined;
            resourceInputs["zid"] = state ? state.zid : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.recordSetId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'recordSetId'");
            }
            if ((!args || args.weightEnabled === undefined) && !opts.urn) {
                throw new Error("Missing required property 'weightEnabled'");
            }
            if ((!args || args.zid === undefined) && !opts.urn) {
                throw new Error("Missing required property 'zid'");
            }
            resourceInputs["recordSetId"] = args ? args.recordSetId : undefined;
            resourceInputs["weightEnabled"] = args ? args.weightEnabled : undefined;
            resourceInputs["zid"] = args ? args.zid : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RecordWeightEnabler.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RecordWeightEnabler = RecordWeightEnabler;
/** @internal */
RecordWeightEnabler.__pulumiType = 'volcengine:private_zone/recordWeightEnabler:RecordWeightEnabler';
//# sourceMappingURL=recordWeightEnabler.js.map