Class Rule
- Namespace
- Cloudflare.NET.Security.Rulesets.Models
- Assembly
- Cloudflare.NET.dll
Represents a single rule within a Ruleset.
public record Rule : IEquatable<Rule>
- Inheritance
-
Rule
- Implements
- Inherited Members
Constructors
Rule(string, string, RulesetAction, string, bool, DateTime, string?, object?, Logging?, RateLimitParameters?)
Represents a single rule within a Ruleset.
public Rule(string Id, string Version, RulesetAction Action, string Expression, bool Enabled, DateTime LastUpdated, string? Description = null, object? ActionParameters = null, Logging? Logging = null, RateLimitParameters? Ratelimit = null)
Parameters
IdstringThe unique identifier of the rule.
VersionstringThe version of the rule.
ActionRulesetActionThe action to perform when the rule matches.
ExpressionstringThe filter expression that triggers the rule.
EnabledboolWhether the rule is enabled.
LastUpdatedDateTimeWhen the rule was last updated.
DescriptionstringAn optional description of the rule.
ActionParametersobjectParameters for the rule's action.
LoggingLoggingConfiguration for logging.
RatelimitRateLimitParametersRate limiting configuration for the rule.
Properties
Action
The action to perform when the rule matches.
[JsonPropertyName("action")]
public RulesetAction Action { get; init; }
Property Value
ActionParameters
Parameters for the rule's action.
[JsonPropertyName("action_parameters")]
public object? ActionParameters { get; init; }
Property Value
Description
An optional description of the rule.
[JsonPropertyName("description")]
public string? Description { get; init; }
Property Value
Enabled
Whether the rule is enabled.
[JsonPropertyName("enabled")]
public bool Enabled { get; init; }
Property Value
Expression
The filter expression that triggers the rule.
[JsonPropertyName("expression")]
public string Expression { get; init; }
Property Value
Id
The unique identifier of the rule.
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
LastUpdated
When the rule was last updated.
[JsonPropertyName("last_updated")]
public DateTime LastUpdated { get; init; }
Property Value
Logging
Configuration for logging.
[JsonPropertyName("logging")]
public Logging? Logging { get; init; }
Property Value
Ratelimit
Rate limiting configuration for the rule.
[JsonPropertyName("ratelimit")]
public RateLimitParameters? Ratelimit { get; init; }
Property Value
Version
The version of the rule.
[JsonPropertyName("version")]
public string Version { get; init; }