<filename>sdk/dotnet/ProtectionRule.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;
using Pulumi;

namespace PiersKarsenbarg.Nutanix
{
    /// <summary>
    /// Provides a Nutanix Protection Rule resource to Create a Protection Rule.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Nutanix = PiersKarsenbarg.Nutanix;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var protectionRuleTest = new Nutanix.ProtectionRule("protectionRuleTest", new Nutanix.ProtectionRuleArgs
    ///         {
    ///             AvailabilityZoneConnectivityLists = 
    ///             {
    ///                 new Nutanix.Inputs.ProtectionRuleAvailabilityZoneConnectivityListArgs
    ///                 {
    ///                     SnapshotScheduleLists = 
    ///                     {
    ///                         new Nutanix.Inputs.ProtectionRuleAvailabilityZoneConnectivityListSnapshotScheduleListArgs
    ///                         {
    ///                             LocalSnapshotRetentionPolicy = new Nutanix.Inputs.ProtectionRuleAvailabilityZoneConnectivityListSnapshotScheduleListLocalSnapshotRetentionPolicyArgs
    ///                             {
    ///                                 NumSnapshots = 1,
    ///                             },
    ///                             RecoveryPointObjectiveSecs = 3600,
    ///                             SnapshotType = "CRASH_CONSISTENT",
    ///                         },
    ///                     },
    ///                 },
    ///             },
    ///             CategoryFilter = new Nutanix.Inputs.ProtectionRuleCategoryFilterArgs
    ///             {
    ///                 Params = 
    ///                 {
    ///                     new Nutanix.Inputs.ProtectionRuleCategoryFilterParamArgs
    ///                     {
    ///                         Name = "Environment",
    ///                         Values = 
    ///                         {
    ///                             "Dev",
    ///                         },
    ///                     },
    ///                 },
    ///             },
    ///             Description = "test",
    ///             OrderedAvailabilityZoneLists = 
    ///             {
    ///                 new Nutanix.Inputs.ProtectionRuleOrderedAvailabilityZoneListArgs
    ///                 {
    ///                     AvailabilityZoneUrl = "ab788130-0820-4d07-a1b5-b0ba4d3a42asd",
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [NutanixResourceType("nutanix:index/protectionRule:ProtectionRule")]
    public partial class ProtectionRule : Pulumi.CustomResource
    {
        [Output("apiVersion")]
        public Output<string> ApiVersion { get; private set; } = null!;

        /// <summary>
        /// This encodes the datapipes between various availability zones and\nthe backup policy of the pipes.
        /// * `availability_zone_connectivity_list.destination_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.source_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list` - (Optional/Computed) Snapshot schedules for the pair of the availability zones.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.recovery_point_objective_secs` - (Required) "A recovery point objective (RPO) is the maximum acceptable amount of data loss.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.num_snapshots` - (Optional/Computed) Number of snapshots need to be retained.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_multiple` - (Optional/Computed) Multiplier to 'snapshot_interval_type'.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_snapshot_interval_type` - (Optional/Computed)
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.auto_suspend_timeout_secs` - (Optional/Computed) Auto suspend timeout in case of connection failure between the sites.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.snapshot_type` - (Optional/Computed) Crash consistent or Application Consistent snapshot.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.remote_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// </summary>
        [Output("availabilityZoneConnectivityLists")]
        public Output<ImmutableArray<Outputs.ProtectionRuleAvailabilityZoneConnectivityList>> AvailabilityZoneConnectivityLists { get; private set; } = null!;

        [Output("categories")]
        public Output<ImmutableArray<Outputs.ProtectionRuleCategory>> Categories { get; private set; } = null!;

        /// <summary>
        /// * `category_filter.0.type` - (Optional/Computed) The type of the filter being used.
        /// * `category_filter.0.kind_list` - (Optional/Computed) List of kinds associated with this filter.
        /// * `category_filter.0.params` - (Optional/Computed) A list of category key and list of values.
        /// </summary>
        [Output("categoryFilter")]
        public Output<Outputs.ProtectionRuleCategoryFilter> CategoryFilter { get; private set; } = null!;

        /// <summary>
        /// A description for protection rule.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        [Output("metadata")]
        public Output<ImmutableDictionary<string, string>> Metadata { get; private set; } = null!;

