fromMap static method

PurchasePaymentRead? fromMap(
  1. Object? body
)

Implementation

static PurchasePaymentRead? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'purchase_payment');
  if (source == null) return null;
  return PurchasePaymentRead(
    account: PurchasePaymentReadAccount.fromMap(source['account']),
    code: readText(source['code']),
    createdBy: PurchasePaymentReadCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditNoteApplications:
        readList<PurchasePaymentReadCreditNoteApplication>(
            source['credit_note_applications'],
            PurchasePaymentReadCreditNoteApplication.fromMap),
    creditNoteTotal: readText(source['credit_note_total']),
    currency: PurchasePaymentReadCurrency.fromMap(source['currency']),
    href: readText(source['href']),
    id: readText(source['id']),
    lastUpdatedBy:
        PurchasePaymentReadLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    object: readText(source['object']),
    origin: readText(source['origin']),
    paidTotal: readText(source['paid_total']),
    paymentDate: readText(source['payment_date']),
    paymentMethodApplications:
        readList<PurchasePaymentReadPaymentMethodApplication>(
            source['payment_method_applications'],
            PurchasePaymentReadPaymentMethodApplication.fromMap),
    paymentNote: readText(source['payment_note']),
    paymentReference: readAny(source['payment_reference']),
    purchaseInvoiceApplications:
        readList<PurchasePaymentReadPurchaseInvoiceApplication>(
            source['purchase_invoice_applications'],
            PurchasePaymentReadPurchaseInvoiceApplication.fromMap),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}