CalculationCustomerDetails.fromJson constructor

CalculationCustomerDetails.fromJson(
  1. Object? json
)

Implementation

factory CalculationCustomerDetails.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return CalculationCustomerDetails(
    address: map['address'] == null
        ? null
        : CalculationAddress.fromJson(map['address']),
    addressSource: map['address_source'] == null
        ? null
        : CalculationAddressSource.fromJson(map['address_source']),
    ipAddress:
        map['ip_address'] == null ? null : (map['ip_address'] as String),
    taxIds: map['tax_ids'] == null
        ? null
        : (map['tax_ids'] as List<Object?>)
            .map((el) => CustomerTaxIdDataItem.fromJson(el))
            .toList(),
    taxabilityOverride: map['taxability_override'] == null
        ? null
        : TaxProductResourceCustomerDetailsTaxabilityOverride.fromJson(
            map['taxability_override']),
  );
}