        /// <summary>
        /// The name for the protection rule.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// A list of availability zones, each of which, receives a replica\nof the data for the entities protected by this protection rule.
        /// * `ordered_availability_zone_list.#.cluster_uuid` - (Optional/Computed) UUID of specific cluster to which we will be replicating.
        /// * `ordered_availability_zone_list.#.availability_zone_url` - (Optional/Computed) The FQDN or IP address of the availability zone.
        /// </summary>
        [Output("orderedAvailabilityZoneLists")]
        public Output<ImmutableArray<Outputs.ProtectionRuleOrderedAvailabilityZoneList>> OrderedAvailabilityZoneLists { get; private set; } = null!;

        [Output("ownerReference")]
        public Output<Outputs.ProtectionRuleOwnerReference> OwnerReference { get; private set; } = null!;

        [Output("projectReference")]
        public Output<Outputs.ProtectionRuleProjectReference> ProjectReference { get; private set; } = null!;

        [Output("startTime")]
        public Output<string> StartTime { get; private set; } = null!;

        [Output("state")]
        public Output<string> State { get; private set; } = null!;


        /// <summary>
        /// Create a ProtectionRule 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 ProtectionRule(string name, ProtectionRuleArgs args, CustomResourceOptions? options = null)
            : base("nutanix:index/protectionRule:ProtectionRule", name, args ?? new ProtectionRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ProtectionRule(string name, Input<string> id, ProtectionRuleState? state = null, CustomResourceOptions? options = null)
            : base("nutanix:index/protectionRule:ProtectionRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/pierskarsenbarg/pulumi-nutanix/releases/download/${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 ProtectionRule 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 ProtectionRule Get(string name, Input<string> id, ProtectionRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new ProtectionRule(name, id, state, options);
        }
    }

    public sealed class ProtectionRuleArgs : Pulumi.ResourceArgs
    {
        [Input("availabilityZoneConnectivityLists", required: true)]
        private InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListArgs>? _availabilityZoneConnectivityLists;

        /// <summary>
        /// This encodes the datapipes between various availability zones and\nthe backup policy of the pipes.
        /// * `availability_zone_connectivity_list.destination_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.source_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list` - (Optional/Computed) Snapshot schedules for the pair of the availability zones.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.recovery_point_objective_secs` - (Required) "A recovery point objective (RPO) is the maximum acceptable amount of data loss.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.num_snapshots` - (Optional/Computed) Number of snapshots need to be retained.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_multiple` - (Optional/Computed) Multiplier to 'snapshot_interval_type'.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_snapshot_interval_type` - (Optional/Computed)
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.auto_suspend_timeout_secs` - (Optional/Computed) Auto suspend timeout in case of connection failure between the sites.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.snapshot_type` - (Optional/Computed) Crash consistent or Application Consistent snapshot.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.remote_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// </summary>
        public InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListArgs> AvailabilityZoneConnectivityLists
        {
            get => _availabilityZoneConnectivityLists ?? (_availabilityZoneConnectivityLists = new InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListArgs>());
            set => _availabilityZoneConnectivityLists = value;
        }

        [Input("categories")]
        private InputList<Inputs.ProtectionRuleCategoryArgs>? _categories;
        public InputList<Inputs.ProtectionRuleCategoryArgs> Categories
        {
            get => _categories ?? (_categories = new InputList<Inputs.ProtectionRuleCategoryArgs>());
            set => _categories = value;
        }

        /// <summary>
        /// * `category_filter.0.type` - (Optional/Computed) The type of the filter being used.
        /// * `category_filter.0.kind_list` - (Optional/Computed) List of kinds associated with this filter.
        /// * `category_filter.0.params` - (Optional/Computed) A list of category key and list of values.
        /// </summary>
        [Input("categoryFilter")]
        public Input<Inputs.ProtectionRuleCategoryFilterArgs>? CategoryFilter { get; set; }

        /// <summary>
        /// A description for protection rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The name for the protection rule.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("orderedAvailabilityZoneLists", required: true)]
        private InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListArgs>? _orderedAvailabilityZoneLists;

        /// <summary>
        /// A list of availability zones, each of which, receives a replica\nof the data for the entities protected by this protection rule.
        /// * `ordered_availability_zone_list.#.cluster_uuid` - (Optional/Computed) UUID of specific cluster to which we will be replicating.
        /// * `ordered_availability_zone_list.#.availability_zone_url` - (Optional/Computed) The FQDN or IP address of the availability zone.
        /// </summary>
        public InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListArgs> OrderedAvailabilityZoneLists
        {
            get => _orderedAvailabilityZoneLists ?? (_orderedAvailabilityZoneLists = new InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListArgs>());
            set => _orderedAvailabilityZoneLists = value;
        }

