CouponUpdateOptions.fromJson constructor
CouponUpdateOptions.fromJson(
- Object? json
Implementation
factory CouponUpdateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return CouponUpdateOptions(
currencyOptions: map['currency_options'] == null
? null
: (map['currency_options'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
CouponCurrencyOption.fromJson(value),
)),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
name: map['name'] == null ? null : (map['name'] as String),
);
}