Class CreateAccountMemberRequest
- Namespace
- Cloudflare.NET.Members.Models
- Assembly
- Cloudflare.NET.dll
Request to invite a new member to an account.
An invitation email will be sent to the specified email address. The user must accept the invitation to become an active member.
public record CreateAccountMemberRequest : IEquatable<CreateAccountMemberRequest>
- Inheritance
-
CreateAccountMemberRequest
- Implements
- Inherited Members
Examples
var request = new CreateAccountMemberRequest(
Email: "[email protected]",
Roles: new[] { "dns-admin-role-id", "viewer-role-id" }
);
var member = await client.Members.CreateAccountMemberAsync(accountId, request);
Constructors
CreateAccountMemberRequest(string, IReadOnlyList<string>, IReadOnlyList<CreateMemberPolicyRequest>?, MemberStatus?)
Request to invite a new member to an account.
An invitation email will be sent to the specified email address. The user must accept the invitation to become an active member.
public CreateAccountMemberRequest(string Email, IReadOnlyList<string> Roles, IReadOnlyList<CreateMemberPolicyRequest>? Policies = null, MemberStatus? Status = null)
Parameters
EmailstringEmail address of the user to invite.
RolesIReadOnlyList<string>Role IDs to assign to the member upon acceptance.
PoliciesIReadOnlyList<CreateMemberPolicyRequest>Optional policies for fine-grained access control.
StatusMemberStatus?Optional status to set (typically omitted for new invitations).
Examples
var request = new CreateAccountMemberRequest(
Email: "[email protected]",
Roles: new[] { "dns-admin-role-id", "viewer-role-id" }
);
var member = await client.Members.CreateAccountMemberAsync(accountId, request);
Properties
Email address of the user to invite.
[JsonPropertyName("email")]
public string Email { get; init; }
Property Value
Policies
Optional policies for fine-grained access control.
[JsonPropertyName("policies")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<CreateMemberPolicyRequest>? Policies { get; init; }
Property Value
Roles
Role IDs to assign to the member upon acceptance.
[JsonPropertyName("roles")]
public IReadOnlyList<string> Roles { get; init; }
Property Value
Status
Optional status to set (typically omitted for new invitations).
[JsonPropertyName("status")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MemberStatus? Status { get; init; }