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
ActionRulesetActionThe action to perform when the rule matches.
ExpressionstringThe filter expression that triggers the rule.
DescriptionstringAn optional description of the rule.
Enabledbool?Whether the rule is enabled.
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
- bool?
Expression
The filter expression that triggers the rule.
[JsonPropertyName("expression")]
public string Expression { 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; }