// *** 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 GetBackupJobs
    {
        /// <summary>
        /// This data source provides the Hbr Backup Jobs of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.138.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultEcsBackupPlans = AliCloud.Hbr.GetEcsBackupPlans.Invoke(new()
        ///     {
        ///         NameRegex = "plan-name",
        ///     });
        /// 
        ///     var defaultBackupJobs = AliCloud.Hbr.GetBackupJobs.Invoke(new()
        ///     {
        ///         SourceType = "ECS_FILE",
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "VaultId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.VaultId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "InstanceId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.InstanceId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "CompleteTime",
        ///                 Operator = "BETWEEN",
        ///                 Values = new[]
        ///                 {
        ///                     "2021-08-23T14:17:15CST",
        ///                     "2021-08-24T14:17:15CST",
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     var example = AliCloud.Hbr.GetBackupJobs.Invoke(new()
        ///     {
        ///         SourceType = "ECS_FILE",
        ///         Status = "COMPLETE",
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "VaultId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.VaultId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "InstanceId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.InstanceId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "CompleteTime",
        ///                 Operator = "LESS_THAN",
        ///                 Values = new[]
        ///                 {
        ///                     "2021-10-20T20:20:20CST",
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["alicloudHbrBackupJobsDefault1"] = defaultBackupJobs.Apply(getBackupJobsResult =&gt; getBackupJobsResult.Jobs[0]?.Id),
        ///         ["alicloudHbrBackupJobsExample1"] = example.Apply(getBackupJobsResult =&gt; getBackupJobsResult.Jobs[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetBackupJobsResult> InvokeAsync(GetBackupJobsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetBackupJobsResult>("alicloud:hbr/getBackupJobs:getBackupJobs", args ?? new GetBackupJobsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Hbr Backup Jobs of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.138.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultEcsBackupPlans = AliCloud.Hbr.GetEcsBackupPlans.Invoke(new()
        ///     {
        ///         NameRegex = "plan-name",
        ///     });
        /// 
        ///     var defaultBackupJobs = AliCloud.Hbr.GetBackupJobs.Invoke(new()
        ///     {
        ///         SourceType = "ECS_FILE",
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "VaultId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.VaultId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "InstanceId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.InstanceId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "CompleteTime",
        ///                 Operator = "BETWEEN",
        ///                 Values = new[]
        ///                 {
        ///                     "2021-08-23T14:17:15CST",
        ///                     "2021-08-24T14:17:15CST",
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     var example = AliCloud.Hbr.GetBackupJobs.Invoke(new()
        ///     {
        ///         SourceType = "ECS_FILE",
        ///         Status = "COMPLETE",
        ///         Filters = new[]
        ///         {
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "VaultId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.VaultId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "InstanceId",
        ///                 Operator = "IN",
        ///                 Values = new[]
        ///                 {
        ///                     defaultEcsBackupPlans.Apply(getEcsBackupPlansResult =&gt; getEcsBackupPlansResult.Plans[0]?.InstanceId),
        ///                 },
        ///             },
        ///             new AliCloud.Hbr.Inputs.GetBackupJobsFilterInputArgs
        ///             {
        ///                 Key = "CompleteTime",
        ///                 Operator = "LESS_THAN",
        ///                 Values = new[]
        ///                 {
        ///                     "2021-10-20T20:20:20CST",
        ///                 },
        ///             },
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["alicloudHbrBackupJobsDefault1"] = defaultBackupJobs.Apply(getBackupJobsResult =&gt; getBackupJobsResult.Jobs[0]?.Id),
        ///         ["alicloudHbrBackupJobsExample1"] = example.Apply(getBackupJobsResult =&gt; getBackupJobsResult.Jobs[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetBackupJobsResult> Invoke(GetBackupJobsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetBackupJobsResult>("alicloud:hbr/getBackupJobs:getBackupJobs", args ?? new GetBackupJobsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetBackupJobsArgs : global::Pulumi.InvokeArgs
    {
        [Input("filters")]
        private List<Inputs.GetBackupJobsFilterArgs>? _filters;
        public List<Inputs.GetBackupJobsFilterArgs> Filters
        {
            get => _filters ?? (_filters = new List<Inputs.GetBackupJobsFilterArgs>());
            set => _filters = value;
        }

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

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

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

        /// <summary>
        /// The sort direction, sort results by ascending or descending order based on the value jobs id. Valid values: `ASCEND`, `DESCEND`.
        /// </summary>
        [Input("sortDirection")]
        public string? SortDirection { get; set; }

        /// <summary>
        /// The type of data source. Valid Values: `ECS_FILE`, `OSS`, `NAS`, `UDM_DISK`.
        /// </summary>
        [Input("sourceType", required: true)]
        public string SourceType { get; set; } = null!;

        /// <summary>
        /// The status of restore job. Valid values: `COMPLETE` , `PARTIAL_COMPLETE`, `FAILED`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

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

    public sealed class GetBackupJobsInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("filters")]
        private InputList<Inputs.GetBackupJobsFilterInputArgs>? _filters;
        public InputList<Inputs.GetBackupJobsFilterInputArgs> Filters
        {
            get => _filters ?? (_filters = new InputList<Inputs.GetBackupJobsFilterInputArgs>());
            set => _filters = value;
        }

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

        /// <summary>
        /// A list of Backup Job 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 sort direction, sort results by ascending or descending order based on the value jobs id. Valid values: `ASCEND`, `DESCEND`.
        /// </summary>
        [Input("sortDirection")]
        public Input<string>? SortDirection { get; set; }

        /// <summary>
        /// The type of data source. Valid Values: `ECS_FILE`, `OSS`, `NAS`, `UDM_DISK`.
        /// </summary>
        [Input("sourceType", required: true)]
        public Input<string> SourceType { get; set; } = null!;

        /// <summary>
        /// The status of restore job. Valid values: `COMPLETE` , `PARTIAL_COMPLETE`, `FAILED`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

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


    [OutputType]
    public sealed class GetBackupJobsResult
    {
        public readonly ImmutableArray<Outputs.GetBackupJobsFilterResult> Filters;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly ImmutableArray<Outputs.GetBackupJobsJobResult> Jobs;
        public readonly string? OutputFile;
        public readonly string? SortDirection;
        public readonly string SourceType;
        public readonly string? Status;

        [OutputConstructor]
        private GetBackupJobsResult(
            ImmutableArray<Outputs.GetBackupJobsFilterResult> filters,

            string id,

            ImmutableArray<string> ids,

            ImmutableArray<Outputs.GetBackupJobsJobResult> jobs,

            string? outputFile,

            string? sortDirection,

            string sourceType,

            string? status)
        {
            Filters = filters;
            Id = id;
            Ids = ids;
            Jobs = jobs;
            OutputFile = outputFile;
            SortDirection = sortDirection;
            SourceType = sourceType;
            Status = status;
        }
    }
}
