TerminalConfigurationConfigurationResourceCurrencySpecificConfig.fromJson constructor

TerminalConfigurationConfigurationResourceCurrencySpecificConfig.fromJson(
  1. Object? json
)

Implementation

factory TerminalConfigurationConfigurationResourceCurrencySpecificConfig.fromJson(
    Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return TerminalConfigurationConfigurationResourceCurrencySpecificConfig(
    fixedAmounts: map['fixed_amounts'] == null
        ? null
        : (map['fixed_amounts'] as List<Object?>)
            .map((el) => (el as num).toInt())
            .toList(),
    percentages: map['percentages'] == null
        ? null
        : (map['percentages'] as List<Object?>)
            .map((el) => (el as num).toInt())
            .toList(),
    smartTipThreshold: map['smart_tip_threshold'] == null
        ? null
        : (map['smart_tip_threshold'] as num).toInt(),
  );
}