Table of Contents

Struct AccountType

Namespace
Cloudflare.NET.Accounts.Models
Assembly
Cloudflare.NET.dll

Represents the type of a Cloudflare account.

Account types indicate the tier or category of the account, such as standard or enterprise.

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

Examples

// Using a known type with IntelliSense
var accountType = AccountType.Standard;

// Checking account type
if (account.Type == AccountType.Enterprise) { ... }

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

Remarks

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

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

Constructors

AccountType(string)

Creates a new AccountType with the specified value.

public AccountType(string value)

Parameters

value string

The string value representing the account type.

Exceptions

ArgumentNullException

Thrown when value is null.

Properties

Enterprise

Enterprise Cloudflare account type.

public static AccountType Enterprise { get; }

Property Value

AccountType

Remarks

Enterprise accounts have access to additional features, support options, and higher resource limits.

Standard

Standard Cloudflare account type.

public static AccountType Standard { get; }

Property Value

AccountType

Remarks

This is the most common account type used by individual users and small businesses.

Value

Gets the underlying string value of this account 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 AccountType Create(string value)

Parameters

value string

The string value to wrap.

Returns

AccountType

A new instance of AccountType containing the specified value.

Equals(AccountType)

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

public bool Equals(AccountType other)

Parameters

other AccountType

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

Determines whether two AccountType values are equal.

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

Parameters

left AccountType
right AccountType

Returns

bool

implicit operator string(AccountType)

Implicitly converts an AccountType to its string value.

public static implicit operator string(AccountType type)

Parameters

type AccountType

The account type to convert.

Returns

string

implicit operator AccountType(string)

Implicitly converts a string to an AccountType.

public static implicit operator AccountType(string value)

Parameters

value string

The string value to convert.

Returns

AccountType

operator !=(AccountType, AccountType)

Determines whether two AccountType values are not equal.

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

Parameters

left AccountType
right AccountType

Returns

bool

See Also