CarpUser
Represents a CARP Web Service (CAWS) account and user.
- Annotations
-
- @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false, explicitToJson: true)
Constructors
CarpUser.fromJWT
CarpUser.fromJWTOAuth
- Map<
String, dynamic> jwt, - OAuthToken token
CarpUser.fromJson
CarpUser
Properties
accountId
- @Deprecated('Use id instead')
The user's email
firstName
User's first name
id
Unique CARP ID
isAuthenticated
Whether this user has a token. Does not check expiry or server-side validity.
isEmailVerified
Currently returns whether this user has a token; the email verification status is not inspected.
lastName
User's last name
roles
The list of roles that this user has in CARP.
token
The OAuth 2.0 OAuthToken for this user, once authenticated to CARP. Is null if user is not authenticated.
username
Unique CARP username
Methods
authenticated
- OAuthToken token
Set or update the authenticated OAuthToken token for this user.
signOut
Sign out the current user.
toJson
toString
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.