fromMap static method

Timesheets? fromMap(
  1. Object? body
)

Implementation

static Timesheets? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'timesheet');
  if (source == null) return null;
  return Timesheets(
    activityLogs: readList<TimesheetsActivityLog>(
        source['activity_logs'], TimesheetsActivityLog.fromMap),
    createdBy: TimesheetsCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    endTime: readText(source['end_time']),
    href: readText(source['href']),
    id: readText(source['id']),
    labour: TimesheetsLabour.fromMap(source['labour']),
    lastUpdatedBy: TimesheetsLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    object: readText(source['object']),
    saleOrder: TimesheetsSaleOrder.fromMap(source['sale_order']),
    saleOrderItem: TimesheetsSaleOrderItem.fromMap(source['sale_order_item']),
    startTime: readText(source['start_time']),
    status: readText(source['status']),
    version: readInteger(source['version']),
  );
}