<gh_stars>0// *** 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.Cynosdb
{
    public static class GetAccounts
    {
        /// <summary>
        /// Use this data source to query detailed information of cynosdb accounts
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var accounts = Output.Create(Tencentcloud.Cynosdb.GetAccounts.InvokeAsync(new Tencentcloud.Cynosdb.GetAccountsArgs
        ///         {
        ///             AccountNames = 
        ///             {
        ///                 "root",
        ///             },
        ///             ClusterId = "cynosdbmysql-bws8h88b",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetAccountsResult> InvokeAsync(GetAccountsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetAccountsResult>("tencentcloud:Cynosdb/getAccounts:getAccounts", args ?? new GetAccountsArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of cynosdb accounts
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var accounts = Output.Create(Tencentcloud.Cynosdb.GetAccounts.InvokeAsync(new Tencentcloud.Cynosdb.GetAccountsArgs
        ///         {
        ///             AccountNames = 
        ///             {
        ///                 "root",
        ///             },
        ///             ClusterId = "cynosdbmysql-bws8h88b",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetAccountsResult> Invoke(GetAccountsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetAccountsResult>("tencentcloud:Cynosdb/getAccounts:getAccounts", args ?? new GetAccountsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetAccountsArgs : Pulumi.InvokeArgs
    {
        [Input("accountNames")]
        private List<string>? _accountNames;

        /// <summary>
        /// List of accounts to be filtered.
        /// </summary>
        public List<string> AccountNames
        {
            get => _accountNames ?? (_accountNames = new List<string>());
            set => _accountNames = value;
        }

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

        [Input("hosts")]
        private List<string>? _hosts;

        /// <summary>
        /// List of hosts to be filtered.
        /// </summary>
        public List<string> Hosts
        {
            get => _hosts ?? (_hosts = new List<string>());
            set => _hosts = value;
        }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        public GetAccountsArgs()
        {
        }
    }

    public sealed class GetAccountsInvokeArgs : Pulumi.InvokeArgs
    {
        [Input("accountNames")]
        private InputList<string>? _accountNames;

        /// <summary>
        /// List of accounts to be filtered.
        /// </summary>
        public InputList<string> AccountNames
        {
            get => _accountNames ?? (_accountNames = new InputList<string>());
            set => _accountNames = value;
        }

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

        [Input("hosts")]
        private InputList<string>? _hosts;

        /// <summary>
        /// List of hosts to be filtered.
        /// </summary>
        public InputList<string> Hosts
        {
            get => _hosts ?? (_hosts = new InputList<string>());
            set => _hosts = value;
        }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        public GetAccountsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetAccountsResult
    {
        public readonly ImmutableArray<string> AccountNames;
        /// <summary>
        /// Database account list.&amp;amp;quot;&amp;amp;quot;Note: This field may return null, indicating that no valid value can be obtained.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetAccountsAccountSetResult> AccountSets;
        public readonly string ClusterId;
        public readonly ImmutableArray<string> Hosts;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly string? ResultOutputFile;

        [OutputConstructor]
        private GetAccountsResult(
            ImmutableArray<string> accountNames,

            ImmutableArray<Outputs.GetAccountsAccountSetResult> accountSets,

            string clusterId,

            ImmutableArray<string> hosts,

            string id,

            string? resultOutputFile)
        {
            AccountNames = accountNames;
            AccountSets = accountSets;
            ClusterId = clusterId;
            Hosts = hosts;
            Id = id;
            ResultOutputFile = resultOutputFile;
        }
    }
}
