<filename>sdk/dotnet/Nas/GetLifecyclePolicies.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.Nas
{
    public static class GetLifecyclePolicies
    {
        /// <summary>
        /// This data source provides the Nas Lifecycle Policies of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.153.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.Nas.GetLifecyclePolicies.Invoke(new()
        ///     {
        ///         FileSystemId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "my-LifecyclePolicy-1",
        ///             "my-LifecyclePolicy-2",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.Nas.GetLifecyclePolicies.Invoke(new()
        ///     {
        ///         FileSystemId = "example_value",
        ///         NameRegex = "^my-LifecyclePolicy",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["nasLifecyclePolicyId1"] = ids.Apply(getLifecyclePoliciesResult =&gt; getLifecyclePoliciesResult.Policies[0]?.Id),
        ///         ["nasLifecyclePolicyId2"] = nameRegex.Apply(getLifecyclePoliciesResult =&gt; getLifecyclePoliciesResult.Policies[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetLifecyclePoliciesResult> InvokeAsync(GetLifecyclePoliciesArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetLifecyclePoliciesResult>("alicloud:nas/getLifecyclePolicies:getLifecyclePolicies", args ?? new GetLifecyclePoliciesArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Nas Lifecycle Policies of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.153.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.Nas.GetLifecyclePolicies.Invoke(new()
        ///     {
        ///         FileSystemId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "my-LifecyclePolicy-1",
        ///             "my-LifecyclePolicy-2",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.Nas.GetLifecyclePolicies.Invoke(new()
        ///     {
        ///         FileSystemId = "example_value",
        ///         NameRegex = "^my-LifecyclePolicy",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["nasLifecyclePolicyId1"] = ids.Apply(getLifecyclePoliciesResult =&gt; getLifecyclePoliciesResult.Policies[0]?.Id),
        ///         ["nasLifecyclePolicyId2"] = nameRegex.Apply(getLifecyclePoliciesResult =&gt; getLifecyclePoliciesResult.Policies[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetLifecyclePoliciesResult> Invoke(GetLifecyclePoliciesInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetLifecyclePoliciesResult>("alicloud:nas/getLifecyclePolicies:getLifecyclePolicies", args ?? new GetLifecyclePoliciesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetLifecyclePoliciesArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The ID of the file system.
        /// </summary>
        [Input("fileSystemId", required: true)]
        public string FileSystemId { get; set; } = null!;

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

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

        /// <summary>
        /// A regex string to filter results by Lifecycle Policy name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

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

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

    public sealed class GetLifecyclePoliciesInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The ID of the file system.
        /// </summary>
        [Input("fileSystemId", required: true)]
        public Input<string> FileSystemId { get; set; } = null!;

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

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

        /// <summary>
        /// A regex string to filter results by Lifecycle Policy name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

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

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


    [OutputType]
    public sealed class GetLifecyclePoliciesResult
    {
        public readonly string FileSystemId;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? NameRegex;
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;
        public readonly ImmutableArray<Outputs.GetLifecyclePoliciesPolicyResult> Policies;

        [OutputConstructor]
        private GetLifecyclePoliciesResult(
            string fileSystemId,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            ImmutableArray<Outputs.GetLifecyclePoliciesPolicyResult> policies)
        {
            FileSystemId = fileSystemId;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            Policies = policies;
        }
    }
}
