// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Redis
{
    public static class GetBackup
    {
        /// <summary>
        /// Use this data source to query detailed information of redis backup
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var backup = Output.Create(Tencentcloud.Redis.GetBackup.InvokeAsync(new Tencentcloud.Redis.GetBackupArgs
        ///         {
        ///             BeginTime = "2023-04-07 03:57:30",
        ///             EndTime = "2023-04-07 03:57:56",
        ///             InstanceId = "crs-c1nl9rpv",
        ///             InstanceName = "Keep-terraform",
        ///             Statuses = 
        ///             {
        ///                 2,
        ///             },
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetBackupResult> InvokeAsync(GetBackupArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetBackupResult>("tencentcloud:Redis/getBackup:getBackup", args ?? new GetBackupArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of redis backup
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var backup = Output.Create(Tencentcloud.Redis.GetBackup.InvokeAsync(new Tencentcloud.Redis.GetBackupArgs
        ///         {
        ///             BeginTime = "2023-04-07 03:57:30",
        ///             EndTime = "2023-04-07 03:57:56",
        ///             InstanceId = "crs-c1nl9rpv",
        ///             InstanceName = "Keep-terraform",
        ///             Statuses = 
        ///             {
        ///                 2,
        ///             },
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetBackupResult> Invoke(GetBackupInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetBackupResult>("tencentcloud:Redis/getBackup:getBackup", args ?? new GetBackupInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetBackupArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// start time, such as 2017-02-08 19:09:26.Query the list of backups that the instance started backing up during the [beginTime, endTime] time period.
        /// </summary>
        [Input("beginTime")]
        public string? BeginTime { get; set; }

        /// <summary>
        /// End time, such as 2017-02-08 19:09:26.Query the list of backups that the instance started backing up during the [beginTime, endTime] time period.
        /// </summary>
        [Input("endTime")]
        public string? EndTime { get; set; }

        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId")]
        public string? InstanceId { get; set; }

        /// <summary>
        /// Instance name, which supports fuzzy search based on instance name.
        /// </summary>
        [Input("instanceName")]
        public string? InstanceName { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        [Input("statuses")]
        private List<int>? _statuses;

        /// <summary>
        /// Status of the backup task:1: Backup is in the process.2: The backup is normal.3: Backup to RDB file processing.4: RDB conversion completed.-1: The backup has expired.-2: Backup deleted.
        /// </summary>
        public List<int> Statuses
        {
            get => _statuses ?? (_statuses = new List<int>());
            set => _statuses = value;
        }

        public GetBackupArgs()
        {
        }
    }

    public sealed class GetBackupInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// start time, such as 2017-02-08 19:09:26.Query the list of backups that the instance started backing up during the [beginTime, endTime] time period.
        /// </summary>
        [Input("beginTime")]
        public Input<string>? BeginTime { get; set; }

        /// <summary>
        /// End time, such as 2017-02-08 19:09:26.Query the list of backups that the instance started backing up during the [beginTime, endTime] time period.
        /// </summary>
        [Input("endTime")]
        public Input<string>? EndTime { get; set; }

        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// Instance name, which supports fuzzy search based on instance name.
        /// </summary>
        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        [Input("statuses")]
        private InputList<int>? _statuses;

        /// <summary>
        /// Status of the backup task:1: Backup is in the process.2: The backup is normal.3: Backup to RDB file processing.4: RDB conversion completed.-1: The backup has expired.-2: Backup deleted.
        /// </summary>
        public InputList<int> Statuses
        {
            get => _statuses ?? (_statuses = new InputList<int>());
            set => _statuses = value;
        }

        public GetBackupInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetBackupResult
    {
        /// <summary>
        /// An array of backups for the instance.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetBackupBackupSetResult> BackupSets;
        public readonly string? BeginTime;
        /// <summary>
        /// Backup end time.
        /// </summary>
        public readonly string? EndTime;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// The ID of instance.
        /// </summary>
        public readonly string? InstanceId;
        /// <summary>
        /// The name of instance.
        /// </summary>
        public readonly string? InstanceName;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// Backup status.1: The backup is locked by another process.2: The backup is normal and not locked by any process.-1: The backup has expired.3: The backup is being exported.4: The backup export is successful.
        /// </summary>
        public readonly ImmutableArray<int> Statuses;

        [OutputConstructor]
        private GetBackupResult(
            ImmutableArray<Outputs.GetBackupBackupSetResult> backupSets,

            string? beginTime,

            string? endTime,

            string id,

            string? instanceId,

            string? instanceName,

            string? resultOutputFile,

            ImmutableArray<int> statuses)
        {
            BackupSets = backupSets;
            BeginTime = beginTime;
            EndTime = endTime;
            Id = id;
            InstanceId = instanceId;
            InstanceName = instanceName;
            ResultOutputFile = resultOutputFile;
            Statuses = statuses;
        }
    }
}
