IssuingCardCreateOptions.fromJson constructor
IssuingCardCreateOptions.fromJson(
- Object? json
Implementation
factory IssuingCardCreateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return IssuingCardCreateOptions(
cardholder:
map['cardholder'] == null ? null : (map['cardholder'] as String),
currency: (map['currency'] as String),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
financialAccount: map['financial_account'] == null
? null
: (map['financial_account'] as String),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
personalizationDesign: map['personalization_design'] == null
? null
: (map['personalization_design'] as String),
pin: map['pin'] == null ? null : CardPin.fromJson(map['pin']),
replacementFor: map['replacement_for'] == null
? null
: (map['replacement_for'] as String),
replacementReason: map['replacement_reason'] == null
? null
: CardReplacementReason.fromJson(map['replacement_reason']),
secondLine:
map['second_line'] == null ? null : (map['second_line'] as String),
shipping: map['shipping'] == null
? null
: CardShipping.fromJson(map['shipping']),
spendingControls: map['spending_controls'] == null
? null
: CardSpendingControls.fromJson(map['spending_controls']),
status: map['status'] == null
? null
: BillingMeterStatus.fromJson(map['status']),
type: IssuingCardType.fromJson(map['type']),
);
}