CardUpdateOptions.fromJson constructor
CardUpdateOptions.fromJson(
- Object? json
Implementation
factory CardUpdateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return CardUpdateOptions(
accountHolderName: map['account_holder_name'] == null
? null
: (map['account_holder_name'] as String),
accountHolderType: map['account_holder_type'] == null
? null
: IssuingCardholderType.fromJson(map['account_holder_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),
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),
owner: map['owner'] == null ? null : CardOwner.fromJson(map['owner']),
);
}