Class User
- Namespace
- Cloudflare.NET.User.Models
- Assembly
- Cloudflare.NET.dll
Represents the authenticated user's profile.
Contains all user information including email, name, contact details, security settings, subscription tier flags, and organization memberships.
public record User : IEquatable<User>
- Inheritance
-
User
- Implements
- Inherited Members
Remarks
Only a subset of fields can be edited via the API: FirstName, LastName, Country, Telephone, and Zipcode. Email, suspension status, and 2FA settings are managed through separate flows.
Constructors
User(string, string, string?, string?, string?, string?, string?, bool, bool, bool, bool, bool, bool, IReadOnlyList<string>?, IReadOnlyList<UserOrganization>?, DateTime?, DateTime?)
Represents the authenticated user's profile.
Contains all user information including email, name, contact details, security settings, subscription tier flags, and organization memberships.
public User(string Id, string Email, string? FirstName, string? LastName, string? Telephone, string? Country, string? Zipcode, bool Suspended, bool TwoFactorAuthenticationEnabled, bool TwoFactorAuthenticationLocked = false, bool HasProZones = false, bool HasBusinessZones = false, bool HasEnterpriseZones = false, IReadOnlyList<string>? Betas = null, IReadOnlyList<UserOrganization>? Organizations = null, DateTime? CreatedOn = null, DateTime? ModifiedOn = null)
Parameters
IdstringUser identifier (32 hexadecimal characters).
EmailstringUser's email address.
FirstNamestringUser's first name.
LastNamestringUser's last name.
TelephonestringUser's telephone number (international format, e.g., "+1-555-555-5555").
CountrystringUser's country (ISO 3166-1 alpha-2 code, e.g., "US", "GB", "DE").
ZipcodestringUser's postal/zip code.
SuspendedboolWhether the user account is suspended.
TwoFactorAuthenticationEnabledboolWhether two-factor authentication is enabled for this user.
TwoFactorAuthenticationLockedboolWhether two-factor authentication is locked (cannot be disabled). This is typically set by enterprise security policies.
HasProZonesboolWhether the user has any zones on the Pro plan.
HasBusinessZonesboolWhether the user has any zones on the Business plan.
HasEnterpriseZonesboolWhether the user has any zones on the Enterprise plan.
BetasIReadOnlyList<string>Beta features the user has access to.
OrganizationsIReadOnlyList<UserOrganization>Organizations the user belongs to (deprecated, use Accounts instead).
CreatedOnDateTime?When the user account was created.
ModifiedOnDateTime?When the user profile was last modified.
Remarks
Only a subset of fields can be edited via the API: FirstName, LastName, Country, Telephone, and Zipcode. Email, suspension status, and 2FA settings are managed through separate flows.
- See Also
Properties
Betas
Beta features the user has access to.
[JsonPropertyName("betas")]
public IReadOnlyList<string>? Betas { get; init; }
Property Value
Country
User's country (ISO 3166-1 alpha-2 code, e.g., "US", "GB", "DE").
[JsonPropertyName("country")]
public string? Country { get; init; }
Property Value
CreatedOn
When the user account was created.
[JsonPropertyName("created_on")]
public DateTime? CreatedOn { get; init; }
Property Value
User's email address.
[JsonPropertyName("email")]
public string Email { get; init; }
Property Value
FirstName
User's first name.
[JsonPropertyName("first_name")]
public string? FirstName { get; init; }
Property Value
HasBusinessZones
Whether the user has any zones on the Business plan.
[JsonPropertyName("has_business_zones")]
public bool HasBusinessZones { get; init; }
Property Value
HasEnterpriseZones
Whether the user has any zones on the Enterprise plan.
[JsonPropertyName("has_enterprise_zones")]
public bool HasEnterpriseZones { get; init; }
Property Value
HasProZones
Whether the user has any zones on the Pro plan.
[JsonPropertyName("has_pro_zones")]
public bool HasProZones { get; init; }
Property Value
Id
User identifier (32 hexadecimal characters).
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
LastName
User's last name.
[JsonPropertyName("last_name")]
public string? LastName { get; init; }
Property Value
ModifiedOn
When the user profile was last modified.
[JsonPropertyName("modified_on")]
public DateTime? ModifiedOn { get; init; }
Property Value
Organizations
Organizations the user belongs to (deprecated, use Accounts instead).
[JsonPropertyName("organizations")]
public IReadOnlyList<UserOrganization>? Organizations { get; init; }
Property Value
Suspended
Whether the user account is suspended.
[JsonPropertyName("suspended")]
public bool Suspended { get; init; }
Property Value
Telephone
User's telephone number (international format, e.g., "+1-555-555-5555").
[JsonPropertyName("telephone")]
public string? Telephone { get; init; }
Property Value
TwoFactorAuthenticationEnabled
Whether two-factor authentication is enabled for this user.
[JsonPropertyName("two_factor_authentication_enabled")]
public bool TwoFactorAuthenticationEnabled { get; init; }
Property Value
TwoFactorAuthenticationLocked
Whether two-factor authentication is locked (cannot be disabled). This is typically set by enterprise security policies.
[JsonPropertyName("two_factor_authentication_locked")]
public bool TwoFactorAuthenticationLocked { get; init; }
Property Value
Zipcode
User's postal/zip code.
[JsonPropertyName("zipcode")]
public string? Zipcode { get; init; }