fromMap static method

Implementation

static PurchaseCreditNoteApplicationRead? fromMap(Object? body) {
  final source =
      readRecord(body, envelopeKey: 'purchase_credit_note_application');
  if (source == null) return null;
  return PurchaseCreditNoteApplicationRead(
    amount: readText(source['amount']),
    createdBy: PurchaseCreditNoteApplicationReadCreatedBy.fromMap(
        source['created_by']),
    createdOn: readText(source['created_on']),
    href: readText(source['href']),
    id: readText(source['id']),
    issueDate: readText(source['issue_date']),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    object: readText(source['object']),
    purchaseCreditNote:
        PurchaseCreditNoteApplicationReadPurchaseCreditNote.fromMap(
            source['purchase_credit_note']),
    purchasePayment: PurchaseCreditNoteApplicationReadPurchasePayment.fromMap(
        source['purchase_payment']),
    remainingBalance: readText(source['remaining_balance']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}