TrafficRoutingConfig.fromJson constructor

TrafficRoutingConfig.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory TrafficRoutingConfig.fromJson(Map<String, dynamic> json) {
  return TrafficRoutingConfig(
    timeBasedCanary: json['timeBasedCanary'] != null
        ? TimeBasedCanary.fromJson(
            json['timeBasedCanary'] as Map<String, dynamic>)
        : null,
    timeBasedLinear: json['timeBasedLinear'] != null
        ? TimeBasedLinear.fromJson(
            json['timeBasedLinear'] as Map<String, dynamic>)
        : null,
    type: (json['type'] as String?)?.toTrafficRoutingType(),
  );
}