IssuingCardholderAuthorizationControls.fromJson constructor

IssuingCardholderAuthorizationControls.fromJson(
  1. Object? json
)

Implementation

factory IssuingCardholderAuthorizationControls.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingCardholderAuthorizationControls(
    allowedCategories: map['allowed_categories'] == null
        ? null
        : (map['allowed_categories'] as List<Object?>)
            .map((el) =>
                IssuingCardholderSpendingControlsAllowedCategoriesItem
                    .fromJson(el))
            .toList(),
    blockedCategories: map['blocked_categories'] == null
        ? null
        : (map['blocked_categories'] as List<Object?>)
            .map((el) =>
                IssuingCardholderSpendingControlsAllowedCategoriesItem
                    .fromJson(el))
            .toList(),
    spendingLimits: map['spending_limits'] == null
        ? null
        : (map['spending_limits'] as List<Object?>)
            .map((el) => IssuingCardholderSpendingLimit.fromJson(el))
            .toList(),
    spendingLimitsCurrency: map['spending_limits_currency'] == null
        ? null
        : (map['spending_limits_currency'] as String),
  );
}