// *** 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.Hbr
{
    public static class GetServerBackupPlans
    {
        /// <summary>
        /// This data source provides the Hbr Server Backup Plans of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.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 = AliCloud.Ecs.GetInstances.Invoke(new()
        ///     {
        ///         NameRegex = "no-deleteing-hbr-ecs-server-backup-plan",
        ///         Status = "Running",
        ///     });
        /// 
        ///     var ids = AliCloud.Hbr.GetServerBackupPlans.Invoke(new()
        ///     {
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetServerBackupPlansFilterInputArgs
        ///             {
        ///                 Key = "instanceId",
        ///                 Values = new[]
        ///                 {
        ///                     @default.Apply(getInstancesResult =&gt; getInstancesResult.Instances[0]?.Id),
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["hbrServerBackupPlanId1"] = ids.Apply(getServerBackupPlansResult =&gt; getServerBackupPlansResult.Plans[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetServerBackupPlansResult> InvokeAsync(GetServerBackupPlansArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetServerBackupPlansResult>("alicloud:hbr/getServerBackupPlans:getServerBackupPlans", args ?? new GetServerBackupPlansArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Hbr Server Backup Plans of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.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 = AliCloud.Ecs.GetInstances.Invoke(new()
        ///     {
        ///         NameRegex = "no-deleteing-hbr-ecs-server-backup-plan",
        ///         Status = "Running",
        ///     });
        /// 
        ///     var ids = AliCloud.Hbr.GetServerBackupPlans.Invoke(new()
        ///     {
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetServerBackupPlansFilterInputArgs
        ///             {
        ///                 Key = "instanceId",
        ///                 Values = new[]
        ///                 {
        ///                     @default.Apply(getInstancesResult =&gt; getInstancesResult.Instances[0]?.Id),
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["hbrServerBackupPlanId1"] = ids.Apply(getServerBackupPlansResult =&gt; getServerBackupPlansResult.Plans[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetServerBackupPlansResult> Invoke(GetServerBackupPlansInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetServerBackupPlansResult>("alicloud:hbr/getServerBackupPlans:getServerBackupPlans", args ?? new GetServerBackupPlansInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetServerBackupPlansArgs : global::Pulumi.InvokeArgs
    {
        [Input("filters")]
        private List<Inputs.GetServerBackupPlansFilterArgs>? _filters;

        /// <summary>
        /// The filters.
        /// </summary>
        public List<Inputs.GetServerBackupPlansFilterArgs> Filters
        {
            get => _filters ?? (_filters = new List<Inputs.GetServerBackupPlansFilterArgs>());
            set => _filters = value;
        }

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

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

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

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

    public sealed class GetServerBackupPlansInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("filters")]
        private InputList<Inputs.GetServerBackupPlansFilterInputArgs>? _filters;

        /// <summary>
        /// The filters.
        /// </summary>
        public InputList<Inputs.GetServerBackupPlansFilterInputArgs> Filters
        {
            get => _filters ?? (_filters = new InputList<Inputs.GetServerBackupPlansFilterInputArgs>());
            set => _filters = value;
        }

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

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

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

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


    [OutputType]
    public sealed class GetServerBackupPlansResult
    {
        public readonly ImmutableArray<Outputs.GetServerBackupPlansFilterResult> Filters;
        /// <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 ImmutableArray<Outputs.GetServerBackupPlansPlanResult> Plans;

        [OutputConstructor]
        private GetServerBackupPlansResult(
            ImmutableArray<Outputs.GetServerBackupPlansFilterResult> filters,

            string id,

            ImmutableArray<string> ids,

            string? outputFile,

            ImmutableArray<Outputs.GetServerBackupPlansPlanResult> plans)
        {
            Filters = filters;
            Id = id;
            Ids = ids;
            OutputFile = outputFile;
            Plans = plans;
        }
    }
}
