fromMap static method

Implementation

static AccountPurchasePaymentsData? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return AccountPurchasePaymentsData(
    account: AccountPurchasePaymentsDataAccount.fromMap(source['account']),
    code: readText(source['code']),
    createdBy:
        AccountPurchasePaymentsDataCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditNoteApplications:
        readList<AccountPurchasePaymentsDataCreditNoteApplication>(
            source['credit_note_applications'],
            AccountPurchasePaymentsDataCreditNoteApplication.fromMap),
    creditNoteTotal: readText(source['credit_note_total']),
    currency: AccountPurchasePaymentsDataCurrency.fromMap(source['currency']),
    href: readText(source['href']),
    id: readText(source['id']),
    lastUpdatedBy: AccountPurchasePaymentsDataLastUpdatedBy.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<AccountPurchasePaymentsDataPaymentMethodApplication>(
            source['payment_method_applications'],
            AccountPurchasePaymentsDataPaymentMethodApplication.fromMap),
    paymentNote: readText(source['payment_note']),
    paymentReference: readAny(source['payment_reference']),
    purchaseInvoiceApplications:
        readList<AccountPurchasePaymentsDataPurchaseInvoiceApplication>(
            source['purchase_invoice_applications'],
            AccountPurchasePaymentsDataPurchaseInvoiceApplication.fromMap),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}