Table of Contents

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

Id string

The unique identifier of the rule.

Version string

The version of the rule.

Action RulesetAction

The action to perform when the rule matches.

Expression string

The filter expression that triggers the rule.

Enabled bool

Whether the rule is enabled.

LastUpdated DateTime

When the rule was last updated.

Description string

An optional description of the rule.

ActionParameters object

Parameters for the rule's action.

Logging Logging

Configuration for logging.

Ratelimit RateLimitParameters

Rate limiting configuration for the rule.

Properties

Action

The action to perform when the rule matches.

[JsonPropertyName("action")]
public RulesetAction Action { get; init; }

Property Value

RulesetAction

ActionParameters

Parameters for the rule's action.

[JsonPropertyName("action_parameters")]
public object? ActionParameters { get; init; }

Property Value

object

Description

An optional description of the rule.

[JsonPropertyName("description")]
public string? Description { get; init; }

Property Value

string

Enabled

Whether the rule is enabled.

[JsonPropertyName("enabled")]
public bool Enabled { get; init; }

Property Value

bool

Expression

The filter expression that triggers the rule.

[JsonPropertyName("expression")]
public string Expression { get; init; }

Property Value

string

Id

The unique identifier of the rule.

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

LastUpdated

When the rule was last updated.

[JsonPropertyName("last_updated")]
public DateTime LastUpdated { get; init; }

Property Value

DateTime

Logging

Configuration for logging.

[JsonPropertyName("logging")]
public Logging? Logging { get; init; }

Property Value

Logging

Ratelimit

Rate limiting configuration for the rule.

[JsonPropertyName("ratelimit")]
public RateLimitParameters? Ratelimit { get; init; }

Property Value

RateLimitParameters

Version

The version of the rule.

[JsonPropertyName("version")]
public string Version { get; init; }

Property Value

string