BillingMeter.fromJson constructor

BillingMeter.fromJson(
  1. Object? json
)

Implementation

factory BillingMeter.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return BillingMeter(
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    customerMapping: BillingMeterResourceCustomerMappingSettings.fromJson(
        map['customer_mapping']),
    defaultAggregation: BillingMeterResourceAggregationSettings.fromJson(
        map['default_aggregation']),
    displayName: (map['display_name'] as String),
    eventName: (map['event_name'] as String),
    eventTimeWindow: map['event_time_window'] == null
        ? null
        : BillingMeterEventTimeWindow.fromJson(map['event_time_window']),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    status: BillingMeterStatus.fromJson(map['status']),
    statusTransitions:
        BillingMeterResourceBillingMeterStatusTransitions.fromJson(
            map['status_transitions']),
    updated:
        DateTime.fromMillisecondsSinceEpoch((map['updated'] as int).toInt()),
    valueSettings:
        BillingMeterResourceBillingMeterValue.fromJson(map['value_settings']),
  );
}