toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (this.userId != null) {
    json[r'userId'] = this.userId;
  } else {
    json[r'userId'] = null;
  }
  if (this.groupId != null) {
    json[r'groupId'] = this.groupId;
  } else {
    json[r'groupId'] = null;
  }
  if (this.username != null) {
    json[r'username'] = this.username;
  } else {
    json[r'username'] = null;
  }
  if (this.firstName != null) {
    json[r'firstName'] = this.firstName;
  } else {
    json[r'firstName'] = null;
  }
  if (this.lastName != null) {
    json[r'lastName'] = this.lastName;
  } else {
    json[r'lastName'] = null;
  }
  if (this.email != null) {
    json[r'email'] = this.email;
  } else {
    json[r'email'] = null;
  }
  json[r'roles'] = this.roles;
  if (this.createdAt != null) {
    json[r'createdAt'] = this.createdAt!.toUtc().toIso8601String();
  } else {
    json[r'createdAt'] = null;
  }
  if (this.updatedAt != null) {
    json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String();
  } else {
    json[r'updatedAt'] = null;
  }
  return json;
}