PromotionCodeRestrictions.fromJson constructor
PromotionCodeRestrictions.fromJson(
- Object? json
Implementation
factory PromotionCodeRestrictions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PromotionCodeRestrictions(
currencyOptions: map['currency_options'] == null
? null
: (map['currency_options'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
PromotionCodeCurrencyOptionsValue.fromJson(value),
)),
firstTimeTransaction: map['first_time_transaction'] == null
? null
: (map['first_time_transaction'] as bool),
minimumAmount: map['minimum_amount'] == null
? null
: (map['minimum_amount'] as num).toInt(),
minimumAmountCurrency: map['minimum_amount_currency'] == null
? null
: (map['minimum_amount_currency'] as String),
);
}