PodFailurePolicy.fromJson constructor

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

Creates a PodFailurePolicy from JSON data.

Implementation

factory PodFailurePolicy.fromJson(Map<String, dynamic> json) {
  final tempRulesJson = json['rules'];

  final List<PodFailurePolicyRule> tempRules =
      List<dynamic>.from(tempRulesJson)
          .map(
            (e) => PodFailurePolicyRule.fromJson(
              Map<String, dynamic>.from(e),
            ),
          )
          .toList();

  return PodFailurePolicy(
    rules: tempRules,
  );
}