getFieldDeserializers method

  1. @override
Map<String, void Function(ParseNode)> getFieldDeserializers()
override

The deserialization information for the current model

Implementation

@override
Map<String, void Function(ParseNode)> getFieldDeserializers() {
  var deserializerMap = <String, void Function(ParseNode)>{};
  deserializerMap['amount_total'] =
      (node) => amountTotal = node.getIntValue();
  deserializerMap['currency'] = (node) => currency = node.getStringValue();
  deserializerMap['customer'] = (node) => customer = node.getStringValue();
  deserializerMap['customer_details'] = (node) => customerDetails =
      node.getObjectValue<TaxProductResourceCustomerDetails>(
          TaxProductResourceCustomerDetails.createFromDiscriminatorValue);
  deserializerMap['expires_at'] = (node) => expiresAt = node.getIntValue();
  deserializerMap['id'] = (node) => id = node.getStringValue();
  deserializerMap['line_items'] = (node) => lineItems =
      node.getObjectValue<CalculationLineItems>(
          CalculationLineItems.createFromDiscriminatorValue);
  deserializerMap['livemode'] = (node) => livemode = node.getBoolValue();
  deserializerMap['object'] = (node) => object =
      node.getEnumValue<CalculationObject>((stringValue) => CalculationObject
          .values
          .where((enumVal) => enumVal.value == stringValue)
          .firstOrNull);
  deserializerMap['ship_from_details'] = (node) => shipFromDetails =
      node.getObjectValue<TaxProductResourceShipFromDetails>(
          TaxProductResourceShipFromDetails.createFromDiscriminatorValue);
  deserializerMap['shipping_cost'] = (node) => shippingCost =
      node.getObjectValue<TaxProductResourceTaxCalculationShippingCost>(
          TaxProductResourceTaxCalculationShippingCost
              .createFromDiscriminatorValue);
  deserializerMap['tax_amount_exclusive'] =
      (node) => taxAmountExclusive = node.getIntValue();
  deserializerMap['tax_amount_inclusive'] =
      (node) => taxAmountInclusive = node.getIntValue();
  deserializerMap['tax_breakdown'] = (node) => taxBreakdown =
      node.getCollectionOfObjectValues<TaxProductResourceTaxBreakdown>(
          TaxProductResourceTaxBreakdown.createFromDiscriminatorValue);
  deserializerMap['tax_date'] = (node) => taxDate = node.getIntValue();
  return deserializerMap;
}