fromMap static method
Implementation
static PurchaseRefund? fromMap(Object? body) {
final source = readRecord(body, envelopeKey: 'purchase_refund');
if (source == null) return null;
return PurchaseRefund(
account: PurchaseRefundAccount.fromMap(source['account']),
alternateDate: readText(source['alternate_date']),
amount: readText(source['amount']),
createdBy: PurchaseRefundCreatedBy.fromMap(source['created_by']),
createdOn: readText(source['created_on']),
creditNote: PurchaseRefundCreditNote.fromMap(source['credit_note']),
creditNoteId: readText(source['credit_note_id']),
customAttributes: readList<PurchaseRefundCustomAttribute>(
source['custom_attributes'], PurchaseRefundCustomAttribute.fromMap),
date: readText(source['date']),
id: readText(source['id']),
issueDate: readText(source['issue_date']),
lastUpdatedBy: readText(source['last_updated_by']),
lastUpdatedOn: readText(source['last_updated_on']),
note: readText(source['note']),
object: readText(source['object']),
paymentMethod: readText(source['payment_method']),
paymentProcessor: readText(source['payment_processor']),
purchaseRefund: readAny(source['purchase_refund']),
reference: readText(source['reference']),
status: readText(source['status']),
uuid: readText(source['uuid']),
version: readInteger(source['version']),
);
}