fromMap static method

LabourProfile? fromMap(
  1. Object? body
)

Implementation

static LabourProfile? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return LabourProfile(
    createdBy: LabourProfileCreatedBy.fromMap(source['created_by']),
    createdOn: readText(source['created_on']),
    currency: LabourProfileCurrency.fromMap(source['currency']),
    displayName: readText(source['display_name']),
    href: readText(source['href']),
    id: readText(source['id']),
    labours: readList<LabourProfileLabour>(
        source['labours'], LabourProfileLabour.fromMap),
    lastUpdatedBy:
        LabourProfileLastUpdatedBy.fromMap(source['last_updated_by']),
    lastUpdatedOn: readText(source['last_updated_on']),
    maxBookingLimit: readAny(source['max_booking_limit']),
    name: readText(source['name']),
    object: readText(source['object']),
    sessions: readList<LabourProfileSession>(
        source['sessions'], LabourProfileSession.fromMap),
    status: readText(source['status']),
    tax: LabourProfileTax.fromMap(source['tax']),
    taxInclusive: readFlag(source['tax_inclusive']),
    version: readInteger(source['version']),
  );
}