<filename>sdk/dotnet/DataWorks/GetFolders.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.DataWorks
{
    public static class GetFolders
    {
        /// <summary>
        /// This data source provides the Data Works Folders of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.131.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var @default = new AliCloud.DataWorks.Folder("default", new()
        ///     {
        ///         ProjectId = "xxxx",
        ///         FolderPath = "Business Flow/tfTestAcc/folderDi",
        ///     });
        /// 
        ///     var ids = AliCloud.DataWorks.GetFolders.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             @default.FolderId,
        ///         },
        ///         ProjectId = @default.ProjectId,
        ///         ParentFolderPath = "Business Flow/tfTestAcc/folderDi",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["dataWorksFolderId1"] = ids.Apply(getFoldersResult =&gt; getFoldersResult.Folders[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetFoldersResult> InvokeAsync(GetFoldersArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetFoldersResult>("alicloud:dataworks/getFolders:getFolders", args ?? new GetFoldersArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Data Works Folders of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.131.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var @default = new AliCloud.DataWorks.Folder("default", new()
        ///     {
        ///         ProjectId = "xxxx",
        ///         FolderPath = "Business Flow/tfTestAcc/folderDi",
        ///     });
        /// 
        ///     var ids = AliCloud.DataWorks.GetFolders.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             @default.FolderId,
        ///         },
        ///         ProjectId = @default.ProjectId,
        ///         ParentFolderPath = "Business Flow/tfTestAcc/folderDi",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["dataWorksFolderId1"] = ids.Apply(getFoldersResult =&gt; getFoldersResult.Folders[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetFoldersResult> Invoke(GetFoldersInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetFoldersResult>("alicloud:dataworks/getFolders:getFolders", args ?? new GetFoldersInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetFoldersArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private List<string>? _ids;

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

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

        /// <summary>
        /// The parent folder path.
        /// </summary>
        [Input("parentFolderPath", required: true)]
        public string ParentFolderPath { get; set; } = null!;

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

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

    public sealed class GetFoldersInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private InputList<string>? _ids;

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

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

        /// <summary>
        /// The parent folder path.
        /// </summary>
        [Input("parentFolderPath", required: true)]
        public Input<string> ParentFolderPath { get; set; } = null!;

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

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


    [OutputType]
    public sealed class GetFoldersResult
    {
        public readonly ImmutableArray<Outputs.GetFoldersFolderResult> Folders;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? OutputFile;
        public readonly string ParentFolderPath;
        public readonly string ProjectId;

        [OutputConstructor]
        private GetFoldersResult(
            ImmutableArray<Outputs.GetFoldersFolderResult> folders,

            string id,

            ImmutableArray<string> ids,

            string? outputFile,

            string parentFolderPath,

            string projectId)
        {
            Folders = folders;
            Id = id;
            Ids = ids;
            OutputFile = outputFile;
            ParentFolderPath = parentFolderPath;
            ProjectId = projectId;
        }
    }
}
