TaxCalculationShippingCost.fromJson constructor
TaxCalculationShippingCost.fromJson(
- Object? json
Implementation
factory TaxCalculationShippingCost.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return TaxCalculationShippingCost(
amount: (map['amount'] as num).toInt(),
amountTax: (map['amount_tax'] as num).toInt(),
shippingRate: map['shipping_rate'] == null
? null
: (map['shipping_rate'] as String),
taxBehavior:
TaxCalculationShippingCostTaxBehavior.fromJson(map['tax_behavior']),
taxBreakdown: map['tax_breakdown'] == null
? null
: (map['tax_breakdown'] as List<Object?>)
.map((el) => TaxProductResourceLineItemTaxBreakdown.fromJson(el))
.toList(),
taxCode: (map['tax_code'] as String),
);
}