<filename>sdk/dotnet/Tencentcloud/Tcmq/Queue.cs// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Tcmq
{
    /// <summary>
    /// Provides a resource to create a tcmq queue
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var queue = new Tencentcloud.Tcmq.Queue("queue", new Tencentcloud.Tcmq.QueueArgs
    ///         {
    ///             QueueName = "queue_name",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tcmq queue can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tcmq/queue:Queue queue queue_id
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tcmq/queue:Queue")]
    public partial class Queue : Pulumi.CustomResource
    {
        /// <summary>
        /// Dead letter queue name.
        /// </summary>
        [Output("deadLetterQueueName")]
        public Output<string?> DeadLetterQueueName { get; private set; } = null!;

        /// <summary>
        /// First lookback interval.
        /// </summary>
        [Output("firstQueryInterval")]
        public Output<int?> FirstQueryInterval { get; private set; } = null!;

        /// <summary>
        /// Maximum number of heaped messages. The value range is 1,000,000-10,000,000 during the beta test and can be 1,000,000-1,000,000,000 after the product is officially released. The default value is 10,000,000 during the beta test and will be 100,000,000 after the product is officially released.
        /// </summary>
        [Output("maxMsgHeapNum")]
        public Output<int?> MaxMsgHeapNum { get; private set; } = null!;

        /// <summary>
        /// Maximum message length. Value range: 1024-65536 bytes (i.e., 1-64 KB). Default value: 65536.
        /// </summary>
        [Output("maxMsgSize")]
        public Output<int?> MaxMsgSize { get; private set; } = null!;

        /// <summary>
        /// Maximum number of lookbacks.
        /// </summary>
        [Output("maxQueryCount")]
        public Output<int?> MaxQueryCount { get; private set; } = null!;

        /// <summary>
        /// Maximum receipt times. Value range: 1-1000.
        /// </summary>
        [Output("maxReceiveCount")]
        public Output<int?> MaxReceiveCount { get; private set; } = null!;

        /// <summary>
        /// Maximum period in seconds before an unconsumed message expires, which is required if `policy` is 1. Value range: 300-43200. This value should be smaller than `msgRetentionSeconds` (maximum message retention period).
        /// </summary>
        [Output("maxTimeToLive")]
        public Output<int?> MaxTimeToLive { get; private set; } = null!;

        /// <summary>
        /// The max period during which a message is retained before it is automatically acknowledged. Value range: 30-43,200 seconds (30 seconds to 12 hours). Default value: 3600 seconds (1 hour).
        /// </summary>
        [Output("msgRetentionSeconds")]
        public Output<int?> MsgRetentionSeconds { get; private set; } = null!;

        /// <summary>
        /// Dead letter policy. 0: message has been consumed multiple times but not deleted; 1: `Time-To-Live` has elapsed.
        /// </summary>
        [Output("policy")]
        public Output<int?> Policy { get; private set; } = null!;

        /// <summary>
        /// Long polling wait time for message reception. Value range: 0-30 seconds. Default value: 0.
        /// </summary>
        [Output("pollingWaitSeconds")]
        public Output<int?> PollingWaitSeconds { get; private set; } = null!;

        /// <summary>
        /// Queue name, which must be unique under the same account in the same region. It can contain up to 64 letters, digits, and hyphens and must begin with a letter.
        /// </summary>
        [Output("queueName")]
        public Output<string> QueueName { get; private set; } = null!;

        /// <summary>
        /// Queue storage space configured for message rewind. Value range: 10,240-512,000 MB (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Output("retentionSizeInMb")]
        public Output<int?> RetentionSizeInMb { get; private set; } = null!;

        /// <summary>
        /// Rewindable time of messages in the queue. Value range: 0-1,296,000s (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Output("rewindSeconds")]
        public Output<int?> RewindSeconds { get; private set; } = null!;

        /// <summary>
        /// Whether to enable message trace. true: yes; false: no. If this field is not configured, the feature will not be enabled.
        /// </summary>
        [Output("trace")]
        public Output<bool?> Trace { get; private set; } = null!;

        /// <summary>
        /// 1: transaction queue; 0: general queue.
        /// </summary>
        [Output("transaction")]
        public Output<int?> Transaction { get; private set; } = null!;

        /// <summary>
        /// Message visibility timeout period. Value range: 1-43200 seconds (i.e., 12 hours). Default value: 30.
        /// </summary>
        [Output("visibilityTimeout")]
        public Output<int?> VisibilityTimeout { get; private set; } = null!;


        /// <summary>
        /// Create a Queue resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Queue(string name, QueueArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcmq/queue:Queue", name, args ?? new QueueArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Queue(string name, Input<string> id, QueueState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcmq/queue:Queue", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Queue resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Queue Get(string name, Input<string> id, QueueState? state = null, CustomResourceOptions? options = null)
        {
            return new Queue(name, id, state, options);
        }
    }

    public sealed class QueueArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Dead letter queue name.
        /// </summary>
        [Input("deadLetterQueueName")]
        public Input<string>? DeadLetterQueueName { get; set; }

        /// <summary>
        /// First lookback interval.
        /// </summary>
        [Input("firstQueryInterval")]
        public Input<int>? FirstQueryInterval { get; set; }

        /// <summary>
        /// Maximum number of heaped messages. The value range is 1,000,000-10,000,000 during the beta test and can be 1,000,000-1,000,000,000 after the product is officially released. The default value is 10,000,000 during the beta test and will be 100,000,000 after the product is officially released.
        /// </summary>
        [Input("maxMsgHeapNum")]
        public Input<int>? MaxMsgHeapNum { get; set; }

        /// <summary>
        /// Maximum message length. Value range: 1024-65536 bytes (i.e., 1-64 KB). Default value: 65536.
        /// </summary>
        [Input("maxMsgSize")]
        public Input<int>? MaxMsgSize { get; set; }

        /// <summary>
        /// Maximum number of lookbacks.
        /// </summary>
        [Input("maxQueryCount")]
        public Input<int>? MaxQueryCount { get; set; }

        /// <summary>
        /// Maximum receipt times. Value range: 1-1000.
        /// </summary>
        [Input("maxReceiveCount")]
        public Input<int>? MaxReceiveCount { get; set; }

        /// <summary>
        /// Maximum period in seconds before an unconsumed message expires, which is required if `policy` is 1. Value range: 300-43200. This value should be smaller than `msgRetentionSeconds` (maximum message retention period).
        /// </summary>
        [Input("maxTimeToLive")]
        public Input<int>? MaxTimeToLive { get; set; }

        /// <summary>
        /// The max period during which a message is retained before it is automatically acknowledged. Value range: 30-43,200 seconds (30 seconds to 12 hours). Default value: 3600 seconds (1 hour).
        /// </summary>
        [Input("msgRetentionSeconds")]
        public Input<int>? MsgRetentionSeconds { get; set; }

        /// <summary>
        /// Dead letter policy. 0: message has been consumed multiple times but not deleted; 1: `Time-To-Live` has elapsed.
        /// </summary>
        [Input("policy")]
        public Input<int>? Policy { get; set; }

        /// <summary>
        /// Long polling wait time for message reception. Value range: 0-30 seconds. Default value: 0.
        /// </summary>
        [Input("pollingWaitSeconds")]
        public Input<int>? PollingWaitSeconds { get; set; }

        /// <summary>
        /// Queue name, which must be unique under the same account in the same region. It can contain up to 64 letters, digits, and hyphens and must begin with a letter.
        /// </summary>
        [Input("queueName", required: true)]
        public Input<string> QueueName { get; set; } = null!;

        /// <summary>
        /// Queue storage space configured for message rewind. Value range: 10,240-512,000 MB (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Input("retentionSizeInMb")]
        public Input<int>? RetentionSizeInMb { get; set; }

        /// <summary>
        /// Rewindable time of messages in the queue. Value range: 0-1,296,000s (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Input("rewindSeconds")]
        public Input<int>? RewindSeconds { get; set; }

        /// <summary>
        /// Whether to enable message trace. true: yes; false: no. If this field is not configured, the feature will not be enabled.
        /// </summary>
        [Input("trace")]
        public Input<bool>? Trace { get; set; }

        /// <summary>
        /// 1: transaction queue; 0: general queue.
        /// </summary>
        [Input("transaction")]
        public Input<int>? Transaction { get; set; }

        /// <summary>
        /// Message visibility timeout period. Value range: 1-43200 seconds (i.e., 12 hours). Default value: 30.
        /// </summary>
        [Input("visibilityTimeout")]
        public Input<int>? VisibilityTimeout { get; set; }

        public QueueArgs()
        {
        }
    }

    public sealed class QueueState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Dead letter queue name.
        /// </summary>
        [Input("deadLetterQueueName")]
        public Input<string>? DeadLetterQueueName { get; set; }

        /// <summary>
        /// First lookback interval.
        /// </summary>
        [Input("firstQueryInterval")]
        public Input<int>? FirstQueryInterval { get; set; }

        /// <summary>
        /// Maximum number of heaped messages. The value range is 1,000,000-10,000,000 during the beta test and can be 1,000,000-1,000,000,000 after the product is officially released. The default value is 10,000,000 during the beta test and will be 100,000,000 after the product is officially released.
        /// </summary>
        [Input("maxMsgHeapNum")]
        public Input<int>? MaxMsgHeapNum { get; set; }

        /// <summary>
        /// Maximum message length. Value range: 1024-65536 bytes (i.e., 1-64 KB). Default value: 65536.
        /// </summary>
        [Input("maxMsgSize")]
        public Input<int>? MaxMsgSize { get; set; }

        /// <summary>
        /// Maximum number of lookbacks.
        /// </summary>
        [Input("maxQueryCount")]
        public Input<int>? MaxQueryCount { get; set; }

        /// <summary>
        /// Maximum receipt times. Value range: 1-1000.
        /// </summary>
        [Input("maxReceiveCount")]
        public Input<int>? MaxReceiveCount { get; set; }

        /// <summary>
        /// Maximum period in seconds before an unconsumed message expires, which is required if `policy` is 1. Value range: 300-43200. This value should be smaller than `msgRetentionSeconds` (maximum message retention period).
        /// </summary>
        [Input("maxTimeToLive")]
        public Input<int>? MaxTimeToLive { get; set; }

        /// <summary>
        /// The max period during which a message is retained before it is automatically acknowledged. Value range: 30-43,200 seconds (30 seconds to 12 hours). Default value: 3600 seconds (1 hour).
        /// </summary>
        [Input("msgRetentionSeconds")]
        public Input<int>? MsgRetentionSeconds { get; set; }

        /// <summary>
        /// Dead letter policy. 0: message has been consumed multiple times but not deleted; 1: `Time-To-Live` has elapsed.
        /// </summary>
        [Input("policy")]
        public Input<int>? Policy { get; set; }

        /// <summary>
        /// Long polling wait time for message reception. Value range: 0-30 seconds. Default value: 0.
        /// </summary>
        [Input("pollingWaitSeconds")]
        public Input<int>? PollingWaitSeconds { get; set; }

        /// <summary>
        /// Queue name, which must be unique under the same account in the same region. It can contain up to 64 letters, digits, and hyphens and must begin with a letter.
        /// </summary>
        [Input("queueName")]
        public Input<string>? QueueName { get; set; }

        /// <summary>
        /// Queue storage space configured for message rewind. Value range: 10,240-512,000 MB (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Input("retentionSizeInMb")]
        public Input<int>? RetentionSizeInMb { get; set; }

        /// <summary>
        /// Rewindable time of messages in the queue. Value range: 0-1,296,000s (if message rewind is enabled). The value `0` indicates that message rewind is not enabled.
        /// </summary>
        [Input("rewindSeconds")]
        public Input<int>? RewindSeconds { get; set; }

        /// <summary>
        /// Whether to enable message trace. true: yes; false: no. If this field is not configured, the feature will not be enabled.
        /// </summary>
        [Input("trace")]
        public Input<bool>? Trace { get; set; }

        /// <summary>
        /// 1: transaction queue; 0: general queue.
        /// </summary>
        [Input("transaction")]
        public Input<int>? Transaction { get; set; }

        /// <summary>
        /// Message visibility timeout period. Value range: 1-43200 seconds (i.e., 12 hours). Default value: 30.
        /// </summary>
        [Input("visibilityTimeout")]
        public Input<int>? VisibilityTimeout { get; set; }

        public QueueState()
        {
        }
    }
}
