// *** 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.Tctest.Ckafka
{
    [TctestResourceType("tctest:Ckafka/topic:Topic")]
    public partial class Topic : Pulumi.CustomResource
    {
        /// <summary>
        /// Clear log policy, log clear mode, default is `delete`. `delete`: logs are deleted according to the storage time.
        /// `compact`: logs are compressed according to the key. `compact, delete`: logs are compressed according to the key and
        /// will be deleted according to the storage time.
        /// </summary>
        [Output("cleanUpPolicy")]
        public Output<string?> CleanUpPolicy { get; private set; } = null!;

        /// <summary>
        /// Create time of the CKafka topic.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Whether to open the ip whitelist, `true`: open, `false`: close.
        /// </summary>
        [Output("enableWhiteList")]
        public Output<bool?> EnableWhiteList { get; private set; } = null!;

        /// <summary>
        /// Data backup cos bucket: the bucket address that is dumped to cos.
        /// </summary>
        [Output("forwardCosBucket")]
        public Output<string> ForwardCosBucket { get; private set; } = null!;

        /// <summary>
        /// Periodic frequency of data backup to cos.
        /// </summary>
        [Output("forwardInterval")]
        public Output<int> ForwardInterval { get; private set; } = null!;

        /// <summary>
        /// Data backup cos status. Valid values: `0`, `1`. `1`: do not open data backup, `0`: open data backup.
        /// </summary>
        [Output("forwardStatus")]
        public Output<int> ForwardStatus { get; private set; } = null!;

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

        /// <summary>
        /// Ip whitelist, quota limit, required when enableWhileList=true.
        /// </summary>
        [Output("ipWhiteLists")]
        public Output<ImmutableArray<string>> IpWhiteLists { get; private set; } = null!;

        /// <summary>
        /// Max message bytes.
        /// </summary>
        [Output("maxMessageBytes")]
        public Output<int?> MaxMessageBytes { get; private set; } = null!;

        /// <summary>
        /// Message storage location.
        /// </summary>
        [Output("messageStorageLocation")]
        public Output<string> MessageStorageLocation { get; private set; } = null!;

        /// <summary>
        /// The subject note. It must start with a letter, and the remaining part can contain letters, numbers and dashes (-).
        /// </summary>
        [Output("note")]
        public Output<string?> Note { get; private set; } = null!;

        /// <summary>
        /// The number of partition.
        /// </summary>
        [Output("partitionNum")]
        public Output<int> PartitionNum { get; private set; } = null!;

        /// <summary>
        /// The number of replica.
        /// </summary>
        [Output("replicaNum")]
        public Output<int> ReplicaNum { get; private set; } = null!;

        /// <summary>
        /// Message can be selected. Retention time, unit is ms, the current minimum value is 60000ms.
        /// </summary>
        [Output("retention")]
        public Output<int?> Retention { get; private set; } = null!;

        /// <summary>
        /// Segment scrolling time, in ms, the current minimum is 3600000ms.
        /// </summary>
        [Output("segment")]
        public Output<int?> Segment { get; private set; } = null!;

        /// <summary>
        /// Number of bytes rolled by shard.
        /// </summary>
        [Output("segmentBytes")]
        public Output<int> SegmentBytes { get; private set; } = null!;

        /// <summary>
        /// Min number of sync replicas, Default is `1`.
        /// </summary>
        [Output("syncReplicaMinNum")]
        public Output<int?> SyncReplicaMinNum { get; private set; } = null!;

        /// <summary>
        /// Name of the CKafka topic. It must start with a letter, the rest can contain letters, numbers and dashes(-).
        /// </summary>
        [Output("topicName")]
        public Output<string> TopicName { get; private set; } = null!;

        /// <summary>
        /// Whether to allow unsynchronized replicas to be selected as leader, default is `false`, `true: `allowed, `false`: not
        /// allowed.
        /// </summary>
        [Output("uncleanLeaderElectionEnable")]
        public Output<bool?> UncleanLeaderElectionEnable { get; private set; } = null!;


        /// <summary>
        /// Create a Topic 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 Topic(string name, TopicArgs args, CustomResourceOptions? options = null)
            : base("tctest:Ckafka/topic:Topic", name, args ?? new TopicArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Topic(string name, Input<string> id, TopicState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Ckafka/topic:Topic", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 Topic 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 Topic Get(string name, Input<string> id, TopicState? state = null, CustomResourceOptions? options = null)
        {
            return new Topic(name, id, state, options);
        }
    }

    public sealed class TopicArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Clear log policy, log clear mode, default is `delete`. `delete`: logs are deleted according to the storage time.
        /// `compact`: logs are compressed according to the key. `compact, delete`: logs are compressed according to the key and
        /// will be deleted according to the storage time.
        /// </summary>
        [Input("cleanUpPolicy")]
        public Input<string>? CleanUpPolicy { get; set; }

        /// <summary>
        /// Whether to open the ip whitelist, `true`: open, `false`: close.
        /// </summary>
        [Input("enableWhiteList")]
        public Input<bool>? EnableWhiteList { get; set; }

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

        [Input("ipWhiteLists")]
        private InputList<string>? _ipWhiteLists;

        /// <summary>
        /// Ip whitelist, quota limit, required when enableWhileList=true.
        /// </summary>
        public InputList<string> IpWhiteLists
        {
            get => _ipWhiteLists ?? (_ipWhiteLists = new InputList<string>());
            set => _ipWhiteLists = value;
        }

        /// <summary>
        /// Max message bytes.
        /// </summary>
        [Input("maxMessageBytes")]
        public Input<int>? MaxMessageBytes { get; set; }

        /// <summary>
        /// The subject note. It must start with a letter, and the remaining part can contain letters, numbers and dashes (-).
        /// </summary>
        [Input("note")]
        public Input<string>? Note { get; set; }

        /// <summary>
        /// The number of partition.
        /// </summary>
        [Input("partitionNum", required: true)]
        public Input<int> PartitionNum { get; set; } = null!;

        /// <summary>
        /// The number of replica.
        /// </summary>
        [Input("replicaNum", required: true)]
        public Input<int> ReplicaNum { get; set; } = null!;

        /// <summary>
        /// Message can be selected. Retention time, unit is ms, the current minimum value is 60000ms.
        /// </summary>
        [Input("retention")]
        public Input<int>? Retention { get; set; }

        /// <summary>
        /// Segment scrolling time, in ms, the current minimum is 3600000ms.
        /// </summary>
        [Input("segment")]
        public Input<int>? Segment { get; set; }

        /// <summary>
        /// Min number of sync replicas, Default is `1`.
        /// </summary>
        [Input("syncReplicaMinNum")]
        public Input<int>? SyncReplicaMinNum { get; set; }

        /// <summary>
        /// Name of the CKafka topic. It must start with a letter, the rest can contain letters, numbers and dashes(-).
        /// </summary>
        [Input("topicName", required: true)]
        public Input<string> TopicName { get; set; } = null!;

        /// <summary>
        /// Whether to allow unsynchronized replicas to be selected as leader, default is `false`, `true: `allowed, `false`: not
        /// allowed.
        /// </summary>
        [Input("uncleanLeaderElectionEnable")]
        public Input<bool>? UncleanLeaderElectionEnable { get; set; }

        public TopicArgs()
        {
        }
    }

    public sealed class TopicState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Clear log policy, log clear mode, default is `delete`. `delete`: logs are deleted according to the storage time.
        /// `compact`: logs are compressed according to the key. `compact, delete`: logs are compressed according to the key and
        /// will be deleted according to the storage time.
        /// </summary>
        [Input("cleanUpPolicy")]
        public Input<string>? CleanUpPolicy { get; set; }

        /// <summary>
        /// Create time of the CKafka topic.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Whether to open the ip whitelist, `true`: open, `false`: close.
        /// </summary>
        [Input("enableWhiteList")]
        public Input<bool>? EnableWhiteList { get; set; }

        /// <summary>
        /// Data backup cos bucket: the bucket address that is dumped to cos.
        /// </summary>
        [Input("forwardCosBucket")]
        public Input<string>? ForwardCosBucket { get; set; }

        /// <summary>
        /// Periodic frequency of data backup to cos.
        /// </summary>
        [Input("forwardInterval")]
        public Input<int>? ForwardInterval { get; set; }

        /// <summary>
        /// Data backup cos status. Valid values: `0`, `1`. `1`: do not open data backup, `0`: open data backup.
        /// </summary>
        [Input("forwardStatus")]
        public Input<int>? ForwardStatus { get; set; }

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

        [Input("ipWhiteLists")]
        private InputList<string>? _ipWhiteLists;

        /// <summary>
        /// Ip whitelist, quota limit, required when enableWhileList=true.
        /// </summary>
        public InputList<string> IpWhiteLists
        {
            get => _ipWhiteLists ?? (_ipWhiteLists = new InputList<string>());
            set => _ipWhiteLists = value;
        }

        /// <summary>
        /// Max message bytes.
        /// </summary>
        [Input("maxMessageBytes")]
        public Input<int>? MaxMessageBytes { get; set; }

        /// <summary>
        /// Message storage location.
        /// </summary>
        [Input("messageStorageLocation")]
        public Input<string>? MessageStorageLocation { get; set; }

        /// <summary>
        /// The subject note. It must start with a letter, and the remaining part can contain letters, numbers and dashes (-).
        /// </summary>
        [Input("note")]
        public Input<string>? Note { get; set; }

        /// <summary>
        /// The number of partition.
        /// </summary>
        [Input("partitionNum")]
        public Input<int>? PartitionNum { get; set; }

        /// <summary>
        /// The number of replica.
        /// </summary>
        [Input("replicaNum")]
        public Input<int>? ReplicaNum { get; set; }

        /// <summary>
        /// Message can be selected. Retention time, unit is ms, the current minimum value is 60000ms.
        /// </summary>
        [Input("retention")]
        public Input<int>? Retention { get; set; }

        /// <summary>
        /// Segment scrolling time, in ms, the current minimum is 3600000ms.
        /// </summary>
        [Input("segment")]
        public Input<int>? Segment { get; set; }

        /// <summary>
        /// Number of bytes rolled by shard.
        /// </summary>
        [Input("segmentBytes")]
        public Input<int>? SegmentBytes { get; set; }

        /// <summary>
        /// Min number of sync replicas, Default is `1`.
        /// </summary>
        [Input("syncReplicaMinNum")]
        public Input<int>? SyncReplicaMinNum { get; set; }

        /// <summary>
        /// Name of the CKafka topic. It must start with a letter, the rest can contain letters, numbers and dashes(-).
        /// </summary>
        [Input("topicName")]
        public Input<string>? TopicName { get; set; }

        /// <summary>
        /// Whether to allow unsynchronized replicas to be selected as leader, default is `false`, `true: `allowed, `false`: not
        /// allowed.
        /// </summary>
        [Input("uncleanLeaderElectionEnable")]
        public Input<bool>? UncleanLeaderElectionEnable { get; set; }

        public TopicState()
        {
        }
    }
}
