<filename>sdk/dotnet/Amqp/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;

namespace Pulumi.AliCloud.Amqp
{
    /// <summary>
    /// Provides a RabbitMQ (AMQP) Queue resource.
    /// 
    /// For information about RabbitMQ (AMQP) Queue and how to use it, see [What is Queue](https://www.alibabacloud.com/help/doc-detail/101631.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.127.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var exampleVirtualHost = new AliCloud.Amqp.VirtualHost("exampleVirtualHost", new()
    ///     {
    ///         InstanceId = "amqp-abc12345",
    ///         VirtualHostName = "my-VirtualHost",
    ///     });
    /// 
    ///     var exampleQueue = new AliCloud.Amqp.Queue("exampleQueue", new()
    ///     {
    ///         InstanceId = exampleVirtualHost.InstanceId,
    ///         QueueName = "my-Queue",
    ///         VirtualHostName = exampleVirtualHost.VirtualHostName,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// RabbitMQ (AMQP) Queue can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:amqp/queue:Queue example &lt;instance_id&gt;:&lt;virtual_host_name&gt;:&lt;queue_name&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:amqp/queue:Queue")]
    public partial class Queue : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Specifies whether the Auto Delete attribute is configured. Valid values:
        /// * true: The Auto Delete attribute is configured. The queue is automatically deleted after the last subscription from consumers to this queue is canceled.
        /// * false: The Auto Delete attribute is not configured.
        /// </summary>
        [Output("autoDeleteState")]
        public Output<bool?> AutoDeleteState { get; private set; } = null!;

        /// <summary>
        /// The validity period after which the queue is automatically deleted.
        /// If the queue is not accessed within a specified period of time, it is automatically deleted.
        /// </summary>
        [Output("autoExpireState")]
        public Output<string?> AutoExpireState { get; private set; } = null!;

        /// <summary>
        /// The dead-letter exchange. A dead-letter exchange is used to receive rejected messages. 
        /// If a consumer rejects a message that cannot be retried, this message is routed to a specified dead-letter exchange.
        /// Then, the dead-letter exchange routes the message to the queue that is bound to the dead-letter exchange.
        /// </summary>
        [Output("deadLetterExchange")]
        public Output<string?> DeadLetterExchange { get; private set; } = null!;

        /// <summary>
        /// The dead letter routing key.
        /// </summary>
        [Output("deadLetterRoutingKey")]
        public Output<string?> DeadLetterRoutingKey { get; private set; } = null!;

        /// <summary>
        /// Specifies whether the queue is an exclusive queue. Valid values:
        /// * true: The queue is an exclusive queue. It can be used only for the connection that declares the exclusive queue. After the connection is closed, the exclusive queue is automatically deleted.
        /// * false: The queue is not an exclusive queue.
        /// </summary>
        [Output("exclusiveState")]
        public Output<bool?> ExclusiveState { get; private set; } = null!;

        /// <summary>
        /// The ID of the instance.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The maximum number of messages that can be stored in the queue.
        /// If this threshold is exceeded, the earliest messages that are routed to the queue are discarded.
        /// </summary>
        [Output("maxLength")]
        public Output<string?> MaxLength { get; private set; } = null!;

        /// <summary>
        /// The highest priority supported by the queue. This parameter is set to a positive integer.
        /// Valid values: 0 to 255. Recommended values: 1 to 10
        /// </summary>
        [Output("maximumPriority")]
        public Output<int?> MaximumPriority { get; private set; } = null!;

        /// <summary>
        /// The message TTL of the queue.
        /// If the retention period of a message in the queue exceeds the message TTL of the queue, the message expires.
        /// Message TTL must be set to a non-negative integer, in milliseconds.
        /// For example, if the message TTL of the queue is 1000, messages survive for at most 1 second in the queue.
        /// </summary>
        [Output("messageTtl")]
        public Output<string?> MessageTtl { get; private set; } = null!;

        /// <summary>
        /// The name of the queue.
        /// The queue name must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// </summary>
        [Output("queueName")]
        public Output<string> QueueName { get; private set; } = null!;

