fromMap static method

BookingPaymentView? fromMap(
  1. Object? body
)

Implementation

static BookingPaymentView? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'payment');
  if (source == null) return null;
  return BookingPaymentView(
    account: BookingPaymentViewAccount.fromMap(source['account']),
    createdBy: BookingPaymentViewCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    creditApplied: readList<Object>(source['credit_applied'], readAny),
    customAttributes: readList<Object>(source['custom_attributes'], readAny),
    giftCertificateApplied:
        readList<Object>(source['gift_certificate_applied'], readAny),
    id: readText(source['id']),
    invoices: readList<BookingPaymentViewInvoice>(
        source['invoices'], BookingPaymentViewInvoice.fromMap),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readAny(source['last_updated_on']),
    object: readText(source['object']),
    origin: readAny(source['origin']),
    paymentApplied: readList<BookingPaymentViewPaymentApplied>(
        source['payment_applied'], BookingPaymentViewPaymentApplied.fromMap),
    paymentNote: readText(source['payment_note']),
    reconcileStatus: readText(source['reconcile_status']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}