ExternalAccountUpdateOptions.fromJson constructor
ExternalAccountUpdateOptions.fromJson(
- Object? json
Implementation
factory ExternalAccountUpdateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return ExternalAccountUpdateOptions(
accountHolderName: map['account_holder_name'] == null
? null
: (map['account_holder_name'] as String),
accountHolderType: map['account_holder_type'] == null
? null
: ExternalAccountAccountHolderType.fromJson(
map['account_holder_type']),
accountType: map['account_type'] == null
? null
: ExternalAccountAccountType.fromJson(map['account_type']),
addressCity:
map['address_city'] == null ? null : (map['address_city'] as String),
addressCountry: map['address_country'] == null
? null
: (map['address_country'] as String),
addressLine1: map['address_line1'] == null
? null
: (map['address_line1'] as String),
addressLine2: map['address_line2'] == null
? null
: (map['address_line2'] as String),
addressState: map['address_state'] == null
? null
: (map['address_state'] as String),
addressZip:
map['address_zip'] == null ? null : (map['address_zip'] as String),
defaultForCurrency: map['default_for_currency'] == null
? null
: (map['default_for_currency'] as bool),
documents: map['documents'] == null
? null
: ExternalAccountDocuments.fromJson(map['documents']),
expMonth: map['exp_month'] == null ? null : (map['exp_month'] as String),
expYear: map['exp_year'] == null ? null : (map['exp_year'] as String),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
name: map['name'] == null ? null : (map['name'] as String),
);
}