        /// <summary>
        /// The name of the virtual host.
        /// </summary>
        [Output("virtualHostName")]
        public Output<string> VirtualHostName { 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("alicloud:amqp/queue:Queue", name, args ?? new QueueArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Queue(string name, Input<string> id, QueueState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:amqp/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/rhysmdnz/pulumi-alicloud",
            };
            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 : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specifies whether the Auto Delete attribute is configured. Valid values:
        /// * true: The Auto Delete attribute is configured. The queue is automatically deleted after the last subscription from consumers to this queue is canceled.
        /// * false: The Auto Delete attribute is not configured.
        /// </summary>
        [Input("autoDeleteState")]
        public Input<bool>? AutoDeleteState { get; set; }

        /// <summary>
        /// The validity period after which the queue is automatically deleted.
        /// If the queue is not accessed within a specified period of time, it is automatically deleted.
        /// </summary>
        [Input("autoExpireState")]
        public Input<string>? AutoExpireState { get; set; }

        /// <summary>
        /// The dead-letter exchange. A dead-letter exchange is used to receive rejected messages. 
        /// If a consumer rejects a message that cannot be retried, this message is routed to a specified dead-letter exchange.
        /// Then, the dead-letter exchange routes the message to the queue that is bound to the dead-letter exchange.
        /// </summary>
        [Input("deadLetterExchange")]
        public Input<string>? DeadLetterExchange { get; set; }

        /// <summary>
        /// The dead letter routing key.
        /// </summary>
        [Input("deadLetterRoutingKey")]
        public Input<string>? DeadLetterRoutingKey { get; set; }

        /// <summary>
        /// Specifies whether the queue is an exclusive queue. Valid values:
        /// * true: The queue is an exclusive queue. It can be used only for the connection that declares the exclusive queue. After the connection is closed, the exclusive queue is automatically deleted.
        /// * false: The queue is not an exclusive queue.
        /// </summary>
        [Input("exclusiveState")]
        public Input<bool>? ExclusiveState { get; set; }

        /// <summary>
        /// The ID of the instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The maximum number of messages that can be stored in the queue.
        /// If this threshold is exceeded, the earliest messages that are routed to the queue are discarded.
        /// </summary>
        [Input("maxLength")]
        public Input<string>? MaxLength { get; set; }

        /// <summary>
        /// The highest priority supported by the queue. This parameter is set to a positive integer.
        /// Valid values: 0 to 255. Recommended values: 1 to 10
        /// </summary>
        [Input("maximumPriority")]
        public Input<int>? MaximumPriority { get; set; }

        /// <summary>
        /// The message TTL of the queue.
        /// If the retention period of a message in the queue exceeds the message TTL of the queue, the message expires.
        /// Message TTL must be set to a non-negative integer, in milliseconds.
        /// For example, if the message TTL of the queue is 1000, messages survive for at most 1 second in the queue.
        /// </summary>
        [Input("messageTtl")]
        public Input<string>? MessageTtl { get; set; }

        /// <summary>
        /// The name of the queue.
        /// The queue name must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// </summary>
        [Input("queueName", required: true)]
        public Input<string> QueueName { get; set; } = null!;

        /// <summary>
        /// The name of the virtual host.
        /// </summary>
        [Input("virtualHostName", required: true)]
        public Input<string> VirtualHostName { get; set; } = null!;

        public QueueArgs()
        {
        }
        public static new QueueArgs Empty => new QueueArgs();
    }

    public sealed class QueueState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Specifies whether the Auto Delete attribute is configured. Valid values:
        /// * true: The Auto Delete attribute is configured. The queue is automatically deleted after the last subscription from consumers to this queue is canceled.
        /// * false: The Auto Delete attribute is not configured.
        /// </summary>
        [Input("autoDeleteState")]
        public Input<bool>? AutoDeleteState { get; set; }

        /// <summary>
        /// The validity period after which the queue is automatically deleted.
        /// If the queue is not accessed within a specified period of time, it is automatically deleted.
        /// </summary>
        [Input("autoExpireState")]
        public Input<string>? AutoExpireState { get; set; }

        /// <summary>
        /// The dead-letter exchange. A dead-letter exchange is used to receive rejected messages. 
        /// If a consumer rejects a message that cannot be retried, this message is routed to a specified dead-letter exchange.
        /// Then, the dead-letter exchange routes the message to the queue that is bound to the dead-letter exchange.
        /// </summary>
        [Input("deadLetterExchange")]
        public Input<string>? DeadLetterExchange { get; set; }

        /// <summary>
        /// The dead letter routing key.
        /// </summary>
        [Input("deadLetterRoutingKey")]
        public Input<string>? DeadLetterRoutingKey { get; set; }

        /// <summary>
        /// Specifies whether the queue is an exclusive queue. Valid values:
        /// * true: The queue is an exclusive queue. It can be used only for the connection that declares the exclusive queue. After the connection is closed, the exclusive queue is automatically deleted.
        /// * false: The queue is not an exclusive queue.
        /// </summary>
        [Input("exclusiveState")]
        public Input<bool>? ExclusiveState { get; set; }

        /// <summary>
        /// The ID of the instance.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The maximum number of messages that can be stored in the queue.
        /// If this threshold is exceeded, the earliest messages that are routed to the queue are discarded.
        /// </summary>
        [Input("maxLength")]
        public Input<string>? MaxLength { get; set; }

        /// <summary>
        /// The highest priority supported by the queue. This parameter is set to a positive integer.
        /// Valid values: 0 to 255. Recommended values: 1 to 10
        /// </summary>
        [Input("maximumPriority")]
        public Input<int>? MaximumPriority { get; set; }

        /// <summary>
        /// The message TTL of the queue.
        /// If the retention period of a message in the queue exceeds the message TTL of the queue, the message expires.
        /// Message TTL must be set to a non-negative integer, in milliseconds.
        /// For example, if the message TTL of the queue is 1000, messages survive for at most 1 second in the queue.
        /// </summary>
        [Input("messageTtl")]
        public Input<string>? MessageTtl { get; set; }

        /// <summary>
        /// The name of the queue.
        /// The queue name must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
        /// </summary>
        [Input("queueName")]
        public Input<string>? QueueName { get; set; }

        /// <summary>
        /// The name of the virtual host.
        /// </summary>
        [Input("virtualHostName")]
        public Input<string>? VirtualHostName { get; set; }

        public QueueState()
        {
        }
        public static new QueueState Empty => new QueueState();
    }
}
