fromMap static method

BookingPayment? fromMap(
  1. Object? body
)

Implementation

static BookingPayment? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return BookingPayment(
    account: BookingPaymentAccount.fromMap(source['account']),
    createdBy: BookingPaymentCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditApplied: readList<Object>(source['credit_applied'], readAny),
    giftCertificateApplied:
        readList<Object>(source['gift_certificate_applied'], readAny),
    id: readText(source['id']),
    invoices: readList<BookingPaymentInvoice>(
        source['invoices'], BookingPaymentInvoice.fromMap),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readAny(source['last_updated_on']),
    object: readText(source['object']),
    origin: readAny(source['origin']),
    paymentApplied: readList<BookingPaymentPaymentApplied>(
        source['payment_applied'], BookingPaymentPaymentApplied.fromMap),
    paymentNote: readText(source['payment_note']),
    reconcileStatus: readText(source['reconcile_status']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}