<filename>sdk/dotnet/GraphDatabase/GetDbInstances.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.GraphDatabase
{
    public static class GetDbInstances
    {
        /// <summary>
        /// This data source provides the Graph Database Db Instances of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.136.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///     });
        /// 
        ///     var status = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///         Status = "Running",
        ///     });
        /// 
        ///     var description = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///         DbInstanceDescription = "example_value",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["graphDatabaseDbInstanceId1"] = ids.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///         ["graphDatabaseDbInstanceId2"] = status.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///         ["graphDatabaseDbInstanceId3"] = description.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDbInstancesResult> InvokeAsync(GetDbInstancesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetDbInstancesResult>("alicloud:graphdatabase/getDbInstances:getDbInstances", args ?? new GetDbInstancesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Graph Database Db Instances of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.136.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///     });
        /// 
        ///     var status = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///         Status = "Running",
        ///     });
        /// 
        ///     var description = AliCloud.GraphDatabase.GetDbInstances.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "example_id",
        ///         },
        ///         DbInstanceDescription = "example_value",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["graphDatabaseDbInstanceId1"] = ids.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///         ["graphDatabaseDbInstanceId2"] = status.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///         ["graphDatabaseDbInstanceId3"] = description.Apply(getDbInstancesResult =&gt; getDbInstancesResult.Instances[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDbInstancesResult> Invoke(GetDbInstancesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetDbInstancesResult>("alicloud:graphdatabase/getDbInstances:getDbInstances", args ?? new GetDbInstancesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDbInstancesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// According to the practical example or notes.
        /// </summary>
        [Input("dbInstanceDescription")]
        public string? DbInstanceDescription { get; set; }

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of Db Instance IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// Instance status. Value range: `Creating`, `Running`, `Deleting`, `Rebooting`, `DBInstanceClassChanging`, `NetAddressCreating` and `NetAddressDeleting`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

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

    public sealed class GetDbInstancesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// According to the practical example or notes.
        /// </summary>
        [Input("dbInstanceDescription")]
        public Input<string>? DbInstanceDescription { get; set; }

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of Db Instance IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        /// <summary>
        /// Instance status. Value range: `Creating`, `Running`, `Deleting`, `Rebooting`, `DBInstanceClassChanging`, `NetAddressCreating` and `NetAddressDeleting`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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


    [OutputType]
    public sealed class GetDbInstancesResult
    {
        public readonly string? DbInstanceDescription;
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly ImmutableArray<Outputs.GetDbInstancesInstanceResult> Instances;
        public readonly string? OutputFile;
        public readonly string? Status;

        [OutputConstructor]
        private GetDbInstancesResult(
            string? dbInstanceDescription,

            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            ImmutableArray<Outputs.GetDbInstancesInstanceResult> instances,

            string? outputFile,

            string? status)
        {
            DbInstanceDescription = dbInstanceDescription;
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            Instances = instances;
            OutputFile = outputFile;
            Status = status;
        }
    }
}
