fromMap static method
Implementation
static PurchasePayments? fromMap(Object? body) {
final source = readRecord(body, envelopeKey: 'purchase_payment');
if (source == null) return null;
return PurchasePayments(
account: PurchasePaymentsAccount.fromMap(source['account']),
activityLogs: readList<PurchasePaymentsActivityLog>(
source['activity_logs'], PurchasePaymentsActivityLog.fromMap),
code: readText(source['code']),
createdBy: PurchasePaymentsCreatedBy.fromMap(source['created_by']),
createdOn: readText(source['created_on']),
creditNoteApplications: readList<PurchasePaymentsCreditNoteApplication>(
source['credit_note_applications'],
PurchasePaymentsCreditNoteApplication.fromMap),
creditNoteTotal: readText(source['credit_note_total']),
currency: PurchasePaymentsCurrency.fromMap(source['currency']),
customAttributes: readList<Object>(source['custom_attributes'], readAny),
customObjects: readList<Object>(source['custom_objects'], readAny),
href: readText(source['href']),
id: readText(source['id']),
lastUpdatedBy: readText(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<PurchasePaymentsPaymentMethodApplication>(
source['payment_method_applications'],
PurchasePaymentsPaymentMethodApplication.fromMap),
paymentNote: readText(source['payment_note']),
paymentReference: readAny(source['payment_reference']),
purchaseCreditApplied:
readList<Object>(source['purchase_credit_applied'], readAny),
purchaseInvoiceApplications:
readList<PurchasePaymentsPurchaseInvoiceApplication>(
source['purchase_invoice_applications'],
PurchasePaymentsPurchaseInvoiceApplication.fromMap),
purchaseInvoices: readList<Object>(source['purchase_invoices'], readAny),
purchaseOrderId: readText(source['purchase_order_id']),
purchasePaymentApplied:
readList<Object>(source['purchase_payment_applied'], readAny),
purchasePaymentDate: readText(source['purchase_payment_date']),
purchasePaymentNote: readText(source['purchase_payment_note']),
status: readText(source['status']),
totalApplied: readText(source['total_applied']),
uuid: readText(source['uuid']),
version: readInteger(source['version']),
);
}