fromMap static method

LabourProfileView? fromMap(
  1. Object? body
)

Implementation

static LabourProfileView? fromMap(Object? body) {
  final source = readRecord(body, envelopeKey: 'labour_profile');
  if (source == null) return null;
  return LabourProfileView(
    activityLogs: readList<Object>(source['activity_logs'], readAny),
    createdBy: LabourProfileViewCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    currency: LabourProfileViewCurrency.fromMap(source['currency']),
    displayName: readText(source['display_name']),
    href: readText(source['href']),
    id: readText(source['id']),
    labours: readList<LabourProfileViewLabour>(
        source['labours'], LabourProfileViewLabour.fromMap),
    lastUpdatedBy:
        LabourProfileViewLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    maxBookingLimit: readInteger(source['max_booking_limit']),
    name: readText(source['name']),
    object: readText(source['object']),
    sessions: readList<LabourProfileViewSession>(
        source['sessions'], LabourProfileViewSession.fromMap),
    status: readText(source['status']),
    tax: LabourProfileViewTax.fromMap(source['tax']),
    taxInclusive: readFlag(source['tax_inclusive']),
    version: readInteger(source['version']),
  );
}