// *** 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.Tctest.Mysql
{
    [TctestResourceType("tctest:Mysql/backupPolicy:BackupPolicy")]
    public partial class BackupPolicy : Pulumi.CustomResource
    {
        /// <summary>
        /// Backup method. Supported values include: `physical` - physical backup.
        /// </summary>
        [Output("backupModel")]
        public Output<string?> BackupModel { get; private set; } = null!;

        /// <summary>
        /// Instance backup time, in the format of 'HH:mm-HH:mm'. Time setting interval is four hours. Default to `02:00-06:00`. The
        /// following value can be supported: `02:00-06:00`, `06:00-10:00`, `10:00-14:00`, `14:00-18:00`, `18:00-22:00`, and
        /// `22:00-02:00`.
        /// </summary>
        [Output("backupTime")]
        public Output<string?> BackupTime { get; private set; } = null!;

        /// <summary>
        /// Retention period for binlog in days.
        /// </summary>
        [Output("binlogPeriod")]
        public Output<int> BinlogPeriod { get; private set; } = null!;

        /// <summary>
        /// Instance ID to which policies will be applied.
        /// </summary>
        [Output("mysqlId")]
        public Output<string> MysqlId { get; private set; } = null!;

        /// <summary>
        /// Instance backup retention days. Valid value ranges: [7~730]. And default value is `7`.
        /// </summary>
        [Output("retentionPeriod")]
        public Output<int?> RetentionPeriod { get; private set; } = null!;


        /// <summary>
        /// Create a BackupPolicy resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public BackupPolicy(string name, BackupPolicyArgs args, CustomResourceOptions? options = null)
            : base("tctest:Mysql/backupPolicy:BackupPolicy", name, args ?? new BackupPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private BackupPolicy(string name, Input<string> id, BackupPolicyState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Mysql/backupPolicy:BackupPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing BackupPolicy resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static BackupPolicy Get(string name, Input<string> id, BackupPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new BackupPolicy(name, id, state, options);
        }
    }

    public sealed class BackupPolicyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Backup method. Supported values include: `physical` - physical backup.
        /// </summary>
        [Input("backupModel")]
        public Input<string>? BackupModel { get; set; }

        /// <summary>
        /// Instance backup time, in the format of 'HH:mm-HH:mm'. Time setting interval is four hours. Default to `02:00-06:00`. The
        /// following value can be supported: `02:00-06:00`, `06:00-10:00`, `10:00-14:00`, `14:00-18:00`, `18:00-22:00`, and
        /// `22:00-02:00`.
        /// </summary>
        [Input("backupTime")]
        public Input<string>? BackupTime { get; set; }

        /// <summary>
        /// Instance ID to which policies will be applied.
        /// </summary>
        [Input("mysqlId", required: true)]
        public Input<string> MysqlId { get; set; } = null!;

        /// <summary>
        /// Instance backup retention days. Valid value ranges: [7~730]. And default value is `7`.
        /// </summary>
        [Input("retentionPeriod")]
        public Input<int>? RetentionPeriod { get; set; }

        public BackupPolicyArgs()
        {
        }
    }

    public sealed class BackupPolicyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Backup method. Supported values include: `physical` - physical backup.
        /// </summary>
        [Input("backupModel")]
        public Input<string>? BackupModel { get; set; }

        /// <summary>
        /// Instance backup time, in the format of 'HH:mm-HH:mm'. Time setting interval is four hours. Default to `02:00-06:00`. The
        /// following value can be supported: `02:00-06:00`, `06:00-10:00`, `10:00-14:00`, `14:00-18:00`, `18:00-22:00`, and
        /// `22:00-02:00`.
        /// </summary>
        [Input("backupTime")]
        public Input<string>? BackupTime { get; set; }

        /// <summary>
        /// Retention period for binlog in days.
        /// </summary>
        [Input("binlogPeriod")]
        public Input<int>? BinlogPeriod { get; set; }

        /// <summary>
        /// Instance ID to which policies will be applied.
        /// </summary>
        [Input("mysqlId")]
        public Input<string>? MysqlId { get; set; }

        /// <summary>
        /// Instance backup retention days. Valid value ranges: [7~730]. And default value is `7`.
        /// </summary>
        [Input("retentionPeriod")]
        public Input<int>? RetentionPeriod { get; set; }

        public BackupPolicyState()
        {
        }
    }
}
