IssuingCardholderUpdateOptions.fromJson constructor

IssuingCardholderUpdateOptions.fromJson(
  1. Object? json
)

Implementation

factory IssuingCardholderUpdateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingCardholderUpdateOptions(
    billing: map['billing'] == null
        ? null
        : CardholderBilling.fromJson(map['billing']),
    company: map['company'] == null
        ? null
        : CardholderCompany.fromJson(map['company']),
    email: map['email'] == null ? null : (map['email'] as String),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    individual: map['individual'] == null
        ? null
        : CardholderIndividual.fromJson(map['individual']),
    metadata: map['metadata'] == null
        ? null
        : (map['metadata'] as Map).cast<String, Object?>().map((
              key,
              value,
            ) =>
                MapEntry(
                  key,
                  (value as String),
                )),
    phoneNumber:
        map['phone_number'] == null ? null : (map['phone_number'] as String),
    preferredLocales: map['preferred_locales'] == null
        ? null
        : (map['preferred_locales'] as List<Object?>)
            .map((el) => IssuingCardholderPreferredLocalesItem.fromJson(el))
            .toList(),
    spendingControls: map['spending_controls'] == null
        ? null
        : CardholderSpendingControls.fromJson(map['spending_controls']),
    status: map['status'] == null
        ? null
        : BillingMeterStatus.fromJson(map['status']),
  );
}