ShippingRateCreateOptions.fromJson constructor
ShippingRateCreateOptions.fromJson(
- Object? json
Implementation
factory ShippingRateCreateOptions.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return ShippingRateCreateOptions(
deliveryEstimate: map['delivery_estimate'] == null
? null
: SessionDeliveryEstimate.fromJson(map['delivery_estimate']),
displayName: (map['display_name'] as String),
expand: map['expand'] == null
? null
: (map['expand'] as List<Object?>)
.map((el) => (el as String))
.toList(),
fixedAmount: map['fixed_amount'] == null
? null
: SessionFixedAmount.fromJson(map['fixed_amount']),
metadata: map['metadata'] == null
? null
: (map['metadata'] as Map).cast<String, Object?>().map((
key,
value,
) =>
MapEntry(
key,
(value as String),
)),
taxBehavior: map['tax_behavior'] == null
? null
: ShippingRateCurrencyOptionTaxBehavior.fromJson(map['tax_behavior']),
taxCode: map['tax_code'] == null ? null : (map['tax_code'] as String),
);
}