Table of Contents

Class Membership

Namespace
Cloudflare.NET.User.Models
Assembly
Cloudflare.NET.dll

Represents a user's membership in a Cloudflare account.

Memberships show which accounts the user has access to and their permissions within each account.

public record Membership : IEquatable<Membership>
Inheritance
Membership
Implements
Inherited Members

Remarks

User-Scoped: This is the user's view of their account relationships. Each membership grants access to a specific account with defined permissions.

Invitation Workflow: Pending memberships represent invitations that can be accepted or rejected via UpdateMembershipAsync(string, UpdateMembershipRequest, CancellationToken).

Constructors

Membership(string, MemberStatus, Account, bool?, MembershipPermissions?, IReadOnlyList<string>?, IReadOnlyList<MembershipPolicy>?)

Represents a user's membership in a Cloudflare account.

Memberships show which accounts the user has access to and their permissions within each account.

public Membership(string Id, MemberStatus Status, Account Account, bool? ApiAccessEnabled = null, MembershipPermissions? Permissions = null, IReadOnlyList<string>? Roles = null, IReadOnlyList<MembershipPolicy>? Policies = null)

Parameters

Id string

Membership identifier.

Status MemberStatus

Current membership status (pending, accepted, rejected).

Account Account

The account this membership grants access to.

ApiAccessEnabled bool?

Whether API access is enabled for this membership.

Permissions MembershipPermissions

Permissions the user has in this account.

Roles IReadOnlyList<string>

Role IDs assigned to this membership.

Policies IReadOnlyList<MembershipPolicy>

Fine-grained policies for this membership.

Remarks

User-Scoped: This is the user's view of their account relationships. Each membership grants access to a specific account with defined permissions.

Invitation Workflow: Pending memberships represent invitations that can be accepted or rejected via UpdateMembershipAsync(string, UpdateMembershipRequest, CancellationToken).

Properties

Account

The account this membership grants access to.

[JsonPropertyName("account")]
public Account Account { get; init; }

Property Value

Account

ApiAccessEnabled

Whether API access is enabled for this membership.

[JsonPropertyName("api_access_enabled")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? ApiAccessEnabled { get; init; }

Property Value

bool?

Id

Membership identifier.

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

Permissions

Permissions the user has in this account.

[JsonPropertyName("permissions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MembershipPermissions? Permissions { get; init; }

Property Value

MembershipPermissions

Policies

Fine-grained policies for this membership.

[JsonPropertyName("policies")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<MembershipPolicy>? Policies { get; init; }

Property Value

IReadOnlyList<MembershipPolicy>

Roles

Role IDs assigned to this membership.

[JsonPropertyName("roles")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Roles { get; init; }

Property Value

IReadOnlyList<string>

Status

Current membership status (pending, accepted, rejected).

[JsonPropertyName("status")]
public MemberStatus Status { get; init; }

Property Value

MemberStatus