fromMap static method

Implementation

static LabourProfileViewSessionPrice? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return LabourProfileViewSessionPrice(
    enabledProRata: readFlag(source['enabled_pro_rata']),
    hours: readList<LabourProfileViewSessionPriceHour>(
        source['hours'], LabourProfileViewSessionPriceHour.fromMap),
    id: readText(source['id']),
    object: readText(source['object']),
    peakHourly: readList<Object>(source['peak_hourly'], readAny),
    price: readDecimal(source['price']),
    priceType: readText(source['price_type']),
    pricingLevel: LabourProfileViewSessionPricePricingLevel.fromMap(
        source['pricing_level']),
    status: readText(source['status']),
  );
}