Table of Contents

Struct ZoneType

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

Represents the type of a Cloudflare Zone setup.

Zone types determine how DNS and traffic handling are configured:

  • FullDNS is fully hosted by Cloudflare
  • Partial (CNAME)DNS remains with the original provider; only specific records are proxied
  • SecondaryCloudflare acts as a secondary DNS provider
[JsonConverter(typeof(ExtensibleEnumConverter<ZoneType>))]
public readonly struct ZoneType : IExtensibleEnum<ZoneType>, IEquatable<ZoneType>
Implements
Inherited Members

Examples

// Using a known type with IntelliSense
var zoneType = ZoneType.Full;

// Checking zone type
if (zone.Type == ZoneType.Partial) { ... }

// Using implicit conversion from string
ZoneType customType = "new-type";

Remarks

This is an extensible enum that provides IntelliSense for known values while allowing custom values for new zone types that may be added to the Cloudflare API in the future.

Use the static properties for known types (e.g., Full, Partial) or create custom values using the constructor or implicit string conversion.

Constructors

ZoneType(string)

Creates a new ZoneType with the specified value.

public ZoneType(string value)

Parameters

value string

The string value representing the zone type.

Exceptions

ArgumentNullException

Thrown when value is null.

Properties

Full

Full zone setup - DNS is fully hosted by Cloudflare.

This is the standard setup where all DNS records are managed through Cloudflare and all traffic flows through Cloudflare's network.

public static ZoneType Full { get; }

Property Value

ZoneType

Partial

Partial (CNAME) zone setup - DNS remains with the original provider.

In this setup, the domain's authoritative DNS remains with the original provider. Only specific subdomains are proxied through Cloudflare using CNAME records. This is commonly used for SaaS providers or when full DNS migration isn't possible.

public static ZoneType Partial { get; }

Property Value

ZoneType

Secondary

Secondary zone setup - Cloudflare acts as a secondary DNS provider.

In this setup, Cloudflare receives zone transfers from a primary DNS provider and acts as a secondary authoritative server. This provides DNS redundancy.

public static ZoneType Secondary { get; }

Property Value

ZoneType

Value

Gets the underlying string value of this zone type.

public string Value { get; }

Property Value

string

Methods

Create(string)

Creates a new instance of the extensible enum from the specified string value.

public static ZoneType Create(string value)

Parameters

value string

The string value to wrap.

Returns

ZoneType

A new instance of ZoneType containing the specified value.

Equals(ZoneType)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ZoneType other)

Parameters

other ZoneType

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(ZoneType, ZoneType)

Determines whether two ZoneType values are equal.

public static bool operator ==(ZoneType left, ZoneType right)

Parameters

left ZoneType
right ZoneType

Returns

bool

implicit operator string(ZoneType)

Implicitly converts a ZoneType to its string value.

public static implicit operator string(ZoneType type)

Parameters

type ZoneType

The zone type to convert.

Returns

string

implicit operator ZoneType(string)

Implicitly converts a string to a ZoneType.

public static implicit operator ZoneType(string value)

Parameters

value string

The string value to convert.

Returns

ZoneType

operator !=(ZoneType, ZoneType)

Determines whether two ZoneType values are not equal.

public static bool operator !=(ZoneType left, ZoneType right)

Parameters

left ZoneType
right ZoneType

Returns

bool

See Also