        [Input("ownerReference")]
        public Input<Inputs.ProtectionRuleOwnerReferenceArgs>? OwnerReference { get; set; }

        [Input("projectReference")]
        public Input<Inputs.ProtectionRuleProjectReferenceArgs>? ProjectReference { get; set; }

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

        public ProtectionRuleArgs()
        {
        }
    }

    public sealed class ProtectionRuleState : Pulumi.ResourceArgs
    {
        [Input("apiVersion")]
        public Input<string>? ApiVersion { get; set; }

        [Input("availabilityZoneConnectivityLists")]
        private InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListGetArgs>? _availabilityZoneConnectivityLists;

        /// <summary>
        /// This encodes the datapipes between various availability zones and\nthe backup policy of the pipes.
        /// * `availability_zone_connectivity_list.destination_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.source_availability_zone_index` - (Optional/Computed) Index of the availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list` - (Optional/Computed) Snapshot schedules for the pair of the availability zones.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.recovery_point_objective_secs` - (Required) "A recovery point objective (RPO) is the maximum acceptable amount of data loss.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.num_snapshots` - (Optional/Computed) Number of snapshots need to be retained.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_multiple` - (Optional/Computed) Multiplier to 'snapshot_interval_type'.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.local_snapshot_retention_policy.0.rollup_retention_policy_snapshot_interval_type` - (Optional/Computed)
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.auto_suspend_timeout_secs` - (Optional/Computed) Auto suspend timeout in case of connection failure between the sites.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.snapshot_type` - (Optional/Computed) Crash consistent or Application Consistent snapshot.
        /// * `availability_zone_connectivity_list.snapshot_schedule_list.#.remote_snapshot_retention_policy` - (Optional/Computed) This describes the snapshot retention policy for this availability zone.
        /// </summary>
        public InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListGetArgs> AvailabilityZoneConnectivityLists
        {
            get => _availabilityZoneConnectivityLists ?? (_availabilityZoneConnectivityLists = new InputList<Inputs.ProtectionRuleAvailabilityZoneConnectivityListGetArgs>());
            set => _availabilityZoneConnectivityLists = value;
        }

        [Input("categories")]
        private InputList<Inputs.ProtectionRuleCategoryGetArgs>? _categories;
        public InputList<Inputs.ProtectionRuleCategoryGetArgs> Categories
        {
            get => _categories ?? (_categories = new InputList<Inputs.ProtectionRuleCategoryGetArgs>());
            set => _categories = value;
        }

        /// <summary>
        /// * `category_filter.0.type` - (Optional/Computed) The type of the filter being used.
        /// * `category_filter.0.kind_list` - (Optional/Computed) List of kinds associated with this filter.
        /// * `category_filter.0.params` - (Optional/Computed) A list of category key and list of values.
        /// </summary>
        [Input("categoryFilter")]
        public Input<Inputs.ProtectionRuleCategoryFilterGetArgs>? CategoryFilter { get; set; }

        /// <summary>
        /// A description for protection rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("metadata")]
        private InputMap<string>? _metadata;
        public InputMap<string> Metadata
        {
            get => _metadata ?? (_metadata = new InputMap<string>());
            set => _metadata = value;
        }

        /// <summary>
        /// The name for the protection rule.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("orderedAvailabilityZoneLists")]
        private InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListGetArgs>? _orderedAvailabilityZoneLists;

        /// <summary>
        /// A list of availability zones, each of which, receives a replica\nof the data for the entities protected by this protection rule.
        /// * `ordered_availability_zone_list.#.cluster_uuid` - (Optional/Computed) UUID of specific cluster to which we will be replicating.
        /// * `ordered_availability_zone_list.#.availability_zone_url` - (Optional/Computed) The FQDN or IP address of the availability zone.
        /// </summary>
        public InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListGetArgs> OrderedAvailabilityZoneLists
        {
            get => _orderedAvailabilityZoneLists ?? (_orderedAvailabilityZoneLists = new InputList<Inputs.ProtectionRuleOrderedAvailabilityZoneListGetArgs>());
            set => _orderedAvailabilityZoneLists = value;
        }

        [Input("ownerReference")]
        public Input<Inputs.ProtectionRuleOwnerReferenceGetArgs>? OwnerReference { get; set; }

        [Input("projectReference")]
        public Input<Inputs.ProtectionRuleProjectReferenceGetArgs>? ProjectReference { get; set; }

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

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

        public ProtectionRuleState()
        {
        }
    }
}
