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
IdstringMembership identifier.
StatusMemberStatusCurrent membership status (pending, accepted, rejected).
AccountAccountThe account this membership grants access to.
ApiAccessEnabledbool?Whether API access is enabled for this membership.
PermissionsMembershipPermissionsPermissions the user has in this account.
RolesIReadOnlyList<string>Role IDs assigned to this membership.
PoliciesIReadOnlyList<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
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
Permissions
Permissions the user has in this account.
[JsonPropertyName("permissions")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MembershipPermissions? Permissions { get; init; }
Property Value
Policies
Fine-grained policies for this membership.
[JsonPropertyName("policies")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<MembershipPolicy>? Policies { get; init; }
Property Value
Roles
Role IDs assigned to this membership.
[JsonPropertyName("roles")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Roles { get; init; }
Property Value
Status
Current membership status (pending, accepted, rejected).
[JsonPropertyName("status")]
public MemberStatus Status { get; init; }