fromMap static method

PurchaseOrderNoteView? fromMap(
  1. Object? body
)

Implementation

static PurchaseOrderNoteView? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'note');
  if (source == null) return null;
  return PurchaseOrderNoteView(
    attachments: readList<PurchaseOrderNoteViewAttachment>(
        source['attachments'], PurchaseOrderNoteViewAttachment.fromMap),
    content: readText(source['content']),
    createdBy: PurchaseOrderNoteViewCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    group: readAny(source['group']),
    href: readText(source['href']),
    id: readText(source['id']),
    lastUpdatedBy: readAny(source['last_updated_by']),
    lastUpdatedOn: readAny(source['last_updated_on']),
    object: readText(source['object']),
    purchaseOrder:
        PurchaseOrderNoteViewPurchaseOrder.fromMap(source['purchase_order']),
    user: readAny(source['user']),
    version: readInteger(source['version']),
    watchers: readList<PurchaseOrderNoteViewWatcher>(
        source['watchers'], PurchaseOrderNoteViewWatcher.fromMap),
  );
}