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
valuestringThe string value representing the account type.
Exceptions
- ArgumentNullException
Thrown when
valueis null.
Properties
Enterprise
Enterprise Cloudflare account type.
public static AccountType Enterprise { get; }
Property Value
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
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
Methods
Create(string)
Creates a new instance of the extensible enum from the specified string value.
public static AccountType Create(string value)
Parameters
valuestringThe 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
otherAccountTypeAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
leftAccountTyperightAccountType
Returns
implicit operator string(AccountType)
Implicitly converts an AccountType to its string value.
public static implicit operator string(AccountType type)
Parameters
typeAccountTypeThe account type to convert.
Returns
implicit operator AccountType(string)
Implicitly converts a string to an AccountType.
public static implicit operator AccountType(string value)
Parameters
valuestringThe string value to convert.
Returns
operator !=(AccountType, AccountType)
Determines whether two AccountType values are not equal.
public static bool operator !=(AccountType left, AccountType right)
Parameters
leftAccountTyperightAccountType