Table of Contents

Class AccessRule

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

Represents a single IP Access Rule.

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

Constructors

AccessRule(string, AccessRuleMode, AccessRuleConfiguration, string?, IReadOnlyList<AccessRuleMode>, Scope, DateTimeOffset?, DateTimeOffset?)

Represents a single IP Access Rule.

public AccessRule(string Id, AccessRuleMode Mode, AccessRuleConfiguration Configuration, string? Notes, IReadOnlyList<AccessRuleMode> AllowedModes, Scope Scope, DateTimeOffset? CreatedOn, DateTimeOffset? ModifiedOn)

Parameters

Id string

The unique identifier of the rule.

Mode AccessRuleMode

The action to take when the rule matches.

Configuration AccessRuleConfiguration

The configuration that defines the rule's target.

Notes string

Optional notes about the rule.

AllowedModes IReadOnlyList<AccessRuleMode>

The modes that are allowed for this rule.

Scope Scope

The scope of the rule (e.g., account, zone).

CreatedOn DateTimeOffset?

When the rule was created.

ModifiedOn DateTimeOffset?

When the rule was last modified.

Properties

AllowedModes

The modes that are allowed for this rule.

[JsonPropertyName("allowed_modes")]
public IReadOnlyList<AccessRuleMode> AllowedModes { get; init; }

Property Value

IReadOnlyList<AccessRuleMode>

Configuration

The configuration that defines the rule's target.

[JsonPropertyName("configuration")]
public AccessRuleConfiguration Configuration { get; init; }

Property Value

AccessRuleConfiguration

CreatedOn

When the rule was created.

[JsonPropertyName("created_on")]
public DateTimeOffset? CreatedOn { get; init; }

Property Value

DateTimeOffset?

Id

The unique identifier of the rule.

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

Property Value

string

Mode

The action to take when the rule matches.

[JsonPropertyName("mode")]
public AccessRuleMode Mode { get; init; }

Property Value

AccessRuleMode

ModifiedOn

When the rule was last modified.

[JsonPropertyName("modified_on")]
public DateTimeOffset? ModifiedOn { get; init; }

Property Value

DateTimeOffset?

Notes

Optional notes about the rule.

[JsonPropertyName("notes")]
public string? Notes { get; init; }

Property Value

string

Scope

The scope of the rule (e.g., account, zone).

[JsonPropertyName("scope")]
public Scope Scope { get; init; }

Property Value

Scope