// *** 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 zscaler.PulumiPackage.Zpa.AccessPolicy
{
    /// <summary>
    /// ## Import
    /// 
    /// Zscaler offers a dedicated tool called Zscaler-Terraformer to allow the automated import of ZPA configurations into Terraform-compliant HashiCorp Configuration Language. [Visit](https://github.com/zscaler/zscaler-terraformer) Policy access rule can be imported by using `&lt;POLICY ACCESS RULE ID&gt;` as the import ID. For example
    /// 
    /// ```sh
    ///  $ pulumi import zpa:AccessPolicy/policyAccessRule:PolicyAccessRule example &lt;policy_access_rule_id&gt;
    /// ```
    /// </summary>
    [ZpaResourceType("zpa:AccessPolicy/policyAccessRule:PolicyAccessRule")]
    public partial class PolicyAccessRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// (Optional) This is for providing the rule action. Supported values: ``ALLOW``, ``DENY``
        /// </summary>
        [Output("action")]
        public Output<string?> Action { get; private set; } = null!;

        /// <summary>
        /// This field defines the description of the server.
        /// </summary>
        [Output("actionId")]
        public Output<string?> ActionId { get; private set; } = null!;

        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        [Output("appConnectorGroups")]
        public Output<ImmutableArray<Outputs.PolicyAccessRuleAppConnectorGroup>> AppConnectorGroups { get; private set; } = null!;

        /// <summary>
        /// List of the server group IDs.
        /// </summary>
        [Output("appServerGroups")]
        public Output<ImmutableArray<Outputs.PolicyAccessRuleAppServerGroup>> AppServerGroups { get; private set; } = null!;

        [Output("bypassDefaultRule")]
        public Output<bool?> BypassDefaultRule { get; private set; } = null!;

        /// <summary>
        /// (Optional)
        /// </summary>
        [Output("conditions")]
        public Output<ImmutableArray<Outputs.PolicyAccessRuleCondition>> Conditions { get; private set; } = null!;

        /// <summary>
        /// (Optional) This is for providing a customer message for the user.
        /// </summary>
        [Output("customMsg")]
        public Output<string?> CustomMsg { get; private set; } = null!;

        /// <summary>
        /// This is for providing a customer message for the user.
        /// </summary>
        [Output("defaultRule")]
        public Output<bool?> DefaultRule { get; private set; } = null!;

        /// <summary>
        /// (Optional) This is the description of the access policy rule.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        [Output("lssDefaultRule")]
        public Output<bool?> LssDefaultRule { get; private set; } = null!;

        /// <summary>
        /// (Optional)
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// (Optional) Supported values: ``AND``, and ``OR``
        /// </summary>
        [Output("operator")]
        public Output<string> Operator { get; private set; } = null!;

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

        /// <summary>
        /// (Optional) Supported values: ``ACCESS_POLICY`` or ``GLOBAL_POLICY``
        /// </summary>
        [Output("policyType")]
        public Output<string> PolicyType { get; private set; } = null!;

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

        [Output("reauthDefaultRule")]
        public Output<bool?> ReauthDefaultRule { get; private set; } = null!;

        [Output("reauthIdleTimeout")]
        public Output<string?> ReauthIdleTimeout { get; private set; } = null!;

        [Output("reauthTimeout")]
        public Output<string?> ReauthTimeout { get; private set; } = null!;

        /// <summary>
        /// (Optional)
        /// </summary>
        [Output("ruleOrder")]
        public Output<string> RuleOrder { get; private set; } = null!;

        [Output("zpnInspectionProfileId")]
        public Output<string?> ZpnInspectionProfileId { get; private set; } = null!;


        /// <summary>
        /// Create a PolicyAccessRule 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 PolicyAccessRule(string name, PolicyAccessRuleArgs? args = null, CustomResourceOptions? options = null)
            : base("zpa:AccessPolicy/policyAccessRule:PolicyAccessRule", name, args ?? new PolicyAccessRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private PolicyAccessRule(string name, Input<string> id, PolicyAccessRuleState? state = null, CustomResourceOptions? options = null)
            : base("zpa:AccessPolicy/policyAccessRule:PolicyAccessRule", 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/zscaler",
            };
            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 PolicyAccessRule 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 PolicyAccessRule Get(string name, Input<string> id, PolicyAccessRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new PolicyAccessRule(name, id, state, options);
        }
    }

    public sealed class PolicyAccessRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// (Optional) This is for providing the rule action. Supported values: ``ALLOW``, ``DENY``
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        /// <summary>
        /// This field defines the description of the server.
        /// </summary>
        [Input("actionId")]
        public Input<string>? ActionId { get; set; }

        [Input("appConnectorGroups")]
        private InputList<Inputs.PolicyAccessRuleAppConnectorGroupArgs>? _appConnectorGroups;

        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleAppConnectorGroupArgs> AppConnectorGroups
        {
            get => _appConnectorGroups ?? (_appConnectorGroups = new InputList<Inputs.PolicyAccessRuleAppConnectorGroupArgs>());
            set => _appConnectorGroups = value;
        }

        [Input("appServerGroups")]
        private InputList<Inputs.PolicyAccessRuleAppServerGroupArgs>? _appServerGroups;

        /// <summary>
        /// List of the server group IDs.
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleAppServerGroupArgs> AppServerGroups
        {
            get => _appServerGroups ?? (_appServerGroups = new InputList<Inputs.PolicyAccessRuleAppServerGroupArgs>());
            set => _appServerGroups = value;
        }

        [Input("bypassDefaultRule")]
        public Input<bool>? BypassDefaultRule { get; set; }

        [Input("conditions")]
        private InputList<Inputs.PolicyAccessRuleConditionArgs>? _conditions;

        /// <summary>
        /// (Optional)
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleConditionArgs> Conditions
        {
            get => _conditions ?? (_conditions = new InputList<Inputs.PolicyAccessRuleConditionArgs>());
            set => _conditions = value;
        }

        /// <summary>
        /// (Optional) This is for providing a customer message for the user.
        /// </summary>
        [Input("customMsg")]
        public Input<string>? CustomMsg { get; set; }

        /// <summary>
        /// This is for providing a customer message for the user.
        /// </summary>
        [Input("defaultRule")]
        public Input<bool>? DefaultRule { get; set; }

        /// <summary>
        /// (Optional) This is the description of the access policy rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("lssDefaultRule")]
        public Input<bool>? LssDefaultRule { get; set; }

        /// <summary>
        /// (Optional)
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// (Optional) Supported values: ``AND``, and ``OR``
        /// </summary>
        [Input("operator")]
        public Input<string>? Operator { get; set; }

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

        /// <summary>
        /// (Optional) Supported values: ``ACCESS_POLICY`` or ``GLOBAL_POLICY``
        /// </summary>
        [Input("policyType")]
        public Input<string>? PolicyType { get; set; }

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

        [Input("reauthDefaultRule")]
        public Input<bool>? ReauthDefaultRule { get; set; }

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

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

        /// <summary>
        /// (Optional)
        /// </summary>
        [Input("ruleOrder")]
        public Input<string>? RuleOrder { get; set; }

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

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

    public sealed class PolicyAccessRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// (Optional) This is for providing the rule action. Supported values: ``ALLOW``, ``DENY``
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        /// <summary>
        /// This field defines the description of the server.
        /// </summary>
        [Input("actionId")]
        public Input<string>? ActionId { get; set; }

        [Input("appConnectorGroups")]
        private InputList<Inputs.PolicyAccessRuleAppConnectorGroupGetArgs>? _appConnectorGroups;

        /// <summary>
        /// List of app-connector IDs.
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleAppConnectorGroupGetArgs> AppConnectorGroups
        {
            get => _appConnectorGroups ?? (_appConnectorGroups = new InputList<Inputs.PolicyAccessRuleAppConnectorGroupGetArgs>());
            set => _appConnectorGroups = value;
        }

        [Input("appServerGroups")]
        private InputList<Inputs.PolicyAccessRuleAppServerGroupGetArgs>? _appServerGroups;

        /// <summary>
        /// List of the server group IDs.
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleAppServerGroupGetArgs> AppServerGroups
        {
            get => _appServerGroups ?? (_appServerGroups = new InputList<Inputs.PolicyAccessRuleAppServerGroupGetArgs>());
            set => _appServerGroups = value;
        }

        [Input("bypassDefaultRule")]
        public Input<bool>? BypassDefaultRule { get; set; }

        [Input("conditions")]
        private InputList<Inputs.PolicyAccessRuleConditionGetArgs>? _conditions;

        /// <summary>
        /// (Optional)
        /// </summary>
        public InputList<Inputs.PolicyAccessRuleConditionGetArgs> Conditions
        {
            get => _conditions ?? (_conditions = new InputList<Inputs.PolicyAccessRuleConditionGetArgs>());
            set => _conditions = value;
        }

        /// <summary>
        /// (Optional) This is for providing a customer message for the user.
        /// </summary>
        [Input("customMsg")]
        public Input<string>? CustomMsg { get; set; }

        /// <summary>
        /// This is for providing a customer message for the user.
        /// </summary>
        [Input("defaultRule")]
        public Input<bool>? DefaultRule { get; set; }

        /// <summary>
        /// (Optional) This is the description of the access policy rule.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("lssDefaultRule")]
        public Input<bool>? LssDefaultRule { get; set; }

        /// <summary>
        /// (Optional)
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// (Optional) Supported values: ``AND``, and ``OR``
        /// </summary>
        [Input("operator")]
        public Input<string>? Operator { get; set; }

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

        /// <summary>
        /// (Optional) Supported values: ``ACCESS_POLICY`` or ``GLOBAL_POLICY``
        /// </summary>
        [Input("policyType")]
        public Input<string>? PolicyType { get; set; }

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

        [Input("reauthDefaultRule")]
        public Input<bool>? ReauthDefaultRule { get; set; }

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

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

        /// <summary>
        /// (Optional)
        /// </summary>
        [Input("ruleOrder")]
        public Input<string>? RuleOrder { get; set; }

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

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