TokenPerson.fromJson constructor
TokenPerson.fromJson(
- Object? json
Implementation
factory TokenPerson.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return TokenPerson(
additionalTosAcceptances: map['additional_tos_acceptances'] == null
? null
: TokenAdditionalTosAcceptances.fromJson(
map['additional_tos_acceptances']),
address: map['address'] == null
? null
: AccountSupportAddress.fromJson(map['address']),
addressKana: map['address_kana'] == null
? null
: AccountAddressKana.fromJson(map['address_kana']),
addressKanji: map['address_kanji'] == null
? null
: AccountAddressKana.fromJson(map['address_kanji']),
dob: map['dob'] == null ? null : AccountDob.fromJson(map['dob']),
documents: map['documents'] == null
? null
: PersonDocuments.fromJson(map['documents']),
email: map['email'] == null ? null : (map['email'] as String),
firstName:
map['first_name'] == null ? null : (map['first_name'] as String),
firstNameKana: map['first_name_kana'] == null
? null
: (map['first_name_kana'] as String),
firstNameKanji: map['first_name_kanji'] == null
? null
: (map['first_name_kanji'] as String),
fullNameAliases: map['full_name_aliases'] == null
? null
: (map['full_name_aliases'] as List<Object?>)
.map((el) => (el as String))
.toList(),
gender: map['gender'] == null ? null : (map['gender'] as String),
idNumber: map['id_number'] == null ? null : (map['id_number'] as String),
idNumberSecondary: map['id_number_secondary'] == null
? null
: (map['id_number_secondary'] as String),
lastName: map['last_name'] == null ? null : (map['last_name'] as String),
lastNameKana: map['last_name_kana'] == null
? null
: (map['last_name_kana'] as String),
lastNameKanji: map['last_name_kanji'] == null
? null
: (map['last_name_kanji'] as String),
maidenName:
map['maiden_name'] == null ? null : (map['maiden_name'] as String),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
nationality:
map['nationality'] == null ? null : (map['nationality'] as String),
phone: map['phone'] == null ? null : (map['phone'] as String),
politicalExposure: map['political_exposure'] == null
? null
: (map['political_exposure'] as String),
registeredAddress: map['registered_address'] == null
? null
: AccountSupportAddress.fromJson(map['registered_address']),
relationship: map['relationship'] == null
? null
: TokenRelationship.fromJson(map['relationship']),
ssnLast4:
map['ssn_last_4'] == null ? null : (map['ssn_last_4'] as String),
verification: map['verification'] == null
? null
: AccountIndividualVerification.fromJson(map['verification']),
);
}