Table of Contents

Class CreateRuleRequest

Namespace
Cloudflare.NET.Security.Rulesets.Models
Assembly
Cloudflare.NET.dll

Defines the request payload for creating a new rule within a ruleset.

public record CreateRuleRequest : IEquatable<CreateRuleRequest>
Inheritance
CreateRuleRequest
Implements
Inherited Members

Constructors

CreateRuleRequest(RulesetAction, string, string?, bool?, object?, Logging?, RateLimitParameters?)

Defines the request payload for creating a new rule within a ruleset.

public CreateRuleRequest(RulesetAction Action, string Expression, string? Description = null, bool? Enabled = true, object? ActionParameters = null, Logging? Logging = null, RateLimitParameters? Ratelimit = null)

Parameters

Action RulesetAction

The action to perform when the rule matches.

Expression string

The filter expression that triggers the rule.

Description string

An optional description of the rule.

Enabled bool?

Whether the rule is enabled.

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

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