<reponame>zscaler/pulumi-zia// *** 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.Zia.URLFiltering
{
    public static class GetURLFilteringRules
    {
        /// <summary>
        /// Use the **zia_url_filtering_rules** data source to get information about a URL filtering rule information for the specified `Name`.
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Zia = Pulumi.Zia;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = Zia.URLFiltering.GetURLFilteringRules.Invoke(new()
        ///     {
        ///         Name = "Example",
        ///     });
        /// 
        /// });
        /// ```
        /// </summary>
        public static Task<GetURLFilteringRulesResult> InvokeAsync(GetURLFilteringRulesArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetURLFilteringRulesResult>("zia:URLFiltering/getURLFilteringRules:getURLFilteringRules", args ?? new GetURLFilteringRulesArgs(), options.WithDefaults());

        /// <summary>
        /// Use the **zia_url_filtering_rules** data source to get information about a URL filtering rule information for the specified `Name`.
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Zia = Pulumi.Zia;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = Zia.URLFiltering.GetURLFilteringRules.Invoke(new()
        ///     {
        ///         Name = "Example",
        ///     });
        /// 
        /// });
        /// ```
        /// </summary>
        public static Output<GetURLFilteringRulesResult> Invoke(GetURLFilteringRulesInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetURLFilteringRulesResult>("zia:URLFiltering/getURLFilteringRules:getURLFilteringRules", args ?? new GetURLFilteringRulesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetURLFilteringRulesArgs : global::Pulumi.InvokeArgs
    {
        [Input("deviceTrustLevels")]
        private List<string>? _deviceTrustLevels;
        public List<string> DeviceTrustLevels
        {
            get => _deviceTrustLevels ?? (_deviceTrustLevels = new List<string>());
            set => _deviceTrustLevels = value;
        }

        /// <summary>
        /// URL Filtering Rule ID
        /// </summary>
        [Input("id")]
        public int? Id { get; set; }

        /// <summary>
        /// Name of the URL Filtering policy rule
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

        /// <summary>
        /// (Number) Order of execution of rule with respect to other URL Filtering rules
        /// </summary>
        [Input("order")]
        public int? Order { get; set; }

        [Input("userAgentTypes")]
        private List<string>? _userAgentTypes;
        public List<string> UserAgentTypes
        {
            get => _userAgentTypes ?? (_userAgentTypes = new List<string>());
            set => _userAgentTypes = value;
        }

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

    public sealed class GetURLFilteringRulesInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("deviceTrustLevels")]
        private InputList<string>? _deviceTrustLevels;
        public InputList<string> DeviceTrustLevels
        {
            get => _deviceTrustLevels ?? (_deviceTrustLevels = new InputList<string>());
            set => _deviceTrustLevels = value;
        }

        /// <summary>
        /// URL Filtering Rule ID
        /// </summary>
        [Input("id")]
        public Input<int>? Id { get; set; }

        /// <summary>
        /// Name of the URL Filtering policy rule
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// (Number) Order of execution of rule with respect to other URL Filtering rules
        /// </summary>
        [Input("order")]
        public Input<int>? Order { get; set; }

        [Input("userAgentTypes")]
        private InputList<string>? _userAgentTypes;
        public InputList<string> UserAgentTypes
        {
            get => _userAgentTypes ?? (_userAgentTypes = new InputList<string>());
            set => _userAgentTypes = value;
        }

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


    [OutputType]
    public sealed class GetURLFilteringRulesResult
    {
        /// <summary>
        /// (String) Action taken when traffic matches rule criteria. Supported values: `ANY`, `NONE`, `BLOCK`, `CAUTION`, `ALLOW`, `ICAP_RESPONSE`
        /// </summary>
        public readonly string Action;
        /// <summary>
        /// (String) When set to true, a `BLOCK` action triggered by the rule could be overridden. If true and both overrideGroup and overrideUsers are not set, the `BLOCK` triggered by this rule could be overridden for any users. If block)Override is not set, `BLOCK` action cannot be overridden.
        /// </summary>
        public readonly bool BlockOverride;
        public readonly int CbiProfileId;
        public readonly bool Ciparule;
        /// <summary>
        /// (List of Object) The departments to which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesDepartmentResult> Departments;
        /// <summary>
        /// (String) Additional information about the rule
        /// </summary>
        public readonly string Description;
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesDeviceGroupResult> DeviceGroups;
        public readonly ImmutableArray<string> DeviceTrustLevels;
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesDeviceResult> Devices;
        /// <summary>
        /// (String) URL of end user notification page to be displayed when the rule is matched. Not applicable if either 'overrideUsers' or 'overrideGroups' is specified.
        /// </summary>
        public readonly string EndUserNotificationUrl;
        /// <summary>
        /// (String) Enforce a set a validity time period for the URL Filtering rule.
        /// </summary>
        public readonly bool EnforceTimeValidity;
        /// <summary>
        /// (List of Object) The groups to which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesGroupResult> Groups;
        /// <summary>
        /// (Number) Identifier that uniquely identifies an entity
        /// </summary>
        public readonly int Id;
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesLabelResult> Labels;
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesLastModifiedByResult> LastModifiedBies;
        /// <summary>
        /// (Number) When the rule was last modified
        /// </summary>
        public readonly int LastModifiedTime;
        /// <summary>
        /// (List of Object) The location groups to which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesLocationGroupResult> LocationGroups;
        /// <summary>
        /// (List of Object) The locations to which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesLocationResult> Locations;
        /// <summary>
        /// (String) The configured name of the entity
        /// </summary>
        public readonly string Name;
        /// <summary>
        /// (Number) Order of execution of rule with respect to other URL Filtering rules
        /// </summary>
        public readonly int Order;
        /// <summary>
        /// (List of Object) Name-ID pairs of users for which this rule can be overridden. Applicable only if blockOverride is set to `true`, action is `BLOCK` and overrideGroups is not set.If this overrideUsers is not set, `BLOCK` action can be overridden for any group.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesOverrideGroupResult> OverrideGroups;
        /// <summary>
        /// (List of Object) Name-ID pairs of users for which this rule can be overridden. Applicable only if blockOverride is set to `true`, action is `BLOCK` and overrideGroups is not set.If this overrideUsers is not set, `BLOCK` action can be overridden for any user.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesOverrideUserResult> OverrideUsers;
        /// <summary>
        /// (List of Object) Protocol criteria. Supported values: `SMRULEF_ZPA_BROKERS_RULE`, `ANY_RULE`, `TCP_RULE`, `UDP_RULE`, `DOHTTPS_RULE`, `TUNNELSSL_RULE`, `HTTP_PROXY`, `FOHTTP_RULE`, `FTP_RULE`, `HTTPS_RULE`, `HTTP_RULE`, `SSL_RULE`, `TUNNEL_RULE`.
        /// </summary>
        public readonly ImmutableArray<string> Protocols;
        /// <summary>
        /// (String) Admin rank of the admin who creates this rule
        /// </summary>
        public readonly int Rank;
        /// <summary>
        /// (String) Request method for which the rule must be applied. If not set, rule will be applied to all methods
        /// </summary>
        public readonly ImmutableArray<string> RequestMethods;
        /// <summary>
        /// (String) Size quota in KB beyond which the URL Filtering rule is applied. If not set, no quota is enforced. If a policy rule action is set to `BLOCK`, this field is not applicable.
        /// </summary>
        public readonly int SizeQuota;
        /// <summary>
        /// (String) Rule State
        /// </summary>
        public readonly string State;
        /// <summary>
        /// (String) Time quota in minutes, after which the URL Filtering rule is applied. If not set, no quota is enforced. If a policy rule action is set to `BLOCK`, this field is not applicable.
        /// </summary>
        public readonly int TimeQuota;
        /// <summary>
        /// (List of Object) The time interval in which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesTimeWindowResult> TimeWindows;
        /// <summary>
        /// (String) List of URL categories for which rule must be applied
        /// </summary>
        public readonly ImmutableArray<string> UrlCategories;
        public readonly ImmutableArray<string> UserAgentTypes;
        /// <summary>
        /// (List of Object) The users to which the Firewall Filtering policy rule applies
        /// </summary>
        public readonly ImmutableArray<Outputs.GetURLFilteringRulesUserResult> Users;
        /// <summary>
        /// (Number) If enforceTimeValidity is set to true, the URL Filtering rule will cease to be valid on this end date and time.
        /// </summary>
        public readonly int ValidityEndTime;
        /// <summary>
        /// (Number) If enforceTimeValidity is set to true, the URL Filtering rule will be valid starting on this date and time.
        /// </summary>
        public readonly int ValidityStartTime;
        /// <summary>
        /// (Number) If enforceTimeValidity is set to true, the URL Filtering rule date and time will be valid based on this time zone ID.
        /// </summary>
        public readonly string ValidityTimeZoneId;

        [OutputConstructor]
        private GetURLFilteringRulesResult(
            string action,

            bool blockOverride,

            int cbiProfileId,

            bool ciparule,

            ImmutableArray<Outputs.GetURLFilteringRulesDepartmentResult> departments,

            string description,

            ImmutableArray<Outputs.GetURLFilteringRulesDeviceGroupResult> deviceGroups,

            ImmutableArray<string> deviceTrustLevels,

            ImmutableArray<Outputs.GetURLFilteringRulesDeviceResult> devices,

            string endUserNotificationUrl,

            bool enforceTimeValidity,

            ImmutableArray<Outputs.GetURLFilteringRulesGroupResult> groups,

            int id,

            ImmutableArray<Outputs.GetURLFilteringRulesLabelResult> labels,

            ImmutableArray<Outputs.GetURLFilteringRulesLastModifiedByResult> lastModifiedBies,

            int lastModifiedTime,

            ImmutableArray<Outputs.GetURLFilteringRulesLocationGroupResult> locationGroups,

            ImmutableArray<Outputs.GetURLFilteringRulesLocationResult> locations,

            string name,

            int order,

            ImmutableArray<Outputs.GetURLFilteringRulesOverrideGroupResult> overrideGroups,

            ImmutableArray<Outputs.GetURLFilteringRulesOverrideUserResult> overrideUsers,

            ImmutableArray<string> protocols,

            int rank,

            ImmutableArray<string> requestMethods,

            int sizeQuota,

            string state,

            int timeQuota,

            ImmutableArray<Outputs.GetURLFilteringRulesTimeWindowResult> timeWindows,

            ImmutableArray<string> urlCategories,

            ImmutableArray<string> userAgentTypes,

            ImmutableArray<Outputs.GetURLFilteringRulesUserResult> users,

            int validityEndTime,

            int validityStartTime,

            string validityTimeZoneId)
        {
            Action = action;
            BlockOverride = blockOverride;
            CbiProfileId = cbiProfileId;
            Ciparule = ciparule;
            Departments = departments;
            Description = description;
            DeviceGroups = deviceGroups;
            DeviceTrustLevels = deviceTrustLevels;
            Devices = devices;
            EndUserNotificationUrl = endUserNotificationUrl;
            EnforceTimeValidity = enforceTimeValidity;
            Groups = groups;
            Id = id;
            Labels = labels;
            LastModifiedBies = lastModifiedBies;
            LastModifiedTime = lastModifiedTime;
            LocationGroups = locationGroups;
            Locations = locations;
            Name = name;
            Order = order;
            OverrideGroups = overrideGroups;
            OverrideUsers = overrideUsers;
            Protocols = protocols;
            Rank = rank;
            RequestMethods = requestMethods;
            SizeQuota = sizeQuota;
            State = state;
            TimeQuota = timeQuota;
            TimeWindows = timeWindows;
            UrlCategories = urlCategories;
            UserAgentTypes = userAgentTypes;
            Users = users;
            ValidityEndTime = validityEndTime;
            ValidityStartTime = validityStartTime;
            ValidityTimeZoneId = validityTimeZoneId;
        }
    }
}
