fromMap static method

PaymentRead? fromMap(
  1. Object? body
)

Implementation

static PaymentRead? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'payment');
  if (source == null) return null;
  return PaymentRead(
    account: PaymentReadAccount.fromMap(source['account']),
    activityLogs: readList<Object>(source['activity_logs'], readAny),
    createdBy: PaymentReadCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditApplied: readList<PaymentReadCreditApplied>(
        source['credit_applied'], PaymentReadCreditApplied.fromMap),
    customAttributes: readList<PaymentReadCustomAttribute>(
        source['custom_attributes'], PaymentReadCustomAttribute.fromMap),
    giftCertificateApplied: readList<PaymentReadGiftCertificateApplied>(
        source['gift_certificate_applied'],
        PaymentReadGiftCertificateApplied.fromMap),
    id: readText(source['id']),
    invoices: readList<PaymentReadInvoice>(
        source['invoices'], PaymentReadInvoice.fromMap),
    lastUpdatedBy:
        PaymentReadLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    object: readText(source['object']),
    origin: readText(source['origin']),
    paymentApplied: readList<PaymentReadPaymentApplied>(
        source['payment_applied'], PaymentReadPaymentApplied.fromMap),
    paymentNote: readText(source['payment_note']),
    reconcileStatus: readText(source['reconcile_status']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}