Table of Contents

Struct ZoneStatus

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

Represents the status of a Cloudflare Zone.

Zone statuses indicate the current state of a zone in Cloudflare's system, such as whether it's active, pending verification, or has been moved/deleted.

[JsonConverter(typeof(ExtensibleEnumConverter<ZoneStatus>))]
public readonly struct ZoneStatus : IExtensibleEnum<ZoneStatus>, IEquatable<ZoneStatus>
Implements
Inherited Members

Examples

// Using a known status with IntelliSense
var status = ZoneStatus.Active;

// Checking zone status
if (zone.Status == ZoneStatus.Active) { ... }

// Using implicit conversion from string
ZoneStatus customStatus = "new-status";

Remarks

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

Use the static properties for known statuses (e.g., Active, Pending) or create custom values using the constructor or implicit string conversion.

Constructors

ZoneStatus(string)

Creates a new ZoneStatus with the specified value.

public ZoneStatus(string value)

Parameters

value string

The string value representing the status.

Exceptions

ArgumentNullException

Thrown when value is null.

Properties

Active

Active status - the zone is fully operational and serving traffic.

public static ZoneStatus Active { get; }

Property Value

ZoneStatus

Remarks

This is the normal status for a zone that has completed setup and is working correctly.

Deactivated

Deactivated status - the zone has been deactivated.

public static ZoneStatus Deactivated { get; }

Property Value

ZoneStatus

Remarks

This status indicates the zone is no longer active, possibly due to billing issues or manual deactivation.

Deleted

Deleted status - the zone has been removed.

public static ZoneStatus Deleted { get; }

Property Value

ZoneStatus

Remarks

This status indicates the zone has been deleted from Cloudflare.

Initializing

Initializing status - the zone is being set up.

public static ZoneStatus Initializing { get; }

Property Value

ZoneStatus

Remarks

This is a transitional status that occurs during zone creation.

Moved

Moved status - the zone has been transferred to another account.

public static ZoneStatus Moved { get; }

Property Value

ZoneStatus

Remarks

This status indicates the zone is no longer accessible in this account because it has been moved to a different Cloudflare account.

Pending

Pending status - the zone is awaiting nameserver verification.

public static ZoneStatus Pending { get; }

Property Value

ZoneStatus

Remarks

A zone enters this status when first added to Cloudflare. The domain's nameservers must be changed to Cloudflare's nameservers for verification to complete.

Value

Gets the underlying string value of this status.

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 ZoneStatus Create(string value)

Parameters

value string

The string value to wrap.

Returns

ZoneStatus

A new instance of ZoneStatus containing the specified value.

Equals(ZoneStatus)

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

public bool Equals(ZoneStatus other)

Parameters

other ZoneStatus

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 ==(ZoneStatus, ZoneStatus)

Determines whether two ZoneStatus values are equal.

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

Parameters

left ZoneStatus
right ZoneStatus

Returns

bool

implicit operator string(ZoneStatus)

Implicitly converts a ZoneStatus to its string value.

public static implicit operator string(ZoneStatus status)

Parameters

status ZoneStatus

The status to convert.

Returns

string

implicit operator ZoneStatus(string)

Implicitly converts a string to a ZoneStatus.

public static implicit operator ZoneStatus(string value)

Parameters

value string

The string value to convert.

Returns

ZoneStatus

operator !=(ZoneStatus, ZoneStatus)

Determines whether two ZoneStatus values are not equal.

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

Parameters

left ZoneStatus
right ZoneStatus

Returns

bool

See Also