<filename>sdk/dotnet/Nas/AutoSnapshotPolicy.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
{
    /// <summary>
    /// Provides a Network Attached Storage (NAS) Auto Snapshot Policy resource.
    /// 
    /// For information about Network Attached Storage (NAS) Auto Snapshot Policy and how to use it, see [What is Auto Snapshot Policy](https://www.alibabacloud.com/help/en/doc-detail/135662.html).
    /// 
    /// &gt; **NOTE:** Available in v1.153.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new AliCloud.Nas.AutoSnapshotPolicy("example", new()
    ///     {
    ///         AutoSnapshotPolicyName = "example_value",
    ///         RepeatWeekdays = new[]
    ///         {
    ///             "3",
    ///             "4",
    ///             "5",
    ///         },
    ///         RetentionDays = 30,
    ///         TimePoints = new[]
    ///         {
    ///             "3",
    ///             "4",
    ///             "5",
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Network Attached Storage (NAS) Auto Snapshot Policy can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy")]
    public partial class AutoSnapshotPolicy : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The name of the automatic snapshot policy. Limits:
        /// - The name must be `2` to `128` characters in length,
        /// - The name must start with a letter.
        /// - The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with `http://` or `https://`.
        /// - The value of this parameter is empty by default.
        /// </summary>
        [Output("autoSnapshotPolicyName")]
        public Output<string?> AutoSnapshotPolicyName { get; private set; } = null!;

        /// <summary>
        /// The day on which an auto snapshot is created.
        /// - A maximum of 7 time points can be selected.
        /// - The format is  an JSON array of ["1", "2", … "7"]  and the time points are separated by commas (,).
        /// </summary>
        [Output("repeatWeekdays")]
        public Output<ImmutableArray<string>> RepeatWeekdays { get; private set; } = null!;

        /// <summary>
        /// The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
        /// - `-1`: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
        /// </summary>
        [Output("retentionDays")]
        public Output<int> RetentionDays { get; private set; } = null!;

        /// <summary>
        /// The status of the automatic snapshot policy.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// The point in time at which an auto snapshot is created.
        /// - A maximum of 24 time points can be selected.
        /// - The format is  an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
        /// </summary>
        [Output("timePoints")]
        public Output<ImmutableArray<string>> TimePoints { get; private set; } = null!;


        /// <summary>
        /// Create a AutoSnapshotPolicy 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 AutoSnapshotPolicy(string name, AutoSnapshotPolicyArgs args, CustomResourceOptions? options = null)
            : base("alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy", name, args ?? new AutoSnapshotPolicyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AutoSnapshotPolicy(string name, Input<string> id, AutoSnapshotPolicyState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:nas/autoSnapshotPolicy:AutoSnapshotPolicy", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            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 AutoSnapshotPolicy 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 AutoSnapshotPolicy Get(string name, Input<string> id, AutoSnapshotPolicyState? state = null, CustomResourceOptions? options = null)
        {
            return new AutoSnapshotPolicy(name, id, state, options);
        }
    }

    public sealed class AutoSnapshotPolicyArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the automatic snapshot policy. Limits:
        /// - The name must be `2` to `128` characters in length,
        /// - The name must start with a letter.
        /// - The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with `http://` or `https://`.
        /// - The value of this parameter is empty by default.
        /// </summary>
        [Input("autoSnapshotPolicyName")]
        public Input<string>? AutoSnapshotPolicyName { get; set; }

        [Input("repeatWeekdays", required: true)]
        private InputList<string>? _repeatWeekdays;

        /// <summary>
        /// The day on which an auto snapshot is created.
        /// - A maximum of 7 time points can be selected.
        /// - The format is  an JSON array of ["1", "2", … "7"]  and the time points are separated by commas (,).
        /// </summary>
        public InputList<string> RepeatWeekdays
        {
            get => _repeatWeekdays ?? (_repeatWeekdays = new InputList<string>());
            set => _repeatWeekdays = value;
        }

        /// <summary>
        /// The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
        /// - `-1`: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
        /// </summary>
        [Input("retentionDays")]
        public Input<int>? RetentionDays { get; set; }

        [Input("timePoints", required: true)]
        private InputList<string>? _timePoints;

        /// <summary>
        /// The point in time at which an auto snapshot is created.
        /// - A maximum of 24 time points can be selected.
        /// - The format is  an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
        /// </summary>
        public InputList<string> TimePoints
        {
            get => _timePoints ?? (_timePoints = new InputList<string>());
            set => _timePoints = value;
        }

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

    public sealed class AutoSnapshotPolicyState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name of the automatic snapshot policy. Limits:
        /// - The name must be `2` to `128` characters in length,
        /// - The name must start with a letter.
        /// - The name can contain digits, colons (:), underscores (_), and hyphens (-). The name cannot start with `http://` or `https://`.
        /// - The value of this parameter is empty by default.
        /// </summary>
        [Input("autoSnapshotPolicyName")]
        public Input<string>? AutoSnapshotPolicyName { get; set; }

        [Input("repeatWeekdays")]
        private InputList<string>? _repeatWeekdays;

        /// <summary>
        /// The day on which an auto snapshot is created.
        /// - A maximum of 7 time points can be selected.
        /// - The format is  an JSON array of ["1", "2", … "7"]  and the time points are separated by commas (,).
        /// </summary>
        public InputList<string> RepeatWeekdays
        {
            get => _repeatWeekdays ?? (_repeatWeekdays = new InputList<string>());
            set => _repeatWeekdays = value;
        }

        /// <summary>
        /// The number of days for which you want to retain auto snapshots. Unit: days. Valid values:
        /// - `-1`: the default value. Auto snapshots are permanently retained. After the number of auto snapshots exceeds the upper limit, the earliest auto snapshot is automatically deleted.
        /// </summary>
        [Input("retentionDays")]
        public Input<int>? RetentionDays { get; set; }

        /// <summary>
        /// The status of the automatic snapshot policy.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("timePoints")]
        private InputList<string>? _timePoints;

        /// <summary>
        /// The point in time at which an auto snapshot is created.
        /// - A maximum of 24 time points can be selected.
        /// - The format is  an JSON array of ["0", "1", … "23"] and the time points are separated by commas (,).
        /// </summary>
        public InputList<string> TimePoints
        {
            get => _timePoints ?? (_timePoints = new InputList<string>());
            set => _timePoints = value;
        }

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