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
IdZoneSettingIdThe setting identifier (e.g., MinTlsVersion, Ssl).
ValueJsonElementThe 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
EditableboolWhether this setting can be modified for the current zone/plan.
ModifiedOnDateTime?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
Id
The setting identifier (e.g., MinTlsVersion, Ssl).
[JsonPropertyName("id")]
[JsonConverter(typeof(ExtensibleEnumConverter<ZoneSettingId>))]
public ZoneSettingId Id { get; init; }
Property Value
ModifiedOn
When the setting was last modified.
[JsonPropertyName("modified_on")]
public DateTime? ModifiedOn { get; init; }
Property Value
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; }