BillingMeterCreateOptions.fromJson constructor

BillingMeterCreateOptions.fromJson(
  1. Object? json
)

Implementation

factory BillingMeterCreateOptions.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return BillingMeterCreateOptions(
    customerMapping: map['customer_mapping'] == null
        ? null
        : 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
        : MeterEventTimeWindow.fromJson(map['event_time_window']),
    expand: map['expand'] == null
        ? null
        : (map['expand'] as List<Object?>)
            .map((el) => (el as String))
            .toList(),
    valueSettings: map['value_settings'] == null
        ? null
        : BillingMeterResourceBillingMeterValue.fromJson(
            map['value_settings']),
  );
}