Contact.fromJson constructor

Contact.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Contact.fromJson(Map<String, dynamic> json) {
  return Contact(
    emailAddress: json['EmailAddress'] as String?,
    lastUpdatedTimestamp: timeStampFromJson(json['LastUpdatedTimestamp']),
    topicDefaultPreferences: (json['TopicDefaultPreferences'] as List?)
        ?.whereNotNull()
        .map((e) => TopicPreference.fromJson(e as Map<String, dynamic>))
        .toList(),
    topicPreferences: (json['TopicPreferences'] as List?)
        ?.whereNotNull()
        .map((e) => TopicPreference.fromJson(e as Map<String, dynamic>))
        .toList(),
    unsubscribeAll: json['UnsubscribeAll'] as bool?,
  );
}