Table of Contents

Struct MemberStatus

Namespace
Cloudflare.NET.Members.Models
Assembly
Cloudflare.NET.dll

Represents the status of an account member.

Member status indicates the state of the membership:

  • AcceptedThe user has accepted the membership invitation
  • PendingThe invitation is awaiting acceptance
  • RejectedThe user has rejected the invitation
[JsonConverter(typeof(ExtensibleEnumConverter<MemberStatus>))]
public readonly struct MemberStatus : IExtensibleEnum<MemberStatus>, IEquatable<MemberStatus>
Implements
Inherited Members

Examples

// Using a known status with IntelliSense
var status = MemberStatus.Accepted;

// Checking member status
if (member.Status == MemberStatus.Pending) { ... }

// Using implicit conversion from string
MemberStatus customStatus = "expired";

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.

Constructors

MemberStatus(string)

Creates a new MemberStatus with the specified value.

public MemberStatus(string value)

Parameters

value string

The string value representing the member status.

Exceptions

ArgumentNullException

Thrown when value is null.

Properties

Accepted

The user has accepted the membership invitation.

The member is active and can access account resources according to their roles.

public static MemberStatus Accepted { get; }

Property Value

MemberStatus

Pending

The invitation is awaiting acceptance.

The user has been invited but has not yet accepted or rejected the invitation.

public static MemberStatus Pending { get; }

Property Value

MemberStatus

Rejected

The user has rejected the invitation.

The membership was declined by the invited user.

public static MemberStatus Rejected { get; }

Property Value

MemberStatus

Value

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

Parameters

value string

The string value to wrap.

Returns

MemberStatus

A new instance of MemberStatus containing the specified value.

Equals(MemberStatus)

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

public bool Equals(MemberStatus other)

Parameters

other MemberStatus

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

Determines whether two MemberStatus values are equal.

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

Parameters

left MemberStatus
right MemberStatus

Returns

bool

implicit operator string(MemberStatus)

Implicitly converts a MemberStatus to its string value.

public static implicit operator string(MemberStatus status)

Parameters

status MemberStatus

The member status to convert.

Returns

string

implicit operator MemberStatus(string)

Implicitly converts a string to a MemberStatus.

public static implicit operator MemberStatus(string value)

Parameters

value string

The string value to convert.

Returns

MemberStatus

operator !=(MemberStatus, MemberStatus)

Determines whether two MemberStatus values are not equal.

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

Parameters

left MemberStatus
right MemberStatus

Returns

bool