toJson method
Mapping UserData to json.
Implementation
Map<String, dynamic> toJson() {
List<Map>? installations = this.installations?.map((i) => i.toJson()).toList();
return {
'externalUserId': externalUserId,
'firstName': firstName,
'lastName': lastName,
'middleName': middleName,
'gender': gender?.name,
'birthday': birthday,
'type': type,
'phones': phones,
'emails': emails,
'tags': tags,
'customAttributes': customAttributes,
'installations': installations,
}..removeWhere((dynamic key, dynamic value) => value == null);
}