"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.Topic = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage tls topic
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const foo = new volcengine.tls.Topic("foo", {
 *     archiveTtl: 0,
 *     autoSplit: true,
 *     coldTtl: 30,
 *     description: "test-modify",
 *     enableHotTtl: true,
 *     enableTracking: true,
 *     encryptConf: {
 *         enable: true,
 *         encryptType: "default",
 *         userCmkInfo: {
 *             regionId: "cn-guilin-boe",
 *             trn: "trn:iam::2100xxxxx:role/ServiceRoleForTLS",
 *             userCmkId: "m_cn-guilin-boe_441a350d-b21c-4760-bd8e-01ec2bc5e58a",
 *         },
 *     },
 *     hotTtl: 30,
 *     logPublicIp: true,
 *     maxSplitShard: 10,
 *     projectId: "bdb87e4d-7dad-4b96-ac43-e1b09e9dc8ac",
 *     shardCount: 2,
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 *     timeFormat: "%Y-%m-%dT%H:%M:%S,%f",
 *     timeKey: "request_time",
 *     topicName: "tf-topic-with-encrypt",
 *     ttl: 60,
 * });
 * ```
 *
 * ## Import
 *
 * Tls Topic can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:tls/topic:Topic default edf051ed-3c46-49ba-9339-bea628fe****
 * ```
 */
class Topic extends pulumi.CustomResource {
    /**
     * Get an existing Topic 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 Topic(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Topic.  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'] === Topic.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["archiveTtl"] = state ? state.archiveTtl : undefined;
            resourceInputs["autoSplit"] = state ? state.autoSplit : undefined;
            resourceInputs["coldTtl"] = state ? state.coldTtl : undefined;
            resourceInputs["createTime"] = state ? state.createTime : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["enableHotTtl"] = state ? state.enableHotTtl : undefined;
            resourceInputs["enableTracking"] = state ? state.enableTracking : undefined;
            resourceInputs["encryptConf"] = state ? state.encryptConf : undefined;
            resourceInputs["hotTtl"] = state ? state.hotTtl : undefined;
            resourceInputs["logPublicIp"] = state ? state.logPublicIp : undefined;
            resourceInputs["manualSplitShardId"] = state ? state.manualSplitShardId : undefined;
            resourceInputs["manualSplitShardNumber"] = state ? state.manualSplitShardNumber : undefined;
            resourceInputs["maxSplitShard"] = state ? state.maxSplitShard : undefined;
            resourceInputs["modifyTime"] = state ? state.modifyTime : undefined;
            resourceInputs["projectId"] = state ? state.projectId : undefined;
            resourceInputs["shardCount"] = state ? state.shardCount : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
            resourceInputs["timeFormat"] = state ? state.timeFormat : undefined;
            resourceInputs["timeKey"] = state ? state.timeKey : undefined;
            resourceInputs["topicName"] = state ? state.topicName : undefined;
            resourceInputs["ttl"] = state ? state.ttl : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.projectId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'projectId'");
            }
            if ((!args || args.shardCount === undefined) && !opts.urn) {
                throw new Error("Missing required property 'shardCount'");
            }
            if ((!args || args.topicName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'topicName'");
            }
            if ((!args || args.ttl === undefined) && !opts.urn) {
                throw new Error("Missing required property 'ttl'");
            }
            resourceInputs["archiveTtl"] = args ? args.archiveTtl : undefined;
            resourceInputs["autoSplit"] = args ? args.autoSplit : undefined;
            resourceInputs["coldTtl"] = args ? args.coldTtl : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["enableHotTtl"] = args ? args.enableHotTtl : undefined;
            resourceInputs["enableTracking"] = args ? args.enableTracking : undefined;
            resourceInputs["encryptConf"] = args ? args.encryptConf : undefined;
            resourceInputs["hotTtl"] = args ? args.hotTtl : undefined;
            resourceInputs["logPublicIp"] = args ? args.logPublicIp : undefined;
            resourceInputs["manualSplitShardId"] = args ? args.manualSplitShardId : undefined;
            resourceInputs["manualSplitShardNumber"] = args ? args.manualSplitShardNumber : undefined;
            resourceInputs["maxSplitShard"] = args ? args.maxSplitShard : undefined;
            resourceInputs["projectId"] = args ? args.projectId : undefined;
            resourceInputs["shardCount"] = args ? args.shardCount : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["timeFormat"] = args ? args.timeFormat : undefined;
            resourceInputs["timeKey"] = args ? args.timeKey : undefined;
            resourceInputs["topicName"] = args ? args.topicName : undefined;
            resourceInputs["ttl"] = args ? args.ttl : undefined;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["modifyTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Topic.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Topic = Topic;
/** @internal */
Topic.__pulumiType = 'volcengine:tls/topic:Topic';
//# sourceMappingURL=topic.js.map