fromMap static method
Implementation
static PurchaseCreditNoteRead? fromMap(Object? body) {
final source = readRecord(body, envelopeKey: 'purchase_credit_note');
if (source == null) return null;
return PurchaseCreditNoteRead(
account: PurchaseCreditNoteReadAccount.fromMap(source['account']),
code: readText(source['code']),
createdBy: PurchaseCreditNoteReadCreatedBy.fromMap(source['created_by']),
createdOn: readText(source['created_on']),
currency: PurchaseCreditNoteReadCurrency.fromMap(source['currency']),
href: readText(source['href']),
id: readText(source['id']),
initialAmount: readText(source['initial_amount']),
issueDate: readText(source['issue_date']),
lastUpdatedBy: PurchaseCreditNoteReadLastUpdatedBy.fromMap(
source['last_updated_by']),
lastUpdatedOn: readText(source['last_updated_on']),
object: readText(source['object']),
purchaseCreditNoteRows:
readList<PurchaseCreditNoteReadPurchaseCreditNoteRow>(
source['purchase_credit_note_rows'],
PurchaseCreditNoteReadPurchaseCreditNoteRow.fromMap),
purchasePayment: PurchaseCreditNoteReadPurchasePayment.fromMap(
source['purchase_payment']),
refundAmount: readText(source['refund_amount']),
refundable: readFlag(source['refundable']),
remainingAmount: readText(source['remaining_amount']),
status: readText(source['status']),
version: readInteger(source['version']),
);
}