toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (this.id != null) {
    json[r'_id'] = this.id;
  } else {
    json[r'_id'] = null;
  }
  if (this.tenantId != null) {
    json[r'tenantId'] = this.tenantId;
  } else {
    json[r'tenantId'] = null;
  }
  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;
  }
  if (this.createdAt != null) {
    json[r'createdAt'] = this.createdAt!.toUtc().toIso8601String();
  } else {
    json[r'createdAt'] = null;
  }
  if (this.bannedByUserId != null) {
    json[r'bannedByUserId'] = this.bannedByUserId;
  } else {
    json[r'bannedByUserId'] = null;
  }
  if (this.bannedCommentText != null) {
    json[r'bannedCommentText'] = this.bannedCommentText;
  } else {
    json[r'bannedCommentText'] = null;
  }
  if (this.banType != null) {
    json[r'banType'] = this.banType;
  } else {
    json[r'banType'] = null;
  }
  if (this.bannedUntil != null) {
    json[r'bannedUntil'] = this.bannedUntil!.toUtc().toIso8601String();
  } else {
    json[r'bannedUntil'] = null;
  }
  if (this.hasEmailWildcard != null) {
    json[r'hasEmailWildcard'] = this.hasEmailWildcard;
  } else {
    json[r'hasEmailWildcard'] = null;
  }
  if (this.banReason != null) {
    json[r'banReason'] = this.banReason;
  } else {
    json[r'banReason'] = null;
  }
  return json;
}