Table of Contents

Class ZoneSetting

Namespace
Cloudflare.NET.Zones.Models
Assembly
Cloudflare.NET.dll

Represents a zone configuration setting.

The Value property contains the setting's current value, which varies by setting type. Use JsonElement methods to extract the appropriate type (GetString, GetInt32, etc.).

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

Examples

var setting = await zones.GetZoneSettingAsync(zoneId, ZoneSettingId.MinTlsVersion);
string tlsVersion = setting.Value.GetString(); // "1.2"

var cacheTtl = await zones.GetZoneSettingAsync(zoneId, ZoneSettingId.BrowserCacheTtl);
int ttlSeconds = cacheTtl.Value.GetInt32(); // 14400

Constructors

ZoneSetting(ZoneSettingId, JsonElement, bool, DateTime?)

Represents a zone configuration setting.

The Value property contains the setting's current value, which varies by setting type. Use JsonElement methods to extract the appropriate type (GetString, GetInt32, etc.).

public ZoneSetting(ZoneSettingId Id, JsonElement Value, bool Editable, DateTime? ModifiedOn)

Parameters

Id ZoneSettingId

The setting identifier (e.g., MinTlsVersion, Ssl).

Value JsonElement

The current value of the setting. Type varies by setting:

  • Toggle settings: string "on" or "off"
  • Numeric settings: integer (e.g., TTL in seconds)
  • Selection settings: enumerated string values
  • Complex settings: nested JSON object
Editable bool

Whether this setting can be modified for the current zone/plan.

ModifiedOn DateTime?

When the setting was last modified.

Examples

var setting = await zones.GetZoneSettingAsync(zoneId, ZoneSettingId.MinTlsVersion);
string tlsVersion = setting.Value.GetString(); // "1.2"

var cacheTtl = await zones.GetZoneSettingAsync(zoneId, ZoneSettingId.BrowserCacheTtl);
int ttlSeconds = cacheTtl.Value.GetInt32(); // 14400
See Also

Properties

Editable

Whether this setting can be modified for the current zone/plan.

[JsonPropertyName("editable")]
public bool Editable { get; init; }

Property Value

bool

Id

The setting identifier (e.g., MinTlsVersion, Ssl).

[JsonPropertyName("id")]
[JsonConverter(typeof(ExtensibleEnumConverter<ZoneSettingId>))]
public ZoneSettingId Id { get; init; }

Property Value

ZoneSettingId

ModifiedOn

When the setting was last modified.

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

Property Value

DateTime?

Value

The current value of the setting. Type varies by setting:

  • Toggle settings: string "on" or "off"
  • Numeric settings: integer (e.g., TTL in seconds)
  • Selection settings: enumerated string values
  • Complex settings: nested JSON object
[JsonPropertyName("value")]
public JsonElement Value { get; init; }

Property Value

JsonElement

See Also