fromMap static method

PurchaseCreditNote? fromMap(
  1. Object? body
)

Implementation

static PurchaseCreditNote? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return PurchaseCreditNote(
    account: PurchaseCreditNoteAccount.fromMap(source['account']),
    amount: readText(source['amount']),
    code: readText(source['code']),
    createdBy: readAny(source['created_by']),
    createdOn: readText(source['created_on']),
    currency: PurchaseCreditNoteCurrency.fromMap(source['currency']),
    customAttributes: readList<Object>(source['custom_attributes'], readAny),
    date: readText(source['date']),
    href: readText(source['href']),
    id: readText(source['id']),
    initialAmount: readText(source['initial_amount']),
    issueDate: readText(source['issue_date']),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    object: readText(source['object']),
    paymentId: readText(source['payment_id']),
    purchaseCreditNoteRows: readList<PurchaseCreditNotePurchaseCreditNoteRow>(
        source['purchase_credit_note_rows'],
        PurchaseCreditNotePurchaseCreditNoteRow.fromMap),
    purchasePayment:
        PurchaseCreditNotePurchasePayment.fromMap(source['purchase_payment']),
    refundAmount: readText(source['refund_amount']),
    refundable: readAny(source['refundable']),
    remainingAmount: readText(source['remaining_amount']),
    remainingBalance: readText(source['remaining_balance']),
    status: readText(source['status']),
    uuid: readText(source['uuid']),
    version: readAny(source['version']),
  );
}