fromMap static method
Implementation
static Usage? fromMap(Object? body) {
final source = readRecord(body, envelopeKey: 'usage');
if (source == null) return null;
return Usage(
chargeItem: UsageChargeItem.fromMap(source['charge_item']),
chargingEndDate: readText(source['charging_end_date']),
chargingPeriod: readText(source['charging_period']),
chargingStartDate: readText(source['charging_start_date']),
createdBy: UsageCreatedBy.fromMap(source['created_by']),
createdOn: readText(source['created_on']),
customAttributes: readList<UsageCustomAttribute>(
source['custom_attributes'], UsageCustomAttribute.fromMap),
endTime: readText(source['end_time']),
href: readText(source['href']),
id: readText(source['id']),
lastUpdatedBy: UsageLastUpdatedBy.fromMap(source['last_updated_by']),
lastUpdatedOn: readText(source['last_updated_on']),
object: readText(source['object']),
quantity: readDecimal(source['quantity']),
source: readAny(source['source']),
startTime: readText(source['start_time']),
status: readText(source['status']),
type: readText(source['type']),
uom: readAny(source['uom']),
version: readInteger(source['version']),
);
}