toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'_id'] = this.id;
json[r'tenantId'] = this.tenantId;
if (this.userId != null) {
json[r'userId'] = this.userId;
} else {
json[r'userId'] = null;
}
if (this.email != null) {
json[r'email'] = this.email;
} else {
json[r'email'] = null;
}
if (this.username != null) {
json[r'username'] = this.username;
} else {
json[r'username'] = null;
}
if (this.ipHash != null) {
json[r'ipHash'] = this.ipHash;
} else {
json[r'ipHash'] = null;
}
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
json[r'bannedByUserId'] = this.bannedByUserId;
json[r'bannedCommentText'] = this.bannedCommentText;
json[r'banType'] = this.banType;
if (this.bannedUntil != null) {
json[r'bannedUntil'] = this.bannedUntil!.toUtc().toIso8601String();
} else {
json[r'bannedUntil'] = null;
}
json[r'hasEmailWildcard'] = this.hasEmailWildcard;
if (this.banReason != null) {
json[r'banReason'] = this.banReason;
} else {
json[r'banReason'] = null;
}
return json